Ejemplo n.º 1
0
void user_poly()
{
	int inix,iniy,curx1,cury1,curx2,cury2;
	int mousex,mousey,button;
	getmousepos(&button,&mousex,&mousey);
	inix=mousex;
	iniy=mousey;
	curx1=inix;
	cury1=iniy;
	for(;button!=2;getmousepos(&button,&mousex,&mousey))
	{
	if(button==1)
	{
		curx2=mousex;
		cury2=mousey;
		//printf("%d %d\n",mousex,mousey);
		hidemouseptr();
		array_line_entry(curx1,cury1,curx2,cury2);
		bresline(curx1,cury1,curx2,cury2,1);
		showmouseptr();
		curx1=curx2;
		cury1=cury2;
		delay(200);
	}
	}
	hidemouseptr();
	array_line_entry(curx1,cury1,inix,iniy);
	bresline(curx1,cury1,inix,iniy,1);
	showmouseptr();
}
Ejemplo n.º 2
0
 int changepassword()
 {
	cleardevice();
	outer_function_screen("CHANGE PASSWORD");
	draw_button(225,225,395,255,1,"Administrator");
	draw_button(225,285,395,315,1,"Customer");
	draw_button(225,345,395,375,1,"Exit");
	showmouseptr();
	while(1)
	{
	 showmouseptr();
	 getmousepos(&button,&corx,&cory);
	 if((button&1)==1)
	  {
	   if((corx>225&&corx<395)&&(cory>225&&cory<255))
		{
		 hidemouseptr();
		 return(ch_pass(0));
		}
	   if((corx>225&&corx<395)&&(cory>285&&cory<315))
		{
		 hidemouseptr();
		 return(ch_pass(1));
		}
	   if((corx>225&&corx<395)&&(cory>345&&cory<375))
		{
		 hidemouseptr();
		 closegraph();
		 exit(0);
		}
	  }
	}
 }
Ejemplo n.º 3
0
 void rem_account()
 {
   cleardevice();
   outer_function_screen("REMOVE ACCOUNT");
   draw_button(220,225,425,255,1,"Remove Account");
   draw_button(220,285,425,315,1,"  EXIT");

   showmouseptr();
	while(1)
	{
	 getmousepos(&button,&corx,&cory);
	 if((button&1)==1)
	  {
	   if((corx>220&&corx<425)&&(cory>225&&cory<255))
		{
		 hidemouseptr();
		 rm_menu();
		 return;
		}
	   if((corx>220&&corx<425)&&(cory>285&&cory<315))
		{
		 hidemouseptr();
		 showadminmenu();
		 exit(0);
		}
	  }
	}
 }
Ejemplo n.º 4
0
  void enter()
  {
   while(1)
	{
	 if(successfullogin==1)
	   break;
	 show_close_button();
	 showmouseptr();
	 getmousepos(&button,&x,&y);
	  if((button&1)==1)
	  { corx=x;
		cory=y;
		if((corx>170&&corx<280)&&(cory>250&&cory<290))
		 {
			setcolor(WHITE);
			line(170,290,280,290);
			line(280,250,280,290);
			setcolor(DARKGRAY);
			line(170,250,280,250);
			line(170,250,170,290);
			delay(125);
			hidemouseptr();
			resetloginform();
			login();
		 }
		else if((corx>310&&corx<430)&&(cory>250&&cory<290))
		 {
			hidemouseptr();
			setcolor(WHITE);
			line(310,290,430,290);
			line(430,250,430,290);
			setcolor(DARKGRAY);
			line(310,250,430,250);
			line(310,250,310,290);
			delay(125);
			f1=fopen("admin","r");
			rewind(f1);
			fread(&admin,sizeof(admin),1,f1);
			if((strcmp(admin.loginid,loginid)==0) && (strcmp(admin.password,password)==0))
			 {
			  successfullogin=1;
			  return;
			 }
			else
			{
			 show_err("Wrong LoginID or Password");
			 resetloginform();
			 login();
			}
		 }
		else if((corx>618&&corx<630)&&(cory>8&&cory<20))
		{
		  show_exit_message();
		  delay(500);
		  exit(0);
		}
	  }
	}
  }
