Exemplo n.º 1
0
void CBinaryTree::DrawNode(CNode *Root,int X,int Y,int PrevX,int PrevY,int Level)
{
 if(Root!=NULL)
 {
  char Data[5];
  char BF[2];

  setcolor(WHITE);
  circle(X,Y,7);
  floodfill(X,Y,WHITE);
  line(X,Y-7,PrevX,PrevY+7);

  itoa(Root->GetData(),Data,10);
  setcolor(RED);
  settextjustify(CENTER_TEXT,TOP_TEXT);
  outtextxy(X,Y-3,Data);
  itoa(GetBalancingFactor(Root->pRight)-GetBalancingFactor(Root->pLeft),BF,10);
  setcolor(GREEN);
  settextjustify(RIGHT_TEXT,TOP_TEXT);
  outtextxy(X-10,Y-2,BF);
  setcolor(WHITE);

  DrawNode(Root->pLeft,X-(30+Level),Y+30,X,Y,Level+10);
  DrawNode(Root->pRight,X+(30-Level),Y+30,X,Y,Level-10);
 }
}
Exemplo n.º 2
0
int showform(int num, int label)
{
	/* this function displays the programmer defined forms */

	int x,fld;

	for(fld=0;fld<=grfxform[num].number;fld++)
	{
		setcolor(UVEAWHITE);
		ratoff();
		for(x=grfxform[num].fld[fld].top;x<=grfxform[num].fld[fld].bot;x++)
			line(grfxform[num].fld[fld].left,x,
											grfxform[num].fld[fld].right,x);
		raton();
		setcolor(UVEABLACK);
		ratoff();
		line(grfxform[num].fld[fld].left,x,
										grfxform[num].fld[fld].right+2,x);
		line(grfxform[num].fld[fld].left+1,x+1,
										grfxform[num].fld[fld].right+2,x+1);
		line(grfxform[num].fld[fld].right+1,x-16,
										grfxform[num].fld[fld].right+1,x-1);
		line(grfxform[num].fld[fld].right+2,x-16,
										grfxform[num].fld[fld].right+2,x-1);
		raton();
	}
	setcolor(UVEAGREY);
	settextstyle(SANSSERIF, HORIZ_DIR, 2);
	if(label == WITHOUT)
	{
	}
	if(label == LLEFT)
	{
		settextjustify(RIGHT_TEXT,CENTER_TEXT);
		ratoff();
		for(fld=0;fld<=grfxform[num].number;fld++)
		{
			x = grfxform[num].fld[fld].left - 5;
			outtextxy(x,grfxform[num].fld[fld].top+7,
									grfxform[num].fld[fld].label);
		}
		raton();
	}
	if(label == LABOVE)
	{
		settextjustify(LEFT_TEXT,CENTER_TEXT);
		ratoff();
		for(fld=0;fld<=grfxform[num].number;fld++)
		{
			outtextxy(grfxform[num].fld[fld].left,
						grfxform[num].fld[fld].top+7-20,
						grfxform[num].fld[fld].label);
		}
		raton();
	}
	return(0);
}
Exemplo n.º 3
0
int eraseform(int num, int label)
{
	/* this function removes a form from the screen */

	int x,fld;

	setcolor(UVEADKBLUE);
	for(fld=0;fld<=grfxform[num].number;fld++)
	{
		ratoff();
		for(x=grfxform[num].fld[fld].top;x<=grfxform[num].fld[fld].bot;x++)
			line(grfxform[num].fld[fld].left,x,
											grfxform[num].fld[fld].right,x);
		line(grfxform[num].fld[fld].left,x,
										grfxform[num].fld[fld].right+2,x);
		line(grfxform[num].fld[fld].left+1,x+1,
										grfxform[num].fld[fld].right+2,x+1);
		line(grfxform[num].fld[fld].right+1,x-16,
										grfxform[num].fld[fld].right+1,x-1);
		line(grfxform[num].fld[fld].right+2,x-16,
										grfxform[num].fld[fld].right+2,x-1);
		raton();
	}
	setcolor(UVEADKBLUE);
	settextstyle(SANSSERIF, HORIZ_DIR, 2);
	if(label == WITHOUT)
	{
	}
	if(label == LLEFT)
	{
		settextjustify(RIGHT_TEXT,CENTER_TEXT);
		ratoff();
		for(fld=0;fld<=grfxform[num].number;fld++)
		{
			x = grfxform[num].fld[fld].left - 5;
			outtextxy(x,grfxform[num].fld[fld].top+7,
									grfxform[num].fld[fld].label);
		}
		raton();
	}
	if(label == LABOVE)
	{
		settextjustify(LEFT_TEXT,CENTER_TEXT);
		ratoff();
		for(fld=0;fld<=grfxform[num].number;fld++)
		{
			outtextxy(grfxform[num].fld[fld].left,
						grfxform[num].fld[fld].top+7-20,
						grfxform[num].fld[fld].label);
		}
		raton();
	}
	return(0);
}
Exemplo n.º 4
0
int main() {
	int unidad = 0,modo;
	struct textsettingstype p;
	char sfuente[10],sdireccion[10],stamano[10],shoriz[10],svert[10];

	initgraph (&unidad,&modo,"c:\\bc\\bgi");
	if (graphresult() != 0) {
		cout << "Error al tratar de pasar al modo grafico\n";
		getch();
		return 1;
	}
	settextjustify (LEFT_TEXT,CENTER_TEXT);
	settextstyle (GOTHIC_FONT,HORIZ_DIR,3);
	gettextsettings (&p);
	itoa (p.font,sfuente,10);
	itoa (p.direction,sdireccion,10);
	itoa (p.charsize,stamano,10);
	itoa (p.horiz,shoriz,10);
	itoa (p.vert,svert,10);
	settextstyle (DEFAULT_FONT,HORIZ_DIR,0);
	outtextxy (0,10,sfuente);
	getch();
	outtextxy (0,20,sdireccion);
	getch();
	outtextxy (0,30,stamano);
	getch();
	outtextxy (0,40,shoriz);
	getch();
	outtextxy (0,50,svert);
	getch();
	closegraph();
	return 0;
}
int main()
{
   int gd = DETECT, gm, i;
   char a[5];

   initgraph( &gd, &gm, "C:\\TURBOC3\\BGI");

   settextjustify( CENTER_TEXT, CENTER_TEXT );
   settextstyle(DEFAULT_FONT,HORIZ_DIR,50);
   setcolor(RED);
   for (i = 30; i >=0; i--)
   {
      sprintf(a,"%d",i);
      outtextxy(getmaxx()/2, getmaxy()/2, a);
      delay(1000);

      if ( i == 0 )
	 break;
      cleardevice();
   }
   cleardevice();
   settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
   outtextxy(300,300,"Project by http://www.turboc.codeplex.com");
   delay(5000);
   closegraph();
   return 0;
}
Exemplo n.º 6
0
void GMessage::Show(void)
{
   int size = Field / (8 * strlen(msg));     // 8 pixels per char.
   settextjustify(CENTER_TEXT, CENTER_TEXT); // centers in circle
   settextstyle(Font, HORIZ_DIR, size);      // magnify if size > 1 
   outtextxy(X, Y, msg);                     // display the text
}
Exemplo n.º 7
0
void table::drawvalue(int col, int row, int fcolor, int bcolor)
{
	if(row>=windowposy && row<=windowposy+visiblerows-1 &&
		col>=windowposx && col<=windowposx+visiblecolumns-1)
	{
		settextjustify(justify,BOTTOM_TEXT);
		int x,y;
		x=x1+(col-windowposx)*colwidth;
		y=y1+(row-windowposy)*rowwidth;
		setfillstyle(1,bcolor);
		bar(x+1,y+1,x+colwidth-1,y+rowwidth-1);
		switch(justify)
		{
			case(RIGHT_TEXT):	x=x1+(col-windowposx+1)*colwidth;
									y=y1+(row-windowposy+1)*rowwidth;
									break;
			case(LEFT_TEXT):	x=x1+(col-windowposx)*colwidth+3;
									y=y1+(row-windowposy+1)*rowwidth-3;
									break;

		}

		setcolor(fcolor);
		outtextxy(x,y,getcvalue(col,row));
	}
}
Exemplo n.º 8
0
void button::drawdown()
{
	int ywidth=y2-y1;
	int xwidth=x2-x1;

	setfillstyle(1,7);
	bar(x1,y1,x2,y2);
	setcolor(16);
	rectangle(x1+depth,y1+depth,x2-depth,y2-depth);
	line(x1,y1,x1+depth,y1+depth);
	line(x2,y2,x2-depth,y2-depth);
	line(x1,y2,x1+depth,y2-depth);
	line(x2,y1,x2-depth,y1+depth);
	rectangle(x1-1,y1-1,x2+1,y2+1);
	setfillstyle(1,15);
	floodfill(x1+depth/2,y1+ywidth,0);
	floodfill(x1+xwidth,y1+depth/2,0);
	setfillstyle(1,8);
	floodfill(x2-depth/2,y2-ywidth,0);
	floodfill(x2-xwidth,y2-depth/2,0);
	setfillstyle(1,7);
	floodfill(x1+xwidth/2,y1+ywidth/2,0);
	setcolor(15);
	settextjustify(1,1);
	outtextxy(x1+xwidth/2+3,y1+ywidth/2+2,caption);
	setcolor(16);
	outtextxy(x1+xwidth/2+3+1,y1+ywidth/2+2+1,caption);
	//setcolor(7);
	//rectangle(x1,y1,x2,y2);
}
Exemplo n.º 9
0
int main(void)
{
   int gdriver = DETECT, gmode, errorcode;
   int midx, midy, hj, vj;
   char msg[80];
   initgraph(&gdriver, &gmode, "\\bc\\bgi");
   errorcode = graphresult();
   if (errorcode != grOk)
   {
      printf("error ao inicar modo grafico : %s\n", grapherrormsg(errorcode));
      printf("Nao foi possivel abrir modo grafico ");
      getch();
   }
   midx = getmaxx() / 2;
   midy = getmaxy() / 2;
   for (hj=LEFT_TEXT; hj<=RIGHT_TEXT; hj++)
      for (vj=LEFT_TEXT; vj<=RIGHT_TEXT; vj++)
      {
	 cleardevice();
	 settextjustify(hj, vj);
	 sprintf(msg, "%s  %s", hjust[hj], vjust[vj]);
	 xat(midx, midy);
	 outtextxy(midx, midy, msg);
	 getch();
      } closegraph();
   return 0;
}
Exemplo n.º 10
0
int cleanform(int fnum, int fld, char data[])
{
	/* this funtion clears information from a displayed form */

	int len = 0,
		x = 0,
		pos = 0;
	char temp[1];

	setcolor(UVEAWHITE);
	settextstyle(SANSSERIF, HORIZ_DIR, 2);
	settextjustify(LEFT_TEXT,CENTER_TEXT);

	temp[1]=NULL;
	len = (grfxform[fnum].fld[fld].right - grfxform[fnum].fld[fld].left)
																	/ 14;
	x = grfxform[fnum].fld[fld].left+5;

	for(pos=0;pos<len;pos++)
	{
		temp[0] = data[pos];
		outtextxy(x,grfxform[fnum].fld[fld].top+7,temp);
		x+=12;
	}
	return(0);
}
Exemplo n.º 11
0
void drawInformationPanel(int x, int y, char* info){
   ///////////////////////////////////////////////////////////////////////////////////////////
	settextstyle(SMALL_FONT, HORIZ_DIR, 4);
	settextjustify(LEFT_TEXT,CENTER_TEXT);
	setcolor(YELLOW);
	outtextxy(x ,y, info);
	///////////////////////////////////////////////////////////////////////////////////////////
}
Exemplo n.º 12
0
void main()
{
	int gd=DETECT,gm;
	int midx,midy,i,j;
	char msg[80]="Hello,Good Morning";
	char msg1[80],msg2[80];
	char *horizontal[]={
				"LEFT_TEXT",
				"CENTER_TEXT",
				"RIGHT_TEXT"
			};
	char *vertical[]={
				"BOTTOM_TEXT",
				"CENTER_TEXT",
				"TOP_TEXT"
			};
	initgraph(&gd,&gm,"c:\\tc\\bgi");
	midx=getmaxx()/2;
	midy=getmaxy()/2;

	/*loop through text justifications*/

	for(i=LEFT_TEXT;i<=RIGHT_TEXT;i++)
	{
		for(j=BOTTOM_TEXT;j<=TOP_TEXT;j++)
		{
			cleardevice();
			cross(midx,midy);  /*create cross hairs on screen*/
			settextjustify(i,j);
			outtextxy(midx,midy,msg);
			settextjustify(LEFT_TEXT,TOP_TEXT);
			outtextxy(100,350,"HORIZONTAL JUSTIFICATION=");
			sprintf(msg1,"%s",horizontal[i]);
			outtextxy(320,350,msg1);
			outtextxy(100,400,"VERTICAL JUSTIFICATION=");
			sprintf(msg2,"%s",vertical[j]);
			outtextxy(320,400,msg2);

			getch();
		}
	}

	closegraph();
	restorecrtmode();
}
Exemplo n.º 13
0
void grid()
{
// setbkcolor(LIGHTGREEN);
 setfillstyle(1,LIGHTGREEN);
 floodfill(0,0,15);
 setlinestyle(0,0,3);
 setcolor(RED);
 settextjustify(1,1);
// settextstyle(0,0,1);
 for(int i=0;i<=480;i+=48)
  line(0,i,479,i);
 line(0,479,479,479);
 for(i=0;i<=480;i+=48)
  line(i,0,i,479);
 int k=1;int a=9;
 char h[3];
 setfillstyle(1,LIGHTBLUE);
 floodfill(639,479,RED);
 setcolor(BROWN);
 setlinestyle(0,0,3);
 ladd(110,452,412);
 ladd(350,452,364);
 ladd(206,404,316);
 ladd(398,308,268);
 ladd(110,260,220);
 ladd(254,260,172);
 ladd(206,164,28);
 ladd(350,164,124);
 ladd(62,116,76);
 snake(168, 374, 264, 447);
 snake(360, 278, 312, 399);
 snake(168, 230, 72, 351);
 snake(408,182,312,255);
 snake(120, 86, 168, 303);
 snake(264, 38, 360, 111);
 snake(72, 38, 72,159);
 snake(264, 134, 216, 255);
 setcolor(RED);
 settextstyle(4,0,1);

 while(a>0)
 {
  for(i=0;i<10;i++)
	{
	 sprintf(h,"%d",k++);
	 outtextxy(i*48+24,a*48+24,h);
	}
  a--;
  for(i=9;i>=0;i--)
	{
	 sprintf(h,"%d",k++);
	 outtextxy(i*48+24,a*48+24,h);
	}
  a--;
 }

}
Exemplo n.º 14
0
void drawclock(){
int i;float j;
for(i=20;i<=70;i++) circle(midx,midy,RSEC+i);
settextjustify(1, 1);
settextstyle(1,HORIZ_DIR,4);
for(i=1;i<=12;i++)
{j=(i*30-90)*RAD;
outtextxy(midx+RSEC*cos(j),midy+RSEC*sin(j),nums[i-1]);
}
}
Exemplo n.º 15
0
void cInterface::fillData(int right)
{
 settextstyle(4,0,4);		         	 //font,direction,size
 settextjustify(1,0); 	        	     //horiz'n'vert direction
 moveto(right/2,38);           		     //move CP to position
 setcolor(14);
 outtext("FEED BACK AGENT");
 settextstyle(0,0,1);					 //font,direction,size
 settextjustify(1,1);					 //horiz'n'vert direction
 moveto(right/2,48);
 setcolor(12);
 outtext("Govt. Modal Boys HSS, Thrissur");

 setcolor(10);
 settextjustify(0,2);
 outtextxy(right-81,30,"ARUN.K.R");
 outtextxy(right-101,45,"10+1 Computer Science");
 setcolor(11);
 outtextxy(right-115,15,"Devoloped by:");
}
Exemplo n.º 16
0
void cInterface:: disMnuHed(char* hed)
	{
	 drawFrame(right,bottom);
	 fillData(right);
	 disTime(right);
	 moveto(300,72);
	 settextstyle(7,0,3);
	 settextjustify(1,1);
	 setcolor(10);
	 outtext(hed);
	}
