void clearworkarea( void ) { struct viewporttype t; getviewsettings( &t ); setviewport( 1 + align, 25, 638 + align, 346, 0 ); clearviewport( ); setviewport( t.left, t.top, t.right, t.bottom, t.clip ); }
void CirculoGrafico::exibe(int x1, int y1, int x2, int y2) const { int x = getmaxx(), y = getmaxy(); setcolor(this->c_cor); setlinestyle(0, 0, this->c_grossura); if (x2 > x) x2 = x; else if (x2 < 0) x2 = 0; if (x1 > x) x1 = x; else if (x1 < 0) x1 = 0; if (y2 > y) y2 = y; else if (y2 < 0) y2 = 0; if (y1 > y) y1 = y; else if (y1 < 0) y1 = 0; setviewport(x1, y1, x2, y2, 1); circle(this->c_x, this->c_y, this->c_raio); setviewport(0, 0, x, y, 0); setlinestyle(0, 0, 1); }
int main() { initgraph(640, 480); //设置视口矩形区域为(200,100) - (330, 130) //最后一个参数为1表示出了这个区域的图形会被裁剪 //后面所绘画的图形的原点坐标(0,0),会映射到(200,100) setviewport(200, 100, 330, 130, 1); //画一些文字,注意文字会因区域被裁剪的效果 setcolor(EGERGB(0x0, 0xFF, 0x0)); setfontbkcolor(RGB(0x80, 0x00, 0x80)); setfont(18, 0, "宋体"); outtextxy(0, 0, "Hello EGE Graphics"); setbkmode(TRANSPARENT); outtextxy(0, 20, "Hello EGE Graphics"); //还原视口 setviewport(0, 0, getwidth(), getheight(), 1); outtextxy(0, 0, "Hello EGE Graphics"); getch(); closegraph(); return 0; }
void WorkArea::draw() { struct viewporttype vp; getviewsettings(&vp); setviewport(x1, y1, x2, y2, 1); setfillstyle(SOLID_FILL, bgCol); bar(x1, y1, x2, y2); items->drawAll(); setviewport(vp.left, vp.top, vp.right, vp.bottom, vp.clip); }
void WorkArea::clear() { delete items; struct viewporttype vp; getviewsettings(&vp); setviewport(x1, y1, x2, y2, 1); items = new List(); clearviewport(); setviewport(vp.left, vp.top, vp.right, vp.bottom, vp.clip); }
void DrawFrame(HWND Window,int DrawLeft,int DrawTop, int DrawRight,int DrawBottom) { int SaveColor; struct viewporttype TmpViewPort; int Left,Top,Right,Bottom; MouseHidden(); SaveColor=getcolor(); getviewsettings(&TmpViewPort); WindowGetRealRect(Window,&Left,&Top,&Right,&Bottom); DrawLeft+=Left; DrawTop+=Top; DrawRight+=Left; DrawBottom+=Top; setviewport(DrawLeft,DrawTop,DrawRight,DrawBottom,1); Left-=DrawLeft; Top-=DrawTop; Right-=DrawLeft; Bottom-=DrawTop; setfillstyle(1,FRAMEBKCOLOR); bar(Left,Top,Right,Bottom); setcolor(FRAMECOLOR); Left+=2; Top+=2+CHARHEIGHT/2; Right-=2; Bottom-=2; if (Left<=2) Vline3DDown(DrawLeft,DrawTop,DrawRight,DrawBottom,Left,Top,Bottom); if (Right>=Right-Left-3) Vline3DDown(DrawLeft,DrawTop,DrawRight,DrawBottom,Right-1,Top,Bottom); if (Top<=2+CHARHEIGHT/2) Hline3DDown(DrawLeft,DrawTop,DrawRight,DrawBottom,Left+1,Right,Top); if (DrawBottom>=Bottom-Top-3) Hline3DDown(DrawLeft,DrawTop,DrawRight,DrawBottom,Left+2,Right-1,Bottom); ViewportDisplayString(WindowGetTitle(Window),Left+8,Top-CHARHEIGHT/2, FRAMECOLOR,FRAMEBKCOLOR); setviewport(TmpViewPort.left,TmpViewPort.top,TmpViewPort.right, TmpViewPort.bottom,TmpViewPort.clip); setcolor(SaveColor); MouseShow(); return; }
void NetPlayerInfoView::show() { if (buffer_img_.img) { putimage(buffer_img_.x, buffer_img_.y, buffer_img_.img); delimage(buffer_img_.img); buffer_img_.img = NULL; } calc_view_width_height(); buffer_img_.x = pos_x_; buffer_img_.y = pos_y_; int temp_viewport_left, temp_viewport_right, temp_viewport_top, temp_viewport_bottom; getviewport(&temp_viewport_left, &temp_viewport_top, &temp_viewport_right, &temp_viewport_bottom); setviewport(pos_x_, pos_y_, pos_x_ + view_width_, pos_y_ + view_height_); buffer_img_.img = newimage(view_width_, view_height_); putimage(buffer_img_.img, 0, 0, NULL); setviewport(temp_viewport_left, temp_viewport_top, temp_viewport_right, temp_viewport_bottom); int target_top = pos_y_; if (player_pic_) { player_pic_->show_image_with_alpha(pos_x_ + view_width_ / 2 - player_pic_->get_width() / 2, target_top, 1.0); target_top += player_pic_->get_width() + margin_; } setcolor(WHITE); if (player_name_.length() > 0) { Gobang::set_font(Gobang::font_default, name_font_size_, true); xyprintf(pos_x_ + view_width_ / 2 - textwidth(player_name_.c_str()) / 2, target_top, player_name_.c_str()); target_top += textheight(player_name_.c_str()) + margin_; } if (is_ready_) { Gobang::set_font(Gobang::font_default, ready_font_size_); xyprintf(pos_x_ + view_width_ / 2 - textwidth("Ready!") / 2, target_top, "Ready!"); target_top += textheight("Ready!") + margin_; if (is_playing_) { playing_indicator_->show_image_with_alpha(pos_x_ + view_width_ / 2 - playing_indicator_->get_width() / 2, target_top, 1.0); target_top += playing_indicator_->get_height() + margin_; } } else if (!is_opposite_) { button_ready_->set_position(pos_x_ + view_width_ / 2 - button_ready_->get_width() / 2, target_top); button_ready_->show(); target_top += button_ready_->get_height() + margin_; } }
static long StatusProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case MOUSELEFTDOUBLE: MessageInsert(1,MENUCOMMAND,MENU_GOTOPAGE,0); return 0L; case WINDOWINIT: case WMPAINT: case REDRAWMESSAGE: case DRAWWINDOW: if (GlobalCurrentPage > 0) { struct viewporttype TmpViewPort; int Left,Top,Right,Bottom; char msg[80]; int pn; pn = PageHandleToNumber(GlobalCurrentPage)+1; if(TotalPage<pn) TotalPage=pn; // ByHance, 96,4.4 sprintf(msg,"ÇáËÉÅÅ°æ: µÚ%dÒ³,¹²%dÒ³",pn,TotalPage); if(fEditor) { //-- "±à¼" --- msg[4]='±'; msg[5]='à'; msg[6]='¼'; msg[7]=''; sprintf(&msg[strlen(msg)]," ÐÐ:%d",CurrentRow); } if (TextIsOverwrite()) strcat(msg," ¸Äд"); WindowDefaultProcedure(Window,Message,Param1,Param2); getviewsettings(&TmpViewPort); MouseHidden(); WindowGetRealRect(Window,&Left,&Top,&Right,&Bottom); setcolor(EGA_BLACK); rectangle(Left,Top,Right,Bottom); setviewport(Left+1,Top+1,Right-1,Bottom-1,1); setfillstyle(1,EGA_LIGHTGRAY); bar(0,0,Right-Left-3,Bottom-Top-3); ViewportDisplayString(msg,5,1,EGA_BLACK,EGA_LIGHTGRAY); setviewport(TmpViewPort.left,TmpViewPort.top,TmpViewPort.right, TmpViewPort.bottom,TmpViewPort.clip); MouseShow(); } break; default: return(WindowDefaultProcedure(Window,Message,Param1,Param2)); } return 0L; }
main() { int i, j = 0, gd = DETECT, gm; initgraph(&gd,&gm,"C:\\TURBOC3\\BGI"); settextstyle(DEFAULT_FONT,HORIZ_DIR,2); outtextxy(25,240,"Press any key to view the moving car"); getch(); setviewport(0,0,639,440,1); for( i = 0 ; i <= 420 ; i = i + 10, j++ ) { rectangle(50+i,275,150+i,400); rectangle(150+i,350,200+i,400); circle(75+i,410,10); circle(175+i,410,10); setcolor(j); delay(100); if( i == 420 ) break; clearviewport(); } getch(); closegraph(); return 0; }
void main() { int gd=DETECT, gm, maxx, maxy, x, y, button; initgraph(&gd, &gm, "c:/tc/bgi"); maxx=getmaxx(); maxy=getmaxy(); rectangle(0,56,maxx,maxy); setviewport(1,57,maxx-1,maxy-1,1); gotoxy(26,1); printf("DEMONSTRATION : MOUSE IN C"); gotoxy(28,2); printf("BY: OSHO PRAKASH GIRI"); if(initmouse()==0) { closegraph(); restorecrtmode(); printf("\nMOUSE DRIVER NOT LOADED"); exit(); } restrictmouseptr(1,57,maxx-1,maxy-1); showmouseptr(); getch(); }
/* * Seteaza viewport-ul curent in functie de parametrul v la niste valori * predefinite. */ void set(int v) { setcolor(MAGENTA); switch (v) { case 0: setviewport(0, 50, getmaxx(), getmaxy(), 1); setwritemode(COPY_PUT); rectangle(0, 0, getmaxx(), getmaxy()-50); setviewport(1, 51, getmaxx()-1, getmaxy()-1, 1); break; case 1: setviewport(10, 5, 100, 45, 1); break; case 2: setviewport(110, 5, 200, 45, 1); break; case 3: setviewport(210, 5, 300, 45, 1); break; case 4: setviewport(310, 5, 500, 45, 1); break; case 5: setviewport(490, 0, getmaxx(), 48, 1); break; } setcolor(CYAN); }
void MainWindow( char *header ) { int height; cleardevice(); /* Clear graphics screen */ setcolor( MaxColors - 1 ); /* Set current color to white */ setviewport( 0, 0, MaxXX, MaxYY, 1 ); /* Open port to full screen */ height = textheight( "H" ); /* Get basic text height */ changetextstyle( DEFAULT_FONT, HORIZ_DIR, 1 ); settextjustify( CENTER_TEXT, TOP_TEXT ); outtextxy( MaxXX/2, 2, header ); setviewport( 0, height+4, MaxXX, MaxYY-(height+4), 1 ); DrawBorder(); setviewport( 1, height+5, MaxXX-1, MaxYY-(height+5), 1 ); }
void interfaz(void) { // limpiar_pantalla(); setviewport(TITULO); clearviewport(); barra_titulo("=*CINEMATIC*="); setviewport(BARRA); clearviewport(); /*setcolor(AZUL+3); line(0,0,639,0); line(0,18,639,18); line(0,0,0,479); line(639,0,639,479); line(0,479,639,479); line(0,340,639,340);*/ }
void InitialScreen ( void ) { CriaJanelaGrafica(MENUPRINCIPAL,MPRINC,0, "PRINCIPAL"); CriaJanelaGrafica(MENUSECUNDARIO,MSECUND,0,"RESULTADOS"); setcolor(COR_MODURA); setviewport ( 10 , 10 , 709 , 337 , 1 ); Moldura (); setviewport ( 30 , 30 , 689 , 317 , 1 ); Moldura (); setviewport ( 0 , 0 , 719 , 347 , 1 ); setcolor(COR_TTULO); changetextstyle ( TRIPLEX_FONT , HORIZ_DIR , 8 ); settextjustify ( CENTER_TEXT , TOP_TEXT ); outtextxy ( 360 , 30 , "Pulmosoft - PC" ); changetextstyle ( TRIPLEX_FONT , HORIZ_DIR , 1 ); outtextxy ( 485 , 130 , "BEATRICE - EBEM @1994 V4.0" ); changetextstyle(DEFAULT_FONT,HORIZ_DIR,1); }
void StatusLine( char *msg ) { int height; setviewport( 0, 0, MaxXX, MaxYY, 1 ); /* Open port to full screen */ setcolor( MaxColors - 1 ); /* Set current color to white */ changetextstyle( DEFAULT_FONT, HORIZ_DIR, 1 ); settextjustify( CENTER_TEXT, TOP_TEXT ); setlinestyle( SOLID_LINE, 0, NORM_WIDTH ); setfillstyle( EMPTY_FILL, 0 ); height = textheight( "H" ); /* Detemine current height */ bar( 0, MaxYY-(height+4), MaxXX, MaxYY ); rectangle( 0, MaxYY-(height+4), MaxXX, MaxYY ); outtextxy( MaxXX/2, MaxYY-(height+2), msg ); setviewport( 1, height+5, MaxXX-1, MaxYY-(height+5), 1 ); }
void setviewdefaults(void) { setviewpoint(0.0,-5.0,0.0); setviewnormal(0.0,1.0,0.0); setviewup(0.0,0.0,1.0); setviewdistance(1.0); setviewdepth(1.0,100000.0); setwindow(0.0,0.0,0.41421356,0.31066017); setprojection(PERSPECTIVE); setviewport(0.,0.,320.,240.,-32768.,32767.); }
/* * Setarea vederii active. */ void set(int i) { switch (i) { case 0: setviewport(0, 80, 318, 398, 1); break; case 1: setviewport(321, 80, 639, 398, 1); break; case 2: setviewport(1, 81, 317, 397, 1); break; case 3: setviewport(322, 81, 638, 397, 1); break; case 4: setviewport(10, 410, 630, 475, 1); break; } }
void TellFileName() // ByHance, 95,12.18 { #define X 32 #define Y 8 #define MAXLEN 26 char name[128]; int SaveColor=getcolor(); struct viewporttype ViewInformation; if(!DebugFileName[0]) strcpy(name,"ÎļþδÃüÃû"); else { int len; strcpy(name,DebugFileName); if( (len=strlen(name))>MAXLEN) // only display 32 chars memmove(name,&name[len-MAXLEN],MAXLEN+1); strupr(name); } getviewsettings(&ViewInformation); MouseHidden(); setviewport(0,0,getmaxx(),getmaxy(),1); setcolor(EGA_BLUE); bar(X,Y,X+MAXLEN*ASC16WIDTH,Y+ASC16HIGHT); DisplayString(name,X,Y,EGA_WHITE,EGA_BLUE); setcolor(SaveColor); setviewport(ViewInformation.left,ViewInformation.top, ViewInformation.right,ViewInformation.bottom, ViewInformation.clip); MouseShow(); #undef Y #undef X #undef MAXLEN } /* TellFileName */
static void DrawLine(int x0,int y0,int x1,int y1,int color) { int SaveColor; struct viewporttype SaveViewPort; MouseHidden(); getviewsettings(&SaveViewPort); SaveColor=getcolor(); setviewport(ScreenX,ScreenY,ScreenX+mXw-1,ScreenY+mYw-1,1); if (color<0) { setwritemode(XOR_PUT); color=-color; } else setwritemode(COPY_PUT); setcolor(color); line(x0,y0,x1,y1); setwritemode(COPY_PUT); setcolor(SaveColor); setviewport(SaveViewPort.left,SaveViewPort.top,SaveViewPort.right, SaveViewPort.bottom,SaveViewPort.clip); MouseShow(); }
void main() { int gd=DETECT,gm,maxx,maxy,x,y,button; initgraph(&gd,&gm,"C:\\TC"); maxx=getmaxx(); maxy=getmaxy(); rectangle(0,56,maxx,maxy); setviewport(1,57,maxx-1,maxy-1,1); gotoxy(26,1); printf("MOUSE DEMONSTRATION PROGRAM"); if(initmouse()==0) { closegraph(); restorecrtmode(); printf("\nMouseDriver not loaded"); exit(0); } restrictmouseptr(1,57,maxx-1,maxy-1); showmouseptr(); gotoxy(1,2); printf("Left Button"); gotoxy(15,2); printf("Right Button"); gotoxy(55,3); printf("Press Any Key to Exit..."); while(!kbhit()) { getmousepos(&button,&x,&y); gotoxy(5,3); (button & 1)==1? printf("DOWN") : printf("UP "); gotoxy(20,3); (button & 2)==2? printf("DOWN") : printf("UP "); gotoxy(65,2); printf("x=%03d y=%03d",x,y); } }
int main() { int unidad = 0,modo; initgraph (&unidad,&modo,"c:\\bc\\bgi"); if (graphresult() != 0) { cout << "Error al tratar de pasar al modo grafico\n"; getch(); return 1; } setviewport (50,50,270,208,clipon); // x = 0-220 y = 0-158 moveto(10,10); outtext ("1234567890"); getch(); closegraph(); return 0; }
int main() { int unidad = 0,modo; initgraph (&unidad,&modo,"c:\\bc\\bgi"); if (graphresult() != 0) { cout << "Error al tratar de pasar al modo grafico\n"; getch(); return 1; } setviewport (50,10,90,300,clipoff); outtext ("1234567890"); getch(); clearviewport(); // Quedan pintados los caracteres 67890 getch(); closegraph(); return 0; }
void main() { int gd=DETECT,gm,maxx,maxy,x,y,button,prevx,prevy; initgraph(&gd,&gm,"d:\\tc\\bgi"); printf("Freehand drawing with the mouse"); maxx=getmaxx(); maxy=getmaxy(); rectangle(0,0,maxx,maxy); setviewport(1,1,maxx-1,maxy-1,1); if(initmouse()==0) { closegraph(); restorecrtmode(); printf("Mouse driver not loaded"); exit(1); } restrictmouseptr(1,1,maxx-1,maxy-1); showmouseptr(); while(!kbhit()) { getmousepos(&button,&x,&y); if((button & 1)==1) { hidemouseptr(); prevx=x; prevy=y; while((button & 1)==1) { line(prevx,prevy,x,y); prevx=x; prevy=y; getmousepos(&button,&x,&y); } showmouseptr(); } } }
int main() { int unidad = 0,modo; initgraph (&unidad,&modo,"c:\\bc\\bgi"); if (graphresult() != 0) { cout << "Error al tratar de pasar al modo grafico\n"; getch(); return 1; } moveto(20,20); outtext ("p r u e b a"); setviewport (100,100,400,400, 1 ); getch(); cleardevice(); getch(); closegraph(); return 0; }
void main() { int gd=DETECT,gm,maxx,maxy,x,y,button; initgraph(&gd,&gm,"c:\\tc\\bgi"); maxx=getmaxx(); maxy=getmaxy(); rectangle(0,56,maxx,maxy); setviewport(1,57,maxx-1,maxy-1,1); gotoxy(26,1); printf("Mouse Demonstration Program!"); if(initmouse()==0) { closegraph(); restorecrtmode(); printf("Mouse driver not loaded"); exit(1); } restrictmouseptr(1,57,maxx-1,maxy-1); showmouseptr(); gotoxy(1,2); printf("Left Button"); gotoxy(15,2); printf("Right Button"); gotoxy(55,3); printf("Press any key to exit"); while(!kbhit()) { getmousepos(&button,&x,&y); gotoxy(5,3); (button&1)==1 ? printf("DOWN"):printf("UP"); gotoxy(20,3); (button&2)==2 ? printf("DOWN"):printf("UP"); gotoxy(65,2); printf("X=%03d y=%03d",x,y); } }
void main() { // VARIABLE DECLARATIONS int i=0,j=0,a,front=-1,rear=-1; char ch,ch1; int item; // FUNCTION PROTOTYPE DECLARATIONS void show(); void slidebar(int *rear,int *front); void showqueuesize(); void slidebar(); void cpoiters(); void drawq(); void moveptrs(int *rear,int *front); void insertq(int *rear,char c); void deleteq(int *front); void qdelete(int q[],int rear,int front); void hidequeueinfo(); void shownumbers(int x1,int y1,int x2,int y2); int initmouse(); void getmousepos(int *button,int *x,int *y); void showmouseptr(); void restrictmouseptr(int a,int b,int c,int d); void exitbutton(int x1,int y1,int x2,int y2,int e_x,int e_y,int xit_x,int xit_y); void zoomin(); // CHECKING THE GRAPHICS DRIVER int gd=DETECT,gm,maxx,maxy,x,y,button; initgraph(&gd,&gm,"c:\\TC"); // GET THE MAXIMUM X AND Y CO ORDINATES maxx=getmaxx(); maxy=getmaxy(); // DRAW THE BORDER FOR THE WINDOW rectangle(0,0,maxx,maxy); // SET THE AREA WITHIN THE SCREEN WHERE GRAPHICAL O/P DISPLAYED setviewport(1,1,maxx-1,maxy-1,1); // WRITE THE HEADDING gotoxy(150,1); settextstyle(TRIPLEX_FONT,HORIZ_DIR,3); setcolor(WHITE); setbkcolor(216); settextjustify(0,2); outtextxy(220,2," LINEAR QUEUE "); setcolor(RED); settextstyle(8,HORIZ_DIR,3); outtextxy(40,35,"DEVELOPED IN 'C' : IT'S A KVSM PRODUCT"); settextstyle(0,HORIZ_DIR,0); // INITIALIZE MOUSE,IF IT DOESN'T GET INITIALIZED CLOSE GRAPHICS MODE if (initmouse()==0) { closegraph(); restorecrtmode(); printf("\nMouse Driver not installed"); exit(1); } // IF MOUSE DRIVER INITIALISED THEN // RESTRICT THE MOUSE POINTER WITHIN THE COORDINATES GIVEN GIVEN BELOW restrictmouseptr(1,57,maxx-1,maxy-1); // SHOW THE MOUSE POINTER showmouseptr(); // SET THE TEXT COLOR TO WHITE setcolor(WHITE); line(0,70,getmaxx(),70); line(0,400,getmaxx(),400); setcolor(14); outtextxy(65,115,"QUEUE OPERATIONS QUEUE STATUS"); outtextxy(140,440,"Press the Key that is Highlighted or use Mouse."); setcolor(CYAN); line(65,125,190,125); line(368,125,464,125); // CALL THE SHOW FUNCTION TO DRAW THE VARIOUS BUTTONS show(); // DRAW THE QUEUE drawq(); // DRAW THE POINTERS THAT IS FRONT AND REAR moveptrs(&rear,&front); // SET THE LABEL M THAT WILL BE USED LATER FOR UNCONDITIONAL JUMP m: // GO ON CHECKING WHETHER A KEY IS PRESSED OR NOT while (i==0) { if (kbhit()) { ch=getche(); // CHECK IF THE KEY PRESSED IS E OR e switch(ch) { case 'e': case 'E': { // CALL THE FUNCTION THAT WILL BE FOR EXIT zoomin(); } reset: case 'R': case 'r': { // CALL THE RESET QUEUE FUNCTION hidequeueinfo(); // CALL THE PROGRESSBAR slidebar(&rear,&front); // AGAIN DRAW THE QUEUE drawq(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } queueinfo: case 'A' : case 'a': { // CALL THE FUNCTION TO GIVE INFORMATION ABOUT QUEUE hidequeueinfo(); showqueuesize(); goto m; } delet: case 'D': case 'd': { // CALL THE DELETE QUEUE OPERATIONS hidequeueinfo(); deleteq(&front); // CHECK IF QUEUE IS EMPTY, IF SO PRINT THE MESSAGE if(rear==-1 || front==5 ||rear<front) { // CLEAR THE INFO, THERE IN INFORMATION PART hidequeueinfo(); // DISPLAY THE TEXT IN THE INFORMATION PART outtextxy(200,430,"Queue is empty, you can't delete"); } else { front=front+1; moveptrs(&rear,&front); } goto m; } ins: case 'I': case 'i': { // HERE IS THE OPERATIONS FOR INSERTING AN ELEMENT hidequeueinfo(); if(rear==4) { hidequeueinfo(); outtextxy(200,430,"Queue is full, you can't insert"); goto m; } // SHOWS THE NUMBERS AND CANCEL BUTTON shownumbers(20,430,60,470); // CHECK FOR WHAT KEY PRESSED n: while(j==0) { if (kbhit()) { ch1=getche(); if(front==-1) { front=front+1; } switch(ch1) { cancel: case 'C': case 'c': { hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } zero: case '0': { insertq(&rear,'0'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } one: case '1': { insertq(&rear,'1'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } two: case '2': { insertq(&rear,'2'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } three: case '3': { insertq(&rear,'3'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } four: case '4': { insertq(&rear,'4'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } five: case '5': { insertq(&rear,'5'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } six: case '6': { insertq(&rear,'6'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } seven: case '7': { insertq(&rear,'7'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } eight: case '8': { insertq(&rear,'8'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } nine: case '9': { insertq(&rear,'9'); rear=rear+1; moveptrs(&rear,&front); hidequeueinfo(); restrictmouseptr(1,57,maxx-1,maxy-1); goto m; } default : hidequeueinfo(); outtextxy(200,430,"Invalid Key Pressed ! Press a valid key"); delay(550); hidequeueinfo(); shownumbers(20,430,60,470); goto n; } } else { //write code here to press the 0-----9 and cancel getmousepos(&button,&x,&y); if((button & 1)==1) { if(front==-1) { front=front+1; } } if( (x>500 && x<getmaxx()-10 && y>445 && y<470) && (button & 1)==1) { goto cancel; } if( (x>20 && x<60 && y>430 && y<470) && (button & 1)==1) { goto zero; } if( (x>60 && x<100 && y>430 && y<470) && (button & 1)==1) { goto one; } if( (x>100 && x<140 && y>430 && y<470) && (button & 1)==1) { goto two; } if( (x>140 && x<180 && y>430 && y<470) && (button & 1)==1) { goto three; } if( (x>180 && x<220 && y>430 && y<470) && (button & 1)==1) { goto four; } if( (x>220 && x<260 && y>430 && y<470) && (button & 1)==1) { goto five; } if( (x>260 && x<300 && y>430 && y<470) && (button & 1)==1) { goto six; } if( (x>300 && x<340 && y>430 && y<470) && (button & 1)==1) { goto seven; } if( (x>340 && x<380 && y>430 && y<470) && (button & 1)==1) { goto eight; } if( (x>380 && x<420 && y>430 && y<470) && (button & 1)==1) { goto nine; } } } } default : hidequeueinfo(); outtextxy(220,420,"Please Press a Valid Key"); goto m; } } // ELSE CONDITION FOR THE IF AFTER THE FIRST WHILE else { getmousepos(&button,&x,&y); if( (x>50 && x<200 && y<370 && y>350) && (button & 1)==1) { //exit button click zoomin(); } if( (x>50 && x<200 && y>150 && y<170) && (button & 1)==1) { //clicked the queueinfo button goto queueinfo; } if( (x>50 && x<200 && y>200 && y<220) && (button & 1)==1) { //clicked the insert button goto ins; } if( (x>50 && x<200 && y>250 && y<270) && (button & 1)==1) { //clicked the delete button delay(500); goto delet; } if( (x>50 && x<200 && y>300 && y<320) && (button & 1)==1) { //clicked the reset button goto reset; } } } getche(); }
/* * Initializeaza toate spatiile de editare. */ void initialize_variable_spaces() { set(1); setcolor(RED); outtextxy(0, 0, "Transl. cu:"); idx = 1; outtextxy(10, 15, "x = "); variable_space(1); print_numbers(); idx = 2; setcolor(RED); outtextxy(10, 30, "y = "); variable_space(1); print_numbers(); set(2); setcolor(RED); outtextxy(0, 0, "Scalare cu:"); idx = 3; outtextxy(10, 15, "x = "); variable_space(1); print_numbers(); idx = 4; setcolor(RED); outtextxy(10, 30, "y = "); variable_space(1); print_numbers(); set(3); setcolor(RED); outtextxy(0, 0, "Rotire cu:"); idx = 5; outtextxy(10, 15, "р = "); variable_space(1); print_numbers(); set(4); setcolor(RED); outtextxy(0, 0, "Coord. dr. aleatoare:"); idx = 6; outtextxy(10, 15, "x = "); variable_space(1); print_numbers(); idx = 7; setcolor(RED); outtextxy(10, 30, "y = "); variable_space(1); print_numbers(); idx = 8; setcolor(RED); outtextxy(90, 15, "р = "); variable_space(1); print_numbers(); idx = 1; variable_space(1); set(5); setcolor(RED); outtextxy(1, 5, "Comenzi:"); outtextxy(1, 15, "+, -, t, s, r, c"); outtextxy(1, 25, "x, y, o, d"); outtextxy(1, 37, "ESC, sageti, TAB"); setviewport(0, 0, getmaxx(), getmaxy(), 1); setcolor(RED); line(5, 3, 5, 47); line(105, 3, 105, 47); line(205, 3, 205, 47); line(305, 3, 305, 47); line(485, 3, 485, 47); line(635, 3, 635, 47); line(5, 2, 635, 2); line(5, 48, 635, 48); }
long ListBoxDefaultProcedure(HWND Window,HMSG Message,long Param1,long Param2) { struct viewporttype TmpViewPort; int i,Length,key; HWND MidWindow; int DisplayItem; int DisplayWidth; char MidString[100]; int Left,Top,Right,Bottom; int SaveColor; switch (Message) { case WINDOWQUIT: ListHandleFree(); break; case KEYSTRING: break; case KEYDOWN: switch (MAKELO(Param1)) { case HOME: Param2=ListGetCurrent(WindowList(Window)); goto lbl_upward; case PGUP: Param2=ListGetHeight(WindowList(Window)); goto lbl_upward; case UP: Param2=1; lbl_upward: Length=Param2; if (ListGetCurrent(WindowList(Window))-Length<0) Length=ListGetCurrent(WindowList(Window)); if (!Length) { //Alarm(); break; } Length=-Length; goto lbl_process_up_down; case END: Param2=ListGetTotal(WindowList(Window))-1 -ListGetCurrent(WindowList(Window)); goto lbl_downward; case PGDN: Param2=ListGetHeight(WindowList(Window)); goto lbl_downward; case DOWN: Param2=1; lbl_downward: Length=Param2; if (ListGetCurrent(WindowList(Window))+Length>= ListGetTotal(WindowList(Window))-1) Length=ListGetTotal(WindowList(Window))-1 -ListGetCurrent(WindowList(Window)); if (!Length) { // Alarm(); break; } lbl_process_up_down: ListIncCurrent(WindowList(Window),Length); MessageInsert(Window,ITEMSELECT, ListGetCurrent(WindowList(Window)),Window); #ifdef USE_SCROLL MidWindow=GetVVScroll(Window); if (MidWindow) { i=WindowGetHeight(Window)-3*SYSSCROLLWIDTH-2; i*=ListGetCurrent(WindowList(Window)); // i/=ListGetTotal(WindowList(Window)); i/=ListGetTotal(WindowList(Window))-1; i=i-WindowGetTop(MidWindow)+SYSSCROLLWIDTH; //*------ if(WindowGetBottom(MidWindow)+i> WindowGetHeight(WindowGetFather(MidWindow))-2-SYSSCROLLWIDTH) i=WindowGetHeight(WindowGetFather(MidWindow))-2 -SYSSCROLLWIDTH-WindowGetBottom(MidWindow); //--------------------------*/ MessageInsert(MidWindow,WINDOWMOVE,0l,i); } #endif if (!ListVScroll(Window)) { DisplayItem=ListGetCurrent(WindowList(Window)) -ListGetTop(WindowList(Window)); // MessageInsert(Window,WMPAINT,MAKELONG(0, MessageInsert(Window,REDRAWMESSAGE,MAKELONG(0, (DisplayItem-Length)*CHARHEIGHT), MAKELONG(0,(DisplayItem-Length+1))*CHARHEIGHT); // MessageInsert(Window,WMPAINT,MAKELONG(0,DisplayItem*CHARHEIGHT), MessageInsert(Window,REDRAWMESSAGE,MAKELONG(0,DisplayItem*CHARHEIGHT), MAKELONG(0,(DisplayItem+1)*CHARHEIGHT)); } break; case TAB: WindowTableOrderNext(Window); break; case SHIFT_TAB: WindowTableOrderPrev(Window); break; case ENTER: #ifdef USE_SCROLL if (!WindowIsChildless(Window)) MessageGo(WindowGetChild(Window),WINDOWCLOSE,0l,0l); #endif MessageInsert(Window,LISTBOXCONFIRM,0L,0L); break; case ESC: #ifdef USE_SCROLL // Added ByHance, 96,4.2 if (!WindowIsChildless(Window)) MessageGo(WindowGetChild(Window),WINDOWCLOSE,0l,0l); #endif MessageInsert(WindowGetFather(Window),Message,Param1,Param2); break; default: key=MAKELO(Param1); key=toupper(key); if(key>='A' && key<='Z') { // quick select FirstLetterItem for(i=0;i<ListGetTotal(WindowList(Window));i++) { int ch; char *str; str=ListGetItem( WindowList(Window),i ), ch=toupper(str[0]); if(ch>=key) break; } if( i>=ListGetTotal(WindowList(Window)) ) i=ListGetTotal(WindowList(Window))-1; //the last Param2=i-ListGetCurrent(WindowList(Window)); goto lbl_downward; } break; } break; case MOUSELEFTDOWN: //key=ListGetCurrent(WindowList(Window)); if (MAKELO(Param1)/CHARHEIGHT!=ListGetCurrent(WindowList(Window)) -ListGetTop(WindowList(Window)) &&MAKELO(Param1)/CHARHEIGHT<ListGetTotal(WindowList(Window)) /*-ListGetHeight(WindowList(Window))*/) { if (ListGetCurrent(WindowList(Window)) >= ListGetTop(WindowList(Window)) && ListGetCurrent(WindowList(Window)) < ListGetTop(WindowList(Window))+ListGetHeight(WindowList(Window))) MessageGo(Window,WMPAINT, MAKELONG(0,(ListGetCurrent(WindowList(Window))- ListGetTop(WindowList(Window)))*CHARHEIGHT), MAKELONG(0,(ListGetCurrent(WindowList(Window))+1- ListGetTop(WindowList(Window)))*CHARHEIGHT)); ListSetCurrent(WindowList(Window),MAKELO(Param1)/CHARHEIGHT +ListGetTop(WindowList(Window))); if (WindowGetProcedure(WindowGetFather(Window))==(Function *)ComboDefaultProcedure) MessageInsert(WindowGetFather(Window),COMBOPULL,Param1,Param2); else { #ifdef USE_SCROLL MidWindow=GetVVScroll(Window); if (MidWindow) { i=WindowGetHeight(Window)-3*SYSSCROLLWIDTH-2; i*=ListGetCurrent(WindowList(Window)); // i/=ListGetTotal(WindowList(Window)); i/=ListGetTotal(WindowList(Window))-1; i=i-WindowGetTop(MidWindow)+SYSSCROLLWIDTH; //*------ if(WindowGetBottom(MidWindow)+i> WindowGetHeight(WindowGetFather(MidWindow))-2-SYSSCROLLWIDTH) i=WindowGetHeight(WindowGetFather(MidWindow))-2 -SYSSCROLLWIDTH-WindowGetBottom(MidWindow); //------*/ MessageGo(MidWindow,WINDOWMOVE,0l,i); } #endif MessageGo(Window,WMPAINT, MAKELONG(0,(ListGetCurrent(WindowList(Window))- ListGetTop(WindowList(Window)))*CHARHEIGHT), MAKELONG(0,(ListGetCurrent(WindowList(Window))+1- ListGetTop(WindowList(Window)))*CHARHEIGHT)); } } //if( key != ListGetCurrent(WindowList(Window)) ) // ByHance, 97,5.11 MessageInsert(Window,ITEMSELECT,ListGetCurrent(WindowList(Window)),Window); break; case VVSCROLLMOVE: /* //i=Param1*ListGetTotal(WindowList(Window)) i=Param1*(ListGetTotal(WindowList(Window))-1) /(WindowGetHeight(Window)-3*SYSSCROLLWIDTH-2) ; if(i<ListGetTop(WindowList(Window)) || i>=ListGetTop(WindowList(Window))+ListGetHeight(WindowList(Window)) ) { i=( ListGetTotal(WindowList(Window)) - 1 ) * Param1; i=0.5+(float)i/(WindowGetHeight(Window)-3*SYSSCROLLWIDTH-2); Length=ListGetTotal(WindowList(Window)) -ListGetHeight(WindowList(Window)); if(i>Length) i=Length; ListSetTop(WindowList(Window),i); MessageInsert(Window,WMPAINT,0l, ListGetHeight(WindowList(Window))*CHARHEIGHT); } */ // modi by zjh for smooth move 96.12.6 { i=( ListGetTotal(WindowList(Window)) - 1 ) * Param1; i=0.5+(float)i/(WindowGetHeight(Window)-3*SYSSCROLLWIDTH-2); Length=ListGetTotal(WindowList(Window))-1; if(i>Length) i=Length; Length=(WindowGetHeight(Window)+0)/16; i=i-Length/2; if (i<0) i=0; if (i+Length>ListGetTotal(WindowList(Window))-1) i=ListGetTotal(WindowList(Window)) - 1-Length+1; if (i<0) i=0; if (i!=ListGetTop(WindowList(Window))) { ListSetTop(WindowList(Window),i); MessageInsert(Window,WMPAINT,0l, ListGetHeight(WindowList(Window))*CHARHEIGHT); } } break; case MOUSELEFTDOUBLE: //MessageInsert(Window,LISTBOXCONFIRM,0L,0L); MessageInsert(Window,KEYDOWN,MAKELONG(0,ENTER),1l); break; case GETFOCUS: // ByHance, 95,11.23 case LOSTFOCUS: WindowDefaultProcedure(Window,Message,Param1,Param2); MidWindow=WindowGetFather(Window); if(MidWindow) // has combo list if( WindowGetHeight(MidWindow)<=SYSBUTTONWIDTH+1) // not pull down break; if(!ListGetTotal(WindowList(Window))) // if no item, break break; MouseHidden(); getviewsettings(&TmpViewPort); SaveColor=getcolor(); WindowGetRealRect(Window,&Left,&Top,&Right,&Bottom); setviewport(Left+1,Top+1,Right-1,Bottom-1,1); DisplayWidth=ListGetItemLength(WindowList(Window))*CHARWIDTH/2; if (DisplayWidth<WindowGetWidth(Window)) DisplayWidth=WindowGetWidth(Window); if (!WindowIsChildless(Window)) DisplayWidth-=SYSSCROLLWIDTH+1+CHARWIDTH/2; //by jerry // DisplayWidth-=SYSSCROLLWIDTH+4; i=ListGetCurrent(WindowList(Window))-ListGetTop(WindowList(Window)); i*=CHARHEIGHT; if(Message==GETFOCUS) { DisplayVirtualRect(3,i+1,2+DisplayWidth-1,i+CHARHEIGHT-1); //if(ListGetTotal(WindowList(Window))==1) if(fGetFocusByKey) // ByHance, 97,5.11 MessageInsert(Window,ITEMSELECT,ListGetCurrent(WindowList(Window)),Window); } else { // LOSTFOCUS DisplayWidth/=CHARWIDTH/2; strncpy(MidString, ListGetItem( WindowList(Window),ListGetCurrent(WindowList(Window)) ), DisplayWidth); Length=strlen(MidString); if (Length<DisplayWidth) memset(MidString+Length,' ',DisplayWidth-Length); MidString[DisplayWidth]=0; ViewportDisplayString(MidString,2,i,LISTBKCOLOR,LISTCOLOR); } setviewport(TmpViewPort.left,TmpViewPort.top,TmpViewPort.right, TmpViewPort.bottom,TmpViewPort.clip); setcolor(SaveColor); MouseShow(); break; case DRAWWINDOW: WindowDefaultProcedure(Window,Message,Param1,Param2); case WMPAINT: getviewsettings(&TmpViewPort); SaveColor=getcolor(); MouseHidden(); WindowGetRealRect(Window,&Left,&Top,&Right,&Bottom); setviewport(Left+1,Top+1,Right-1,Bottom-1,1); setfillstyle(1,EGA_WHITE); if (!WindowIsChildless(Window)) Right-=SYSSCROLLWIDTH+10; // ByHance, 96,3.24 bar(0,0,Right-Left,Bottom-Top); // clear area Param1 = 0; Param2 = Bottom-Top; DisplayWidth=ListGetItemLength(WindowList(Window))*CHARWIDTH/2; if (DisplayWidth<WindowGetWidth(Window)) DisplayWidth=WindowGetWidth(Window); if (!WindowIsChildless(Window)) DisplayWidth-=SYSSCROLLWIDTH+1+CHARWIDTH/2; // by jerry //DisplayWidth-=SYSSCROLLWIDTH+4; DisplayWidth/=CHARWIDTH/2; for (i=MAKELO(Param1);i<MAKELO(Param2);i+=CHARHEIGHT) { if (i/CHARHEIGHT+ListGetTop(WindowList(Window)) >=ListGetTotal(WindowList(Window))) break; strncpy(MidString,ListGetItem(WindowList(Window),i/CHARHEIGHT +ListGetTop(WindowList(Window))),DisplayWidth); Length=strlen(MidString); if (Length<DisplayWidth) memset(MidString+Length,' ',DisplayWidth-Length); MidString[DisplayWidth]=0; if (i/CHARHEIGHT==ListGetCurrent(WindowList(Window)) -ListGetTop(WindowList(Window))) { ViewportDisplayString(MidString,2,i,LISTBKCOLOR,LISTCOLOR); if (Window==ActiveWindow) // ByHance DisplayVirtualRect(3,i+1, 2+DisplayWidth*ASC16WIDTH-1,i+CHARHEIGHT-1); } else ViewportDisplayString(MidString,2,i,LISTCOLOR,LISTBKCOLOR); } setviewport(TmpViewPort.left,TmpViewPort.top,TmpViewPort.right, TmpViewPort.bottom,TmpViewPort.clip); setcolor(SaveColor); MouseShow(); break; case LISTAPPENDITEM: ListInsertItem(Window,ListGetTotal(WindowList(Window)),(char *)LONG2FP(Param1)); break; case LISTINSERTITEM: ListInsertItem(Window,Param2,(char *)LONG2FP(Param1)); break; case LISTINSERTITEMSORTED: { char *p1,*p2; p2 = (char *)LONG2FP(Param1); for (i=0;i<ListGetTotal(WindowList(Window));i++) { p1 = ListGetItem(WindowList(Window),i); if (strcmp(p2,p1)>0) continue; ListInsertItem(Window,i,p2); break; } if (i==ListGetTotal(WindowList(Window))) ListInsertItem(Window,i,p2); } break; case LISTDELETEITEM: if (Param1<ListGetTotal(WindowList(Window))) ListDeleteItem(Window,Param1); break; case LISTDELETELASTITEM: if (ListGetTotal(WindowList(Window))>0) ListDeleteItem(Window,ListGetTotal(WindowList(Window))-1); MessageInsert(Window,WMPAINT,0l, ListGetHeight(WindowList(Window))*CHARHEIGHT); break; case LISTDELETEALL: ListSetTotal(WindowList(Window),0); ListSetTop(WindowList(Window),0); ListSetCurrent(WindowList(Window),0); #ifdef USE_SCROLL if (!WindowIsChildless(Window)) MessageGo(WindowGetChild(Window),WINDOWCLOSE,0l,0l); #endif break; case LISTSETITEMLENGTH: if (Param1>0) ListSetItemLength(WindowList(Window),Param1); break; case LISTSETITEMHEIGHT: if (Param1>0) ListSetHeight(WindowList(Window),(WindowGetHeight(Window)+Param1-2)/Param1); break; case LISTSETTOTALITEM: ListSetTotal(WindowList(Window),Param1); if (!Param1) ListHandleFree(); break; case ITEMSELECT: MessageInsert(WindowGetFather(Window),ITEMSELECT, ListGetCurrent(WindowList(Window)),Window); break; case MOUSEMOVE: //MouseShow(); DialogMouseMove(Window,Message,Param1,Param2); // ByHance, 95,12.6 break; default: return(WindowDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
void edit( int ch ) { struct viewporttype tmp; char key, *buff; take_char( ( char ) ch ); backup_char( ); getviewsettings( &tmp ); setviewport( 400, 30, getmaxx( ), getmaxy( ), 1 ); buff = ( char* ) malloc( imagesize( 0 + align, 0, X*( 2 + WIDTH_X ) + align, Y*( 2 + WIDTH_Y ) ) ); getimage( 0 + align, 0, X*( 2 + WIDTH_X ) + align, Y*( 2 + WIDTH_Y ), buff ); draw_char( ); start_clock( EDIT_FONT ); while ( ( key = get_pos( &pos_x, &pos_y, X - 1, Y - 1, 1, 1 ) ) != 3 ) { switch ( tolower( key ) ) { case 1: xor_dot( pos_x, pos_y ); continue; case '8': pan_up( ); draw_char( ); break; case '2': pan_down( ); draw_char( ); break; case '4': pan_left( ); draw_char( ); break; case '6': pan_right( ); draw_char( ); break; case 'r': insert_row( pos_y ); draw_char( ); break; case 'c': insert_col( pos_x ); draw_char( ); break; case 'e': del_row( pos_y ); draw_char( ); break; case 'd': del_col( pos_x ); draw_char( ); break; case 'i': invert( ); draw_char( ); break; case 'm': mirror( ); draw_char( ); break; case '.': ++draw_mode; switch ( draw_mode ) { case 0: break; case 1: put_dot( pos_x, pos_y ); edit_font[pos_x][pos_y] = ~0; break; case 2: square( pos_x, pos_y ); edit_font[pos_x][pos_y] = 0; break; case 3: draw_mode = 0; } continue; case 'u': undo( ); draw_char( ); goto exit; case '?': help( ); break; default: if ( draw_mode == 1 ) { put_dot( pos_x, pos_y ); edit_font[pos_x][pos_y] = ~0; } if ( draw_mode == 2 ) { square( pos_x, pos_y ); edit_font[pos_x][pos_y] = 0; } } } update_char( ( char ) ch ); exit: putimage( 0 + align, 0, buff, COPY_PUT ); free( buff ); stop_clock( ); dispblank( 50, 16, strlen( "Move mode" ), 0 ); setviewport( tmp.left, tmp.top, tmp.right, tmp.bottom, tmp.clip ); print_table( which_page( ch ) ); }
void AmbientePaciente (void) { register int delta_x, delta_y; char *p_ch, id; delta_x = (int) ((MAXX * 15L) / 1000); delta_y = (int) ((MAXY * 17L) / 1000); p_ch = "ENTRADA DE DADOS DO PACIENTE"; CriaJanelaGrafica ( DADOSPAC, delta_x, delta_y, MAXX - delta_x, MAXY - delta_y, 0, p_ch ); setcolor(bea_color[10]); setviewport ( delta_x, delta_y, MAXX - delta_x, MAXY - delta_y, 1 ); Moldura (); AtivaJanelaGrafica(DADOSPAC, 0); setcolor (bea_color[14]); getviewsettings ( &vp ); gprintf( DELTA_X ( 5), DELTA_Y ( 5), "NOME: %s", Paciente.Nome); id = Paciente.Prontuario[7]; Paciente.Prontuario[7] = '\0'; gprintf( DELTA_X ( 5), DELTA_Y (10), "No DO PRONTUARIO: %7s %c", Paciente.Prontuario, id); Paciente.Prontuario[7] = id; gprintf( DELTA_X ( 5), DELTA_Y (15), "SEXO: " ); if (*Paciente.Sexo != NULL) { outtextxy( DELTA_X ( 5) + textwidth("SEXO: "), DELTA_Y (15), Paciente.Sexo[0] == 'M' ? "Masculino" : " Feminino"); } gprintf( DELTA_X ( 5), DELTA_Y (20), "DATA DE NASCIMENTO: %2s/%2s/%2s",Paciente.Dia,Paciente.Mes,Paciente.Ano); if (*PacienteIdade!=NULL) { gprintf( DELTA_X (50), DELTA_Y (20), "IDADE: %2s Anos", PacienteIdade); } else { gprintf( DELTA_X (50), DELTA_Y (20), "IDADE: Anos" ); } gprintf( DELTA_X ( 5), DELTA_Y (25), "ADULTO ou CRIANCA ? (A/C): " ); if (*Paciente.Fase != NULL) { outtextxy( DELTA_X ( 5) + textwidth ("ADULTO ou CRIANCA ? (A/C): "), DELTA_Y (25), Paciente.Fase[0]=='A' ? " Adulto" : "Crianca"); } gprintf( DELTA_X ( 5), DELTA_Y (30), "ALTURA (cm): %s", Paciente.Altura); gprintf( DELTA_X ( 5), DELTA_Y (35), "PESO (Kg): %s", Paciente.Peso); if (SupCorp > 0.0) { gprintf( DELTA_X (50), DELTA_Y (35), "SUPERFICIE CORPORAL: %-5.2f", SupCorp); } else { gprintf( DELTA_X (50), DELTA_Y (35), "SUPERFICIE CORPORAL: " ); } gprintf( DELTA_X ( 5), DELTA_Y (40), "FUMANTE ? (S/N/E): %s", Paciente.Fumante); if (pertence(Paciente.Fumante[0],"Ss")) { gprintf( DELTA_X (50), DELTA_Y (40), "HA QUANTOS ANOS ? : %s", Paciente.tempfumo); gprintf( DELTA_X (50), DELTA_Y (43), "No CIGARROS/DIA : %s",Paciente.cigardia); } else if (pertence(Paciente.Fumante[0],"Ee")) { gprintf( DELTA_X (50), DELTA_Y (40), "HA QUANTO TEMPO PAROU ? : "" %2s ANOS %2s MESES",Paciente.deixfumoA,Paciente.deixfumoM); gprintf( DELTA_X (50), DELTA_Y (43), "QUANTOS ANOS FUMOU ? : %2s", Paciente.tempfumo); gprintf( DELTA_X (50), DELTA_Y (46), "No CIGARROS/DIA : %2s", Paciente.cigardia); } p_ch = "TOSSE OU EXPECTORACAO (S/N): %s"; gprintf( DELTA_X ( 5), DELTA_Y (45), p_ch, TosseOuExpec ); gprintf( DELTA_X ( 5), DELTA_Y (50), "CONVENIO: %s", institu); gprintf( DELTA_X ( 5), DELTA_Y (55), "PACIENTE INTERNO OU AMBULATORIAL ? (I/A): %s", IouA); gprintf( DELTA_X ( 5), DELTA_Y (60), "JUSTIFICATIVA PARA O EXAME: %s", justif); gprintf( DELTA_X ( 5), DELTA_Y (65), "MEDICO REQUISITANTE: %s", medico); gprintf( DELTA_X ( 5), DELTA_Y (70), "SERVICO REQUISITANTE: %s", servico); gprintf( DELTA_X ( 5), DELTA_Y (75), "PACIENTE COM ALGUM DIAGNOSTICO DE DOENCA PULMONAR ? (S/N): %s", temdiag); if (pertence ( temdiag[0], "Ss" )) { gprintf( DELTA_X ( 5), DELTA_Y (80), "DIAGNOSTICO: %s", diagnost); } if ( (*RiscoCir == '1') || (*RiscoCir == '2') || (*RiscoCir == '3') ) { p_ch = "S"; } else { p_ch = ""; } gprintf( DELTA_X ( 5), DELTA_Y (85), "CIRURGIA PREVISTA - ESTIMATIVA DO RISCO CIRURGICO ? (S/N): %s", p_ch); if (*RiscoCir != NULL) { gprintf( DELTA_X ( 5), DELTA_Y (90), "CIRURGIA: (1 - ABDOMINAL ALTA 2 - TORACICA 3 - OUTRA): %s", RiscoCir ); } } /* AmbientePaciente */