Ejemplo n.º 5
0
void user_save()
{
	int a,b,w,px,i=-1;
	char filename[60],ch;
	restrictmouseptr(0,0,xmax,20);
	hidemouseptr();
	a=textwidth("Enter File Name");
	setfillstyle(1,BLUE);
	bar(0,0,xmax,20);
	setcolor(BLACK);
	outtextxy(10,5,"Enter File Name:");
	setfillstyle(1,WHITE);
	bar((a+10),2,(a+410),18);
	setfillstyle(1,CYAN);
	a=textwidth("No");
	bar((xmax-10-a),2,(xmax-10),18);
	b=a+10+textwidth("Save");
	bar((xmax-10-b),2,(xmax-20-a),18);
	setcolor(BLACK);
	outtextxy((xmax-9-b),3,"Save");
	outtextxy((xmax-9-a),3,"No");
	px=textwidth("Enter File Name")+10;
	while(1)
	{
	ch=get_filename(px,4);
	if(ch==13||ch==27)
	break;
	w=textwidth("A");
	px+=w;
	filename[++i]=ch;
	}
	filename[++i]='\0';
	showmouseptr();
	for(;;)
	{
		getmousepos(&button,&mousex,&mousey);
		if(mousex>(xmax-10-a)&&mousex<(xmax-10)&&button==1)       //deny loading/saving
		{
			button_hover((xmax-10-a),2,(xmax-10),18);
			hidemouseptr();
			initmouse();
			top_panel_default();
			top_panel_buttons(tool_but_num,0,1);
			showmouseptr();
			break;
		}
	else if(mousex>(xmax-10-b)&&mousex<(xmax-20-a)&&button==1)        //confirm loading/saving
		{
			button_hover((xmax-10-b),2,(xmax-20-a),18);
			save_bitmap(filename);
			hidemouseptr();
			initmouse();
			top_panel_default();
			top_panel_buttons(tool_but_num,0,1);
			showmouseptr();
			break;
		}
	}
}
Ejemplo n.º 6
0
void main()
{
 int gdriver = DETECT, gmode;
 initgraph(&gdriver, &gmode, "\\tc\\bgi");
 cleardevice();
 king("ch1");
 int Mstatus = initmouse();
 int button,m,n;
 if(Mstatus == 0 )
  outtextxy(50,50, "Mouse Support Not Available");
 settextstyle(2,0,4);
 while(1)
{ showmouseptr();
  getmousepos(&button,&m,&n);
  if(m>245 && m<325 && n>220 && n<232)
  { setcolor(RED);
    outtextxy(250,220,"PLAYER vs PLAYER"); }
  else
  { setcolor(WHITE);
    outtextxy(250,220,"PLAYER vs PLAYER");
  if(m>245 && m<325 && n>240 && n<252)
  { setcolor(RED);
    outtextxy(250,240,"CHESS PUZZLES");  }
  else
  { setcolor(WHITE);
    outtextxy(250,240,"CHESS PUZZLES");
  if(m>245 && m<325 && n>260 && n<272)
  { setcolor(RED);
    outtextxy(250,260,"BACK");  }
  else
  { setcolor(WHITE);
    outtextxy(250,260,"BACK"); }}}
  if(button == 1)
  { if(m>245 && m<325 && n>220 && n<232)
    { hidemouseptr();
      video(450,150);
      createnewfile();
      spawnl(P_WAIT,"load.exe", NULL);  // load
      spawnl(P_WAIT,"chess.exe", NULL);  // player vs player
      cleardevice();
      king("ch1"); }
    if(m>245 && m<325 && n>240 && n<252)
    { hidemouseptr();
      video(450,150);
      spawnl(P_WAIT,"menu6.exe", NULL); } // chess puzzles menu
//      exit(0); }
    if(m>245 && m<325 && n>260 && n<272)
    { hidemouseptr();
      video(450,150);
//      spawnl(P_WAIT,"g:\\exe\\menu1.exe", NULL);  // back to main menu
      break; }}}}