Exemplo n.º 17
0
void cInterface::disTime(int right)
	{
	 /* to hold time */
	 struct tm *time_now;
	 time_t secs_now;
	 char str[15];

	 tzset();
	 time(&secs_now);
	 time_now = localtime(&secs_now);
	 strftime(str,15," %A",time_now);
	 moveto(right/14,27);
	 settextjustify(0,1);
	 setcolor(10);
	 outtext(str);
	 strftime(str,15,"%b %d %Y",time_now);
	 moveto(right/20,45);
	 settextjustify(0,0);
	 setcolor(10);
	 outtext(str);
	}
Exemplo n.º 18
0
void title()
{
 int a=DETECT,b;
 initgraph(&a,&b,"c:\\tc\\bgi");
 int j=0;
 setbkcolor(15);
 setcolor(BROWN);
 setlinestyle(0,0,3);
 line(60,190,580,190);
 line(60,210,580,210);
 for (int i=70;i<580;i+=20)
 line(i,190,i,210);
 setlinestyle(0,0,1);
 setcolor(RED);
 settextjustify(1,1);
 settextstyle(1,0,3);
 outtextxy(320,400,"PRESS ANY KEY TO CONTINUE");
 while(!kbhit())
 {
  for(i=1;i<15;i++)
	{
	 if (i<=7) sound(200*i);
	 else sound(200*(15-i));
	 setfillpattern(0,i);
	 setcolor(i);
	 rectangle(24,24,616,456);
	 floodfill(0,0,i);
	 settextjustify(1,1);
	 settextstyle(9,0,4);
	 outtextxy(320,150,"SNAKES & LADDERS");
	 settextstyle(1,0,2);
	 settextjustify(0,1);
	 outtextxy(250,250,"Made by:-Ankit Jain & Rahul Jain");
	 delay(20);
	 nosound();
	}
  }
 graphdefaults();
 closegraph();
}
Exemplo n.º 19
0
void table::draw()
{
	setcolor(8);
	int i;
	for(i=1;i<tdepth;i++)
	{
		line(x1-i,y1-i,x1-i,y2+i);
		line(x1-i,y1-i,x2+i,y1-i);
	}
	setcolor(15);
	for(i=1;i<tdepth;i++)
	{
		line(x2+i,y2+i,x1-i,y2+i);
		line(x2+i,y2+i,x2+i,y1-i);
	}
	setcolor(0);
	line(x1-tdepth,y1-tdepth,x1,y1);
	line(x2+tdepth,y1-tdepth,x2,y1);
	line(x1-tdepth,y2+tdepth,x1,y2);
	line(x2+tdepth,y2+tdepth,x2,y2);
	rectangle(x1-tdepth,y1-tdepth,x2+tdepth,y2+tdepth);

	setfillstyle(1,15);
	bar(x1,y1,x2,y2);
	setcolor(0);
	int xpos=x1,ypos=y1;
	for(int loop=0;loop<=visiblecolumns;loop++)
	{
		line(xpos,y1,xpos,y2);
		xpos+=colwidth;
	}
	for(loop=0;loop<=visiblerows;loop++)
	{
		line(x1,ypos,x2,ypos);
		ypos+=rowwidth;
	}

	int x,y;
	settextjustify(justify,BOTTOM_TEXT);
	setcolor(0);
	for(int row=windowposy;row<windowposy+visiblerows;row++)
		for(int col=windowposx;col<windowposx+visiblecolumns;col++)
		{
			x=x1+(col-windowposx+1)*colwidth;
			y=y1+(row-windowposy+1)*rowwidth;
			outtextxy(x,y,getcvalue(col,row));
		}
	int srow,scol;
	srow=selected/COLS;
	scol=selected%COLS;
	drawvalue(scol,srow,15,4);
}
Exemplo n.º 20
0
main()
{
   int gd = DETECT, gm, midx, midy;
 
   initgraph(&gd, &gm, "C:\\TC\\BGI");
 
   midx = getmaxx()/2;
   midy = getmaxy()/2;
 
   setcolor(RED);
   settextstyle(SCRIPT_FONT, HORIZ_DIR, 3);
   settextjustify(CENTER_TEXT, CENTER_TEXT);
   outtextxy(midx, midy-10, "Traffic Light Simulation");
   outtextxy(midx, midy+10, "Press any key to start");
   getch();
   cleardevice();
   setcolor(WHITE);
   settextstyle(DEFAULT_FONT, HORIZ_DIR, 1);
   rectangle(midx-30,midy-80,midx+30,midy+80);
   circle(midx, midy-50, 22);
   setfillstyle(SOLID_FILL,RED);
   floodfill(midx, midy-50,WHITE);
   setcolor(BLUE);
   outtextxy(midx,midy-50,"STOP");
   delay(2000);
   graphdefaults();
   cleardevice();
   setcolor(WHITE);
   rectangle(midx-30,midy-80,midx+30,midy+80);
   circle(midx, midy, 20);
   setfillstyle(SOLID_FILL,YELLOW);
   floodfill(midx, midy,WHITE);
   setcolor(BLUE);
   outtextxy(midx-18,midy-3,"READY");
 
   delay(2000);
   cleardevice();
   setcolor(WHITE);
   rectangle(midx-30,midy-80,midx+30,midy+80);
   circle(midx, midy+50, 22);
   setfillstyle(SOLID_FILL,GREEN);
   floodfill(midx, midy+50,WHITE);
   setcolor(BLUE);
   outtextxy(midx-7,midy+48,"GO");
   setcolor(RED);
   settextstyle(SCRIPT_FONT, HORIZ_DIR, 4);
   outtextxy(midx-150, midy+100, "Press any key to exit...");
 
   getch();
   closegraph();
   return 0;
}
Exemplo n.º 21
0
int main(void)
    {
    int gd = DETECT, gm;
    long in = 0, out = 0;
    int x1, y1;
    double x, y;
    long i, n;
    double pi;
    char pi_str[50];

    printf("\nEnter number Random ->");
    scanf("%ld", &n);

    initgraph(&gd, &gm, "d:\\lang\\tcpp\\bgi");
    if (graphresult() != grOk)
	{
	printf("\nGraphic system can't be initialized ! ");
	return -1;
	}

    setcolor(WHITE);
    x1 = (getmaxx() - WIDTH)/2;
    y1 = (getmaxy() + WIDTH)/2;
    rectangle(x1, y1, x1+WIDTH, y1-WIDTH);
    ellipse(x1, y1, 0, 90, WIDTH, WIDTH);

    for (i = 0; i < n; i++)
	{
	x = tc_random()*WIDTH;
	y = tc_random()*WIDTH;

	if (x*x + y*y > (double)WIDTH*WIDTH)
	    {
	    putpixel(x1+x, y1-y, CYAN);
	    out++;
	    }
	else
	    {
	    putpixel(x1+x, y1-y, YELLOW);
	    in++;
	    }
	}

    pi = (double)in/n * 4.0;
    sprintf(pi_str, "pi = %lf", pi);
    setcolor(WHITE);
    settextjustify(CENTER_TEXT, CENTER_TEXT);
    outtextxy(getmaxx()/2, y1+30, pi_str);
    bioskey(0);
    return 0;
    }
