- int f,b;
- char ss[255];
- QPixmap p;
- VGRMap *pmap;
-
- switch(msg->param.pword[1])
- {
- case 10:tx=msg->param.pword[2];ty=msg->param.pword[3];break; // gotoxy
- case 11:fcol=msg->param.pword[2];break; // forecolor
- case 12:bcol=msg->param.pword[2];break; // bkcolor
- case 13:prv_font=bold_font;break;
- case 14:prv_font=italic_font;break;
- case 15:prv_font=normal_font;break;
- case 16:ClearAll();break;
- case 303: // Draw array_of char (x,y,fcol,bcol)
- f=fcol;b=bcol;
- fcol=msg->param.pword[4];
- bcol=msg->param.pword[5];
- TextXY(msg->param.pword[2],msg->param.pword[3],
- msg->param.pstr);
- fcol=f;bcol=b;
- break;
- case 300: // Draw int (x,y,int,fcol,bcol)
- f=fcol;b=bcol;
- fcol=msg->param.pword[5];
- bcol=msg->param.pword[6];
- IntXY(msg->param.pword[2],msg->param.pword[3],
- msg->param.pword[4]);
- fcol=f;bcol=b;
- break;
- case 301: // Draw char (x,y,char,fcol,bcol)
- f=fcol;b=bcol;
- fcol=msg->param.pword[5];
- bcol=msg->param.pword[6];
- CharXY(msg->param.pword[2],msg->param.pword[3],
- (char)(msg->param.pword[4]));
- fcol=f;bcol=b;
- break;
- case 302: // Draw real (x,y,int,frac,fcol,bcol)
- f=fcol;b=bcol;
- fcol=msg->param.pword[6];
- bcol=msg->param.pword[7];
- sprintf(ss,"%d.%d",msg->param.pword[4],msg->param.pword[5]);
- TextXY(msg->param.pword[2],msg->param.pword[3],ss);
- fcol=f;bcol=b;
- break;
- case -304: // ReadText (x,y,fcol,bcol)
- case -305:
- case -307:
- gfcol=msg->param.pword[4];
- gbcol=msg->param.pword[5];
- strcpy(internal_buffer,"");strcnt=0;
- GraphRead=TRUE;
- gx=msg->param.pword[2];
- gy=msg->param.pword[3];
- string_wait=TRUE;WriteChar('_');
- break;
- case -306:
- if (!GetInput(0))
- {
- gfcol=msg->param.pword[4];
- gbcol=msg->param.pword[5];
- strcpy(internal_buffer,"");strcnt=0;
- GraphRead=TRUE;
- gx=msg->param.pword[2];
- gy=msg->param.pword[3];
- char_wait = TRUE;
- }
- break;
- case 308: // Put image from file (x,y,fname)
- if (p.load(msg->param.pstr))
- {
- bitBlt(canvas,msg->param.pword[2],msg->param.pword[3],&p,0,0,p.width(),p.height());
- bitBlt(this,msg->param.pword[2]-ox, msg->param.pword[3]-oy,&p,0,0,p.width(),p.height());
- }
- break;
- case 309:// Kill map
- pmap = maps.first();
- while (pmap!=NULL)
- {
- if (msg->param.pword[2] == pmap->number)
- {
- maps.remove(pmap);
- break;
- }
- pmap=maps.next();
- }
- break;
- case 310: // Line (x1,y1,x2,y2,col)
- f=fcol;
- fcol=msg->param.pword[6];
- Line(msg->param.pword[2],msg->param.pword[3],
- msg->param.pword[4],msg->param.pword[5]);
- fcol=f;
- break;
- case 311: // Rectangle(x1,y1,x2,y2,fcol,icol)
- Rect(msg->param.pword[2],msg->param.pword[3],
- msg->param.pword[4],msg->param.pword[5],
- msg->param.pword[7],1);
- Rect(msg->param.pword[2],msg->param.pword[3],
- msg->param.pword[4],msg->param.pword[5],
- msg->param.pword[6],0);
- break;
- case 312: // ClearArea(x1,y1,w,h)
- ClearArea(msg->param.pword[2],msg->param.pword[3],
- msg->param.pword[4],msg->param.pword[5]);
- break;
- }//switch
+ int f,b;
+ char ss[255];
+ QPixmap p;
+ VGRMap *pmap;
+
+ switch(msg->param.pword[1]) {
+ /* gotoxy */
+ case 10:
+ tx = msg->param.pword[2];
+ ty = msg->param.pword[3];
+ break;
+ /* forecolor */
+ case 11:
+ fcol = msg->param.pword[2];
+ break;
+ /* bkcolor */
+ case 12:
+ bcol = msg->param.pword[2];
+ break;
+ case 13:
+ prv_font = bold_font;
+ break;
+ case 14:
+ prv_font = italic_font;
+ break;
+ case 15:
+ prv_font = normal_font;
+ break;
+ case 16:
+ ClearAll();
+ break;
+ /* Draw array_of char (x,y,fcol,bcol) */
+ case 303:
+ f = fcol;
+ b = bcol;
+ fcol = msg->param.pword[4];
+ bcol = msg->param.pword[5];
+ TextXY(msg->param.pword[2], msg->param.pword[3], msg->param.pstr);
+ fcol = f;
+ bcol = b;
+ break;
+ /* Draw int (x,y,int,fcol,bcol) */
+ case 300:
+ f = fcol;
+ b = bcol;
+ fcol = msg->param.pword[5];
+ bcol = msg->param.pword[6];
+ IntXY(msg->param.pword[2], msg->param.pword[3], msg->param.pword[4]);
+ fcol = f;
+ bcol = b;
+ break;
+ /* Draw char (x,y,char,fcol,bcol) */
+ case 301:
+ f = fcol;
+ b = bcol;
+ fcol = msg->param.pword[5];
+ bcol = msg->param.pword[6];
+ CharXY(msg->param.pword[2], msg->param.pword[3],
+ (char)(msg->param.pword[4]));
+ fcol = f;
+ bcol = b;
+ break;
+ /* Draw real (x,y,int,frac,fcol,bcol) */
+ case 302:
+ f = fcol;
+ b = bcol;
+ fcol = msg->param.pword[6];
+ bcol = msg->param.pword[7];
+ sprintf(ss, "%d.%d", msg->param.pword[4], msg->param.pword[5]);
+ TextXY(msg->param.pword[2], msg->param.pword[3], ss);
+ fcol = f;
+ bcol = b;
+ break;
+ /* ReadText (x,y,fcol,bcol) */
+ case -304:
+ case -305:
+ case -307:
+ gfcol = msg->param.pword[4];
+ gbcol = msg->param.pword[5];
+ strcpy(internal_buffer, "");
+ strcnt = 0;
+ GraphRead = TRUE;
+ gx = msg->param.pword[2];
+ gy = msg->param.pword[3];
+ string_wait = TRUE;
+ WriteChar('_');
+ break;
+ case -306:
+ if (!GetInput(0)) {
+ gfcol = msg->param.pword[4];
+ gbcol = msg->param.pword[5];
+ strcpy(internal_buffer, "");
+ strcnt = 0;
+ GraphRead = TRUE;
+ gx = msg->param.pword[2];
+ gy = msg->param.pword[3];
+ char_wait = TRUE;
+ }
+ break;
+ /* Put image from file (x,y,fname) */
+ case 308:
+ if (p.load(msg->param.pstr)) {
+ bitBlt(canvas, msg->param.pword[2],
+ msg->param.pword[3], &p,
+ 0, 0, p.width(), p.height());
+ bitBlt(this, msg->param.pword[2] - ox,
+ msg->param.pword[3] - oy, &p,
+ 0, 0, p.width(), p.height());
+ }
+ break;
+ /* Kill map */
+ case 309:
+ pmap = maps.first();
+ while (pmap != NULL) {
+ if (msg->param.pword[2] == pmap->number) {
+ maps.remove(pmap);
+ break;
+ }
+ pmap = maps.next();
+ }
+ break;
+ /* Line (x1,y1,x2,y2,col) */
+ case 310:
+ f = fcol;
+ fcol = msg->param.pword[6];
+ Line(msg->param.pword[2], msg->param.pword[3],
+ msg->param.pword[4], msg->param.pword[5]);
+ fcol = f;
+ break;
+ /* Rectangle(x1,y1,x2,y2,fcol,icol) */
+ case 311:
+ Rect(msg->param.pword[2], msg->param.pword[3],
+ msg->param.pword[4], msg->param.pword[5],
+ msg->param.pword[7], 1);
+ Rect(msg->param.pword[2], msg->param.pword[3],
+ msg->param.pword[4],msg->param.pword[5],
+ msg->param.pword[6], 0);
+ break;
+ /* ClearArea(x1,y1,w,h) */
+ case 312:
+ ClearArea(msg->param.pword[2],msg->param.pword[3],
+ msg->param.pword[4], msg->param.pword[5]);
+ break;
+ }//switch