void edge::onclick()
{
    setfillstyle(SOLID_FILL,YELLOW);
    setcolor(RED);
    hidemouseptr();
    bar(101,460,199,478);
    char *a="edge";
    outtextxy(120,463,a);
    showmouseptr();
    setfillstyle(SOLID_FILL,RED);

    while(flag==1)
    {
        getmousepos();
        if(button==1&&x<639&&x>0&&y<459&&y>0&&edgenum<30) //if you click on workspace
        {
            a1=x;
            b1=y;
            while(flag==1)  // waits for second click
            {
                getmousepos();
                if(button==1&&x!=a1&&y!=b1)
                {
                    a2=x;
                    b2=y;
                    break;
                } //takes second point when you click
            } // while end
            edgenum++;
            hidemouseptr();
            givemid(a1,b1,a2,b2);  //gives centers of two points
            if(givemid(a1,b1,a2,b2)==1&&edge::checkedge(x1,y1,x2,y2)==1) //condition false if you click outside the points
            {
                edge::display(x1,y1,x2,y2); //displays an edge
            }
            x1=y1=x2=y2=0;
            showmouseptr();
            break;
        } //if end
    } // while end
    setfillstyle(SOLID_FILL,1);
    setcolor(15);
    hidemouseptr();
    bar(101,460,199,478);
    outtextxy(120,463,a);
    showmouseptr();
    setfillstyle(SOLID_FILL,RED);

}
Ejemplo n.º 8
0
void save_bitmap(const char *filename)
{
	int r,be;
	r = access(filename,0);
	if( r == 0)
	{
		top_message("file already exists,Overwriting");
	}
		hidemouseptr();
		top_panel_default();
		setcolor(RED);
		outtextxy(200,3,"Please Wait");
		prgx=1;
		setcolor(BLACK);
		rectangle(0,2,ymax,18);
		be = writeBitmapFile(0,0,filename);
		showmouseptr();
		if( be != 0)
		{
		   top_message("Error While Creating File");
		   return;
		}
		else
		      {
		      top_message("File saved successfully");
		      }
	return;
}
Ejemplo n.º 9
0
void drawSpiral()
{
	int b, sx, sy, ex, ey, px, py;
	int c=cur_color;
	float r;
	setdrawmode(XOR_MODE);
	getmousepos(&b,&sx,&sy);
	set_color(15-c);
	ex = px = sx;ey = py = sy;
	if(b==1)
    hidemouseptr();
	while(b == 1)
	{
		if(px != ex || py != ey)
		{
			set_color(cur_color);
			spiral((px+sx)/2, (py+sy)/2, r);
			px = ex; py = ey;
			r = (sx<px)?(px-sx)/2:(sx-px)/2;
			spiral((px+sx)/2, (py+sy)/2, r);
		}
		getmousepos(&b,&ex,&ey);
	}
		set_color(c);
		setdrawmode(COPY_MODE);
		r = (sx<px)?(px-sx)/2:(sx-px)/2;
		spiral((px+sx)/2, (py+sy)/2, r);
		showmouseptr();
}
Ejemplo n.º 10
0
void drawThickLine(int op)
{
	int b, sx, sy, ex, ey, px, py;
	int c=cur_color;
	int x1=-1,y1=-1,x2=-1,y2=-1;
	setdrawmode(XOR_MODE);
	getmousepos(&b,&sx,&sy);
	set_color(15-c);
	ex = px = sx; ey = py = sy;
    if(b==1)
    hidemouseptr();
	while(b==1)
	{
	getmousepos(&b, &ex, &ey);
	if(px != ex || py != ey)
	{
		thickline(sx, sy, px, py,op);
		thickline(sx, sy, ex, ey,op);
		px = ex; py = ey;
		x1=sx;y1=sy;
		x2=ex;y2=ey;
	}
	}
	set_color(c);
	setdrawmode(COPY_MODE);
	thickline(x1, y1, x2, y2,op);
	showmouseptr();
}
Ejemplo n.º 11
0
void drawEllipse()
{
	int b, sx, sy, ex, ey, px, py;
	int c=cur_color;
	float r1=0,r2=0;
	setdrawmode(XOR_MODE);
	getmousepos(&b,&sx,&sy);
	set_color(15-c);
	ex = px = sx;ey = py = sy;
	if(b==1)
    hidemouseptr();
	while(b == 1)
	{
		getmousepos(&b,&ex,&ey);
		if(px != ex || py != ey)
		{
			bellipse((px+sx)/2, (py+sy)/2, r1, r2);
			px = ex;py = ey;
			r1 = (sx<px)?(px-sx)/2:(sx-px)/2;
			r2 = (sy<py)?(py-sy)/2:(sy-py)/2;
			bellipse((px+sx)/2, (py+sy)/2, r1, r2);
		}
	}
		
		r1 = (sx<px)?(px-sx)/2:(sx-px)/2;
		r2 = (sy<py)?(py-sy)/2:(sy-py)/2;
		set_color(c);
		setdrawmode(COPY_MODE);
		bellipse((px+sx)/2, (py+sy)/2,r1, r2);
		showmouseptr();
}
Ejemplo n.º 12
0
void main()
{
  int gd=DETECT,gm,x,y,button,i;
 randomize();
 for(i=0;i<20;i++)
 {n[i]=20;}
 for(i=0;i<20;i++)
 {n1[i]=20;}

  initgraph(&gd,&gm," ");
  sound(2350);
  outtextxy(250,150,"WELCOME TO PUZZLSE ");
  sleep(1); nosound();cleardevice();
   setbkcolor(GREEN);
  mouse();
  rectangle(200,200,300,230);
  rectangle(400,200,450,230);
  outtextxy(203,203,"START");outtextxy(403,203,"EXIT");
  while(flag==0)
   {
       getmousepos(&button,&x,&y);
       if(button==1&&x>200&&x<300&&y>200&&y<230)
       {delay(500);hidemouseptr();number();}
	if(button==1&&x>400&&x<450&&y>200&&y<230)exit(0);
    }

}
Ejemplo n.º 13
0
void shakil:: mixed()
{ tm=0;ne2=0;
  cleardevice();
  showmouseptr();
  settextstyle(1,0,1);
  show();
  while(1)
  {getmousepos(&button,&x,&y);
   if((button & 1)==1)
   {cal();
    resu();
    show();
    if(x>=470&&x<=520)
    {if(y>=370&&y<=390)
    {ne2=10;
     break; }
    if(y>=270&&y<=290)
    {save1();   }

   } }

   if(result==10)
   {settextstyle(1,0,10);
    outtextxy(50,100,"YOU WIN");
    delay(1000);
    getch();
    break;
   }
}
hidemouseptr();
result=0;
cleardevice();
showmouseptr();
}
Ejemplo n.º 14
0
int main() {
   int count = 1, gDriver = DETECT, gMode;
 
   initgraph(&gDriver, &gMode, "C\\:tc\\bgi");
 
   i.x.ax = 0;
   int86(0X33, &i, &o);
 
   if (o.x.ax == 0) {
      printf("ntMouse Support is Unavailable !!");
   } else {
      showmouseptr();
 
      while (count <= 10) {
         getch();
         count++;
         if (count % 2 == 0)
            hidemouseptr();
         else
            showmouseptr();
      }
   }
   getch();
   return 0;
}
Ejemplo n.º 15
0
void drawRectangle()
{
  int b, sx, sy, ex, ey, px, py;
  int c=cur_color;
  int x1=0,y1=0,x2=0,y2=0;
  setdrawmode(XOR_MODE);
  getmousepos(&b, &sx, &sy);
  set_color(15-c);
  ex = px = sx, ey = py = sy;
  if(b==1)
  hidemouseptr();
  while(b == 1)
  {
	getmousepos(&b, &ex, &ey);
	if(px != ex || py != ey)
	{
		drawRect(sx, sy, px, py);
		drawRect(sx, sy, ex, ey);
		px = ex, py = ey;
		x1=sx;y1=sy;
		x2=ex;y2=ey;
	}
	}
	set_color(c);
	setdrawmode(COPY_MODE);
	array_line_entry(x1,y1,x2,y1);
	array_line_entry(x1,y1,x1,y2);
	array_line_entry(x2,y1,x2,y2);
	array_line_entry(x1,y2,x2,y2);
	drawRect(x1, y1, x2, y2);
	showmouseptr();
}
Ejemplo n.º 16
0
int user_new()
{
	int a,b;
	restrictmouseptr(0,0,xmax,20);
	hidemouseptr();
	a=textwidth("This Action will erase current drawing, Continue?")+10;
	setfillstyle(1,BLUE);
	bar(0,0,xmax,20);
	settextstyle(0,0,1);
	setcolor(BLACK);
	outtextxy(10,5,"This Action will erase current drawing, Continue?");
	setfillstyle(1,CYAN);
	bar((a+18),1,(a+18+textwidth("Ya")+2),18);
	outtextxy((a+20),5,"Ya");
	b=a+textwidth("Ya")+10;
	bar((b+18),1,(b+18+textwidth("Na")+2),18);
	outtextxy((b+20),5,"Na");
	showmouseptr();
	for(;;)
	{	
		getmousepos(&button,&mousex,&mousey);
		if(mousex>(a+20)&&mousex<b+10&&button==1)      //new confirm
		{
			hidemouseptr();
			initmouse();
			draw_canvas_default();
			top_panel_default();
			top_panel_buttons(tool_but_num,0,1);
			showmouseptr();
			arrcnt=-1;
			return 1;
		}
	else if(mousex>b+20&&mousex<(b+36)&&button==1)        //deny new
		{
			hidemouseptr();
			initmouse();
			top_panel_default();
			top_panel_buttons(tool_but_num,0,1);
			showmouseptr();
			return 0;
		}
	}
}
Ejemplo n.º 17
0
  int check_next_button()
  {
	showmouseptr();
	while(1)
	{
	 getmousepos(&button,&x,&y);
	 if((button&1)==1)
	   {
			if(((x>400)&&(x<465))&&((y>410)&&(y<440)))
			 {
			  hidemouseptr();
			  return 0;
			 }
			if(((x>475)&&(x<540))&&((y>410)&&(y<440)))
			  {
			   hidemouseptr();
			   return 1;
			  }
		}
	 }
  }