Exemplo n.º 22
0
 int main(void)
 {
    int gdriver = DETECT, gmode, errorcode;
    int midx, midy, hj, vj;
    char msg[80];
    initgraph(&gdriver, &gmode, "\\arquiv~1\\bc\\bgi");
    errorcode = graphresult();
    if (errorcode != grOk)
    {
       printf("Graphics error: %s\n", grapherrormsg(errorcode));
       printf("Press any key to halt:");
       getch();
       exit(1);
    }

    midx = getmaxx() / 2;
    midy = getmaxy() / 2;

    for(hj=LEFT_TEXT; hj<=RIGHT_TEXT; hj++)
       for (vj=LEFT_TEXT; vj<=RIGHT_TEXT; vj++)
       {
	  cleardevice();
	  settextstyle(2,VERT_DIR,5);
	  settextjustify(hj, vj);
	  sprintf(msg,"%s  %s",hjust[hj], vjust[vj]);
	  outtextxy(midx, midy, msg);
	  getch();
	  settextstyle(2,HORIZ_DIR,5);
	  settextjustify(hj, vj);
	  sprintf(msg,"%s  %s",hjust[hj], vjust[vj]);
	  outtextxy(midx, midy, msg);
	  getch();

       }
       getch();
    closegraph();
    return 0;
 }
