Docstoc

main

Document Sample
main Powered By Docstoc
					#include<waqas.h>
#include<stdlib.h>
union REGS in,out;
               void design();
               int selectinterface();

void main()
{clrscr();
   int gd=DETECT,gm;
   initgraph(&gd,&gm,"c:\\tc\\bgi");
   int choice;
   design();

     choice=selectinterface();
     switch(choice)
     {
     case 1:
          gotoxy(10,24);
          cout<<"Student";
          break;
     case 2:
          gotoxy(10,24);
          cout<<"Teacher";
          break;
     case 3:
          gotoxy(10,24);
          cout<<"Management";
          break;
      case 4:
          gotoxy(10,24);
          cout<<"Calulator";
          break;
 }




  getch();
}
/////////////////////////////////////////////functions///////////////////
//////
  void design()
  { setbkcolor(12);
    setcolor(WHITE);
    rectangle(5,5,637,475);    //ex 1
    rectangle(13,13,630,468); //ex 2
    rectangle(220,120,400,375); //in 1
    rectangle(225,125,395,370); //in 2
    rectangle(50,150,190,340);    //help left
    rectangle(425,150,570,340);   //introduction

    line(13,13,220,120);
    line(630,468,400,375);
    line(630,13,400,120);
    line(13,468,220,375);
    rectangle(225,340,395,370);
    rectangle(225,310,395,340);
    rectangle(225,280,395,310);
    rectangle(225,250,395,280);
    rectangle(225,220,395,250);
    rectangle(225,190,395,220);
    rectangle(235,135,385,180); //main menu
    settextstyle(4,0,3);
    outtextxy(253,140,"Main Menu");

    settextstyle(4,0,6);
    outtextxy(130,15,"College Database");

    settextstyle(2,0,6);

    outtextxy(244,195,"Student Record");
    outtextxy(244,225,"Teacher Record");
    outtextxy(250,255,"Management");
    outtextxy(244,285,"Use Calculator");
    outtextxy(244,315,"Change Interface");
    outtextxy(290,345,"Exit");

    settextstyle(2,0,4);

    outtextxy(55,155,"     Use Keyboard");
    outtextxy(55,175,"Up    : ^ (Up Arrow)");
    outtextxy(55,195,"Down : v (Down Arrow)");
    outtextxy(55,215,"Select:   (Enter Key)");

    outtextxy(55,240,"     Use Mouse");
    outtextxy(55,260,"Move mouse pointer to");
    outtextxy(55,280,"the desigred menu and");
    outtextxy(55,300,"use mouse left click to");
    outtextxy(55,320,"Select menu.");

    outtextxy(430,160,"      Cradit ");
    outtextxy(430,190,"Name    : M. Waqas ");
    outtextxy(430,210,"Roll # : 10075 ");
    outtextxy(430,230,"Class   : BCs (Hons)");
    outtextxy(430,250,"          3rd semester");
    outtextxy(430,270,"Section : 'A')");
    outtextxy(430,290,"Project : College Record");
    outtextxy(430,310,"          System");
    outtextxy(430,320,"Teacher : Mis. Shazia");

    outtextxy(205,425,"Select Keyboard");
    outtextxy(335,425,"Use Mouse");
}
int selectinterface()
{int x=0;
 char ch;
 int f,clk=0;
 int m;
again:
do
{ design();
   rectangle(200,420,400,450); //select Keyboard
   rectangle(195,415,405,455); //select Keyboard
 if(ch==75)
 {x=0;}
 if(ch==77)
 {x=100;}

 setcolor(2);
   rectangle(200+x,420,300+x,450); //select Keyboard
  ch=getche();

  }
  while(ch!=13);
switch(x)
{
  case 0: //setcolor(0);
    int y=0;
    char ch;
    f=1;
do
{ design();
  if(ch==72)
  {y-=30;f-=1;}
  if(ch==80)
  {y+=30;f+=1;}
if(y>150)
{y=0;f=1;}
if(y<0)
{y=150;f=6;}
  setcolor(2);
  rectangle(225,190+y,395,220+y);
  ch=getche();


 }
 while(ch!=13);
 break;
case 100:


  int xx,yy,cc;
  in.x.ax=0;
  int86(0x33,&in,&out);
  in.x.ax=1;
  int86(0x33,&in,&out);
do
{ xx=yy=0;
   design();
   in.x.ax=3;
   int86(0x33,&in,&out);
    cc=out.x.bx;
    xx=out.x.cx;
    yy=out.x.dx;

          if((xx>=225&&xx<=395)&&(yy>=190&&yy<=220))
           {m=0;f=1;}

           if((xx>=225&&xx<=395)&&(yy>=220&&yy<=250))
           {m=30;f=2;}
          if((xx>=225&&xx<=395)&&(yy>=250&&yy<=280))
           {m=60;f=3;}

           if((xx>=225&&xx<=395)&&(yy>=280&&yy<=310))
           {m=90;f=4;}

           if((xx>=225&&xx<=395)&&(yy>=310&&yy<=340))
           {m=120;f=5;}

           if((xx>=225&&xx<=395)&&(yy>=340&&yy<=370))
           {m=150;f=6;}

           setcolor(BLUE);

           rectangle(225,190+m,395,220+m);

if((f==1&&cc==1&&((xx>=225&&xx<=395)&&(yy>=190&&yy<=220)))||(f==2&&cc==1&
&((xx>=225&&xx<=395)&&(yy>=220&&yy<=250)))||(f==3&&cc==1&&((xx>=225&&xx<=
395)&&(yy>=250&&yy<=280)))||(f==4&&cc==1&&((xx>=225&&xx<=395)&&(yy>=280&&
yy<=310)))||(f==5&&cc==1&&((xx>=225&&xx<=395)&&(yy>=310&&yy<=340)))
||(f==6&&cc==1&&((xx>=225&&xx<=395)&&(yy>=340&&yy<=370))))//||(f==7&&cc==
1&&((xx>=225&&xx<=395)&&(yy>=370&&yy<=400))))
           {clk=1;}

    gotoxy(4,4);
    cout<<xx;
    gotoxy(74,4);
    cout<<yy;
    gotoxy(39,7);
    cout<<cc;
 }while(clk!=1);


//break;
}
if(f==5)
{
  goto again;}
if(f==6)
{cleardevice();m=0;f=1;
    exit(0);

}
    return f;}

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:9
posted:4/8/2012
language:English
pages:5