Ejemplo n.º 18
0
void button_click(int x1,int y1,int x2,int y2)
{
	hidemouseptr();
	setcolor(BLACK);
	line(x1,y2,x1,y1);
	line(x1,y1,x2,y1);
	setcolor(WHITE);
	line(x2,y1,x2,y2);
	line(x2,y2,x1,y2);
	showmouseptr();
	delay(200);
}
Ejemplo n.º 19
0
void top_message(char *message)
{
	top_panel_default();
	restrictmouseptr(0,0,xmax,20);
	hidemouseptr();
	setcolor(BLACK);
	outtextxy(10,3,message);
	showmouseptr();
	for(;;)
	{	
		getmousepos(&button,&mousex,&mousey);
		if(mousex>619&&button==1)      
		{
			hidemouseptr();
			button_hover((xmax-13),4,(xmax-4),11);
			initmouse();
			showmouseptr();
			return;
		}
	}
}
void node::onclick()
{
    setfillstyle(SOLID_FILL,YELLOW);
    setcolor(RED);
    hidemouseptr();
    bar(1,460,99,478);
    char *a="node";
    outtextxy(20,463,a);
    showmouseptr();
    setfillstyle(SOLID_FILL,RED);
    while(flag==1)
    {
        getmousepos();
        if(button==1&&x<639&&x>0&&y<459&&y>0&&nodenum<30&&(node::check(x,y)==1)) //if you click on workspace
        {
            nodenum++;
            n[nodenum].id=nodenum;
            //	n[nodenum].name
            n[nodenum].x=x;
            n[nodenum].y=y;

            hidemouseptr();
            node::display(x,y,nodenum);    // a node will be displayed
            showmouseptr();
            break;
        }
        if(nodenum>=30||(button==1&&(node::check(x,y)==0)))//if node is present
        {
            break;
        }
    }
    setfillstyle(SOLID_FILL,1);
    setcolor(15);
    hidemouseptr();
    bar(1,460,99,478);
    outtextxy(20,463,a);
    showmouseptr();
    setfillstyle(SOLID_FILL,RED);
}
Ejemplo n.º 21
0
void drawSpray()
{
	int b,sx,sy;
	getmousepos(&b,&sx,&sy);
	if(b==1)
	hidemouseptr();
	while(b==1)
	{
	getmousepos(&b,&sx,&sy);
	spray(sx,sy,cur_color);
	}
	showmouseptr();
	}