Exemplo n.º 23
0
void Graph::setLabels(char* x_label, char* y_label){
    /*Used for setting graph labels
      TODO use variables for off set and padding
    */
    // X axis label
    settextjustify(CENTER_TEXT, CENTER_TEXT);
    settextstyle(0, HORIZ_DIR, 0);
    outtextxy(X_OFFSET + 200, Y_OFFSET + 25, x_label);
    //Y axis label
    settextstyle(0, VERT_DIR, 0);
    outtextxy(X_OFFSET - 25, Y_OFFSET - 150, y_label);
    settextstyle(0, HORIZ_DIR, 0);

}
Exemplo n.º 24
0
void putbackground(void)
{
	/* this function displays the application "desktop" */

	int x;

	setcolor(UVEALTBLUE);
	for(x=0;x<=20;x++) line(0,x,639,x);

	setfillstyle(SOLID_FILL,UVEADKBLUE);
	floodfill(1,22,UVEALTBLUE);

	setcolor(UVEADKBLUE);
	settextstyle(SANSSERIF, HORIZ_DIR, 2);
	settextjustify(CENTER_TEXT,CENTER_TEXT);
	outtextxy(getmaxx()/2,8,"Uvea Information Services");
}
Exemplo n.º 25
0
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 );

}
Exemplo n.º 26
0
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);
	}
Exemplo n.º 27
0
drawCommandButtons()
{
	setfillstyle(SOLID_FILL,0);
	bar(0,0,xm,ym);

	setfillstyle(SOLID_FILL,7);
	bar(xm-75,50,xm-1,ym-50);

	vert_butt();
//	horiz_butt();

	setcolor(15);
	settextjustify(CENTER_TEXT,TOP_TEXT);
	settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
	outtextxy(310,10,"DYNAMICS Simulation");

	return 0;
}
Exemplo n.º 28
0
int main(void)
{
   /* request auto detection */
   int gdriver = DETECT, gmode, errorcode;
   int style, midx, midy;
   int size = 1;

   /* initialize graphics and local variables */
   initgraph(&gdriver, &gmode, "");

   /* read result of initialization */
   errorcode = graphresult();
   if (errorcode != grOk)  /* an error occurred */
   {
      printf("Graphics error: %s\n", grapherrormsg(errorcode));
      printf("Press any key to halt:");
      getch();
      exit(1); /* terminate with an error code */
   }

   midx = getmaxx() / 2;
   midy = getmaxy() / 2;

   settextjustify(CENTER_TEXT, CENTER_TEXT);

   /* loop through the available text styles */
   for (style=DEFAULT_FONT; style<=GOTHIC_FONT; style++)
   {
      cleardevice();
      if (style == TRIPLEX_FONT)
         size = 4;

      /* select the text style */
      settextstyle(style, HORIZ_DIR, size);

      /* output a message */
      outtextxy(midx, midy, fname[style]);
      getch();
   }

   /* clean up */
   closegraph();
   return 0;
}
Exemplo n.º 29
0
void btv_draw(node *p)
    {
    int gd = DETECT, gm;
    initgraph(&gd, &gm, "c:\\tc\\bgi");
    if (graphresult() != grOk)
	{
	printf("\n Graphic system error !");
	return;
	}
    settextstyle(TRIPLEX_FONT, HORIZ_DIR, 3);
    settextjustify(CENTER_TEXT, CENTER_TEXT);
    setfillstyle(0, BLACK);
    moveto(getmaxx()/2, 10);
    _draw_link(p, 7, getmaxx()-7, 15);
    _draw_node(p, 7, getmaxx()-7, 15);
    setcolor(WHITE);
    wait_hardcopy(LPT1);
    closegraph();
    }
Exemplo n.º 30
0
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 );

}