Ejemplo n.º 22
0
void top_panel_background()
{
	int back_arrow[16]={2,10,10,18,10,15,17,15,17,5,10,5,10,2,2,10};
	hidemouseptr();
	setfillstyle(1,BLUE);
	bar(0,0,xmax,20);
	setfillstyle(1,GREEN);
	fillpoly(8,back_arrow);
	setfillstyle(1,cur_color);
	bar(500,3,600,17);
	setcolor(BLACK);
	rectangle(500,3,600,17);
	showmouseptr();
}
Ejemplo n.º 23
0
void top_panel_buttons(int n,int a,int c)
{
	hidemouseptr();
	for(;n>0;n--)
	{
		setfillstyle(1,3);				//2,3
		if(n==a)
		setfillstyle(1,c);
		bar((2+n*20),2,(18+n*20),18);
	}
	if(cur_panel==0)
	tools_icons();
	else if(cur_panel==1)
	style_icon();
	showmouseptr();
}
Ejemplo n.º 24
0
//fun��o quando clica
void MenuClick(int qt){
	int i = 0, j = 0, k = 0;
	getmouseposClick(&button,&mx,&my);
	if(button == 1){
		button = -1;
		for(i = 1; i <= qt; i++){
			if(mx <= (mn.id[i].x+mn.id[i].w) && mx >= (mn.id[i].x)){
				if(my <= (mn.id[i].y+mn.id[i].h) && my >= mn.id[i].y){
					hidemouseptr();
					actMN = true;
					clickSM = i;
					//redesenha palco
					RemakeStage();
					//desenho do menu em outra cor
					window(mn.id[i].x, mn.id[i].y, mn.id[i].x+mn.id[i].w, mn.id[i].y+mn.id[i].h);
					textcolor(mn.id[i].scolorT);
					textbackground(mn.id[i].scolorB);
					clrscr();
					//agora vamos labels e controles
					gotoxy(((mn.id[i].w/2)-(strlen(mn.id[i].label)/2))+1, (mn.id[i].h/2)+1);
					printf("%s", mn.id[i].label);
					WinDefault();
					//desenho da sombra do Lorenzo
					window((mn.id[i].x+mn.id[i].w+1)+1, (mn.id[i].y)+1, (mn.id[i].x+mn.id[i].w+mn.id[i].w)+2, (mn.id[i].y+2*(mn.id[i].cm)-2)+1);
					textbackground(BLACK); clrscr();
					//limpar tela
					WinDefault();
					//desenho do sub menu
					window(mn.id[i].x+mn.id[i].w+1, mn.id[i].y, mn.id[i].x+mn.id[i].w+mn.id[i].w, mn.id[i].y+2*(mn.id[i].cm)-2);
					textcolor(mn.id[i].scolorT);
					textbackground(mn.id[i].scolorB);
					clrscr();
					for(j = 1, k =1; k <= 2*(mn.id[i].cm); j++,k++){
						DrawArrow(2, k);
						gotoxy(4,k);
						cprintf("%s", mn.id[i].sm[j].label);
						k++;
						if(k+1 < 2*(mn.id[i].cm))
							DrawLine(1, k, mn.id[i].w);
					}
					WinDefault();
					showmouseptr();
				}//if da coordenada y
			}//if da coordenada x
		}
	}
}
Ejemplo n.º 25
0
//----------------------COLOR FUNCTIONS START-----------------
void draw_color()
{
	 int n;
	 top_panel_background();
	 hidemouseptr();
	 for(n=1;n<=16;n++)
	 {
		setfillstyle(1,15);
		bar((3+n*20),3,(17+n*20),17);
		setfillstyle(1,n);
		bar((4+n*20),4,(16+n*20),16);
	 }
	 user_pattern();
	 showmouseptr();
	 monitor_color(16);

}
Ejemplo n.º 26
0
void drawCircle(int op)
{
	int button,x,y,x1,x2,y1,y2,prevx2,prevy2;
	float r;
	int c=cur_color;
	setdrawmode(XOR_MODE);
	
	getmousepos(&button,&x,&y);
	set_color(15-c);
			if(button==1)
			{
				setdrawmode(XOR_MODE);
				hidemouseptr();
				getmousepos(&button,&x,&y);
				x1=x;y1=y;
				x2=x;y2=y;
				r=(pow((x1-x2),2))+(pow((y1-y2),2));
				r=pow(r,0.5);
				r=r/2.0;
				bcircle((x1+x2)/2,(y1+y2)/2,r,op);
				while(button==1)
				{
					prevx2=x2;prevy2=y2;
					getmousepos(&button,&x,&y);
					x2=x;y2=y;
					if(prevx2!=x2||prevy2!=y2)
					{
						r=(pow((x1-prevx2),2))+(pow((y1-prevy2),2));
						r=pow(r,0.5);
						r=r/2.0;
						bcircle((x1+prevx2)/2,(y1+prevy2)/2,r,op);
						r=(pow((x1-x2),2))+(pow((y1-y2),2));
						r=pow(r,0.5);
						r=r/2.0;
						bcircle((x1+x2)/2,(y1+y2)/2,r,op);
					}
				}
				set_color(c);
				setdrawmode(COPY_MODE);
				bcircle((x1+x2)/2,(y1+y2)/2,r,op);
				showmouseptr();
		}


}
Ejemplo n.º 27
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();
		}
	}
}
Ejemplo n.º 28
0
void brush(int op)
{
	int b,sx,sy,prec;
	prec=cur_color;
	if(op==2)
	set_color(WHITE);

	getmousepos(&b,&sx,&sy);
	if(b==1)
	hidemouseptr();
	while(b==1)
	{
	getmousepos(&b,&sx,&sy);
	plotbrush(sx,sy,cur_color);
	}
	set_color(prec);	
showmouseptr();
}
Ejemplo n.º 29
0
  void show_next_form()
  {
	 cleardevice();
	 hidemouseptr();
     cleardevice();
     setcolor(GREEN);
     settextstyle(10,HORIZ_DIR,3);
     outtextxy(70,20,"OPENING A NEW ACCOUNT");
     setcolor(LIGHTGRAY);
	 line(80,110,550,110);
     line(80,110,80,400);
	 setcolor(DARKGRAY);
	 line(550,110,550,400);
	 line(80,400,550,400);
	 settextstyle(1,HORIZ_DIR,1);
	 outtextxy(90,120,"Enter Floppy and press enter : ");
	 getch();
  }
Ejemplo n.º 30
0
 void displaydata()
 {
	char *c;
	cleardevice();
	hidemouseptr();
	cleardevice();
	border();
	setcolor(GREEN);
	settextstyle(10,HORIZ_DIR,3);
	outtextxy(70,20,"LIST OF ACCOUNTS IN BANK");
	setcolor(LIGHTGRAY);
	line(8,95,getmaxx()-8,95);
	line(8,100,getmaxx()-8,100);
	settextstyle(1,HORIZ_DIR,1);
	outtextxy(15,120,"Acc.No.");
	outtextxy(150,120,"Name");
	outtextxy(300,120,"Address");
	outtextxy(500,120,"Balance");
 }