بســم الله الـرحمــن الرحيــم
هدا البرنامج انا كتبت من حوالي 5 سنوات هو يرسم نافدة ادخال كلمة السر في دوس مع برمجة الفأرة طبعا. جربوه
البرنامج التنفيدي في المرفقات
- #include "graphics.h"
- #include "dos.h"
- #include "string.h"
- #include "stdlib.h"
- #include "conio.h"
- #include "ctype.h"
- #include "stdio.h"
- //-------------------------------------------------------------------//
- union REGS registre;
- struct REGPACK reg;
- //-------------------------------------------------------------------//
- const int CLICK = 1;
- const int PAINT = 2;
- const int mbOk = 1;
- const int mbExit = 2;
- //-------------------------------------------------------------------//
- int choix_1,choix_2,choix_3,choix_4,signal;
- char nbre[20];
- double List[10];
- //-------------------------------------------------------------------//
- enum boolean {
- false = 0,
- true = 1
- };
- //-------------------------------------------------------------------//
- boolean mouse(int x,int y,int maxx,int maxy)
- {
- reg.r_ax = 3;
- intr(0x33,®);
- if(reg.r_cx<=maxx && reg.r_cx>=x && reg.r_dx<=maxy && reg.r_dx>=y)
- return true;
- else
- return false;
- }
- //--------------------------------------------------------------------//
- void show()
- {
- registre.x.ax = 1;
- int86(0x33,®istre,®istre);
- }
- //--------------------------------------------------------------------//
- void hide()
- {
- reg.r_ax = 2;
- intr(0x33,®);
- }
- //--------------------------------------------------------------------//
- int init_mouse()
- {
- reg.r_ax = 0;
- intr(0x33,®);
- return reg.r_ax;
- }
- //--------------------------------------------------------------------//
- boolean clic(int x,int y,int maxx,int maxy)
- {
- registre.x.ax = 3;
- int86(0x33,®istre,®istre);
- if(mouse(x,y,maxx,maxy) && registre.x.bx==1)
- return true;
- else
- return false;
- }
- //-------------------------------------------------------------------//
- void separator(int x,int y,int larg)
- {
- hide();
- setcolor(8);
- line(x,y,x+larg,y);
- setcolor(15);
- line(x,y+1,x+larg,y+1);
- show();
- }
- //-------------------------------------------------------------------//
- void BUTTON_OK(int x,int y,char *nom_buttom)
- {
- hide();
- setcolor(10);
- line(x+5,y+13,x+10,y+17);
- line(x+10,y+17,x+20,y+5);
- line(x+6,y+13,x+10,y+16);
- line(x+7,y+13,x+10,y+15);
- line(x+10,y+16,x+19,y+5);
- line(x+10,y+15,x+18,y+5);
- setcolor(8);
- line(x+4,y+12,x+8,y+12);
- line(x+17,y+4,x+21,y+4);
- line(x+4,y+12,x+10,y+18);
- line(x+8,y+12,x+10,y+14);
- line(x+10,y+14,x+17,y+4);
- line(x+21,y+4,x+10,y+18);
- setcolor(0);
- outtextxy(x+28,y+5,nom_buttom);
- show();
- }
- //--------------------------------------------------------------------//
- void BUTTON_EXIT(int x,int y,char *nom_buttom)
- {
- hide();
- setfillstyle(1,4);
- fillellipse(x+13,y+10,7,7);
- setcolor(15);
- line(x+8,y+6,x+16,y+14);
- line(x+16,y+6,x+8,y+14);
- line(x+9,y+6,x+17,y+14);
- line(x+10,y+6,x+18,y+14);
- line(x+17,y+6,x+9,y+14);
- line(x+18,y+6,x+10,y+14);
- setcolor(0);
- outtextxy(x+29,y+5,nom_buttom);
- circle(x+13,y+10,7);
- show();
- }
- //-------------------------------------------------------------------//
- void init_graph()
- {
- if(init_mouse() != -1)
- {
- exit(1);
- }
- else
- {
- int gdriver = DETECT, gmode;
- initgraph(&gdriver, &gmode, "");
- }
- }
- //-------------------------------------------------------------------//
- void setfont(int x,int y)
- {
- settextstyle(x,0,y);
- }
- //-------------------------------------------------------------------//
- void windows(int x,int y,int larg,int haut,char *titre)
- {
- hide();
- setfillstyle(1,7);
- bar(x,y,x+larg,y+haut);
- setcolor(15);
- line(x,y,x,y+haut);
- line(x,y,x+larg,y);
- setcolor(0);
- line(x+larg,y+haut,x+larg,y);
- line(x+larg,y+haut,x,y+haut);
- setfillstyle(1,1);
- bar(x,y-16,x+larg+10,y);
- setfillstyle(1,1);
- fillellipse(x+larg+10,y-8,8,8);
- setcolor(1);
- circle(x+larg+10,y-8,8);
- setfillstyle(1,4);
- fillellipse(x,y-8,17,17);
- int xx = x-10,yy = y-17;
- setcolor(4);
- circle(x,y-8,17);
- setfillstyle(1,7);
- bar(xx,yy,xx+19,yy+16);
- setfillstyle(1,1);
- bar(xx,yy,xx+19,yy+4);
- setcolor(0);
- line(xx+19,yy+16,xx+19,yy);
- line(xx+19,yy+16,xx,yy+16);
- setcolor(15);
- line(xx,yy,xx+19,yy);
- line(xx,yy,xx,yy+16);
- setcolor(15);
- outtextxy(x+25,y-14,titre);
- show();
- }
- //--------------------------------------------------------------------//
- void text_edit(int x,int y,int largeur,int hauteur)
- {
- hide();
- setfillstyle(1,15);
- bar(x,y,x+largeur,y+hauteur);
- setcolor(0);
- line(x,y,x,y+hauteur);
- line(x,y,x+largeur,y);
- setcolor(15);
- line(x+largeur,y+hauteur,x+largeur,y);
- line(x+largeur,y+hauteur,x,y+hauteur);
- show();
- }
- //--------------------------------------------------------------------//
- void label(char *titre,int x,int y,int color)
- {
- hide();
- setcolor(color);
- outtextxy(x,y,titre);
- show();
- }
- //--------------------------------------------------------------------//
- void border(int x,int y,int maxx,int maxy)
- {
- hide();
- setcolor(15);
- line(x+1,y+1,maxx,y+1);
- line(x,y+1,maxx-1,y+1);
- line(x+1,y+1,x+1,maxy-1);
- line(maxx+1,maxy+1,maxx+1,y);
- line(maxx+1,maxy+1,x,maxy+1);
- setcolor(8);
- line(x,y,maxx,y);
- line(x,y,maxx,y);
- line(maxx,y,maxx,maxy);
- line(maxx,maxy,x,maxy);
- line(x,maxy,x,y);
- show();
- }
- //--------------------------------------------------------------------//
- void page_arriere(int background)
- {
- hide();
- setfillstyle(1,background);
- bar(0,0,getmaxx(),getmaxy());
- show();
- }
- //-------------------------------------------------------------------//
- void button(char *nom_buttom,int x,int y,int maxx,int maxy,int cause_appel,int type_button)
- {
- hide();
- setfillstyle(1,7);
- bar(x,y,maxx,maxy);
- switch(cause_appel)
- {
- case PAINT : setcolor(0);
- line(maxx,maxy,maxx,y);
- line(maxx,maxy,x,maxy);
- line(maxx-1,maxy-1,maxx-1,y);
- line(maxx-1,maxy-1,x,maxy-1);
- line(x,y,maxx,y);
- line(x,y,x,maxy);
- setcolor(15);
- line(x+1,y+1,x+1,maxy-1);
- line(x+1,y+1,maxx-1,y+1);
- break;
- case CLICK : setcolor(0);
- rectangle(x,y,maxx,maxy);
- rectangle(x+1,y+1,maxx-1,maxy-1);
- setcolor(15);
- line(maxx,maxy,maxx,y);
- line(maxx,maxy,x,maxy);
- break;
- }
- setcolor(0);
- switch(type_button)
- {
- case 1 : BUTTON_OK(x,y,nom_buttom);
- break;
- case 2 : BUTTON_EXIT(x,y,nom_buttom);
- break;
- case 0 : outtextxy(x+20,y+((maxy-y)/2)-6,nom_buttom);
- break;
- }
- show();
- }
- //--------------------------------------------------------------------//
- void radiobutton(int x,int y,int cause)
- {
- hide();
- setcolor(15);
- for(int hj = 5 ; hj > -1 ; hj--)
- {
- circle(x,y,hj);
- }
- circle(x,y,4);
- circle(x,y,5);
- setcolor(0);
- arc(x,y,45,225,4);
- arc(x,y,45,225,5);
- switch(cause)
- {
- case PAINT : setcolor(15);
- for(int j=3;j!=-1;j--)
- {
- circle(x,y,j);
- }
- break;
- case CLICK : setcolor(0);
- for(int k=0;k!=2;k++)
- {
- circle(x,y,k);
- }
- break;
- }
- show();
- }
- //--------------------------------------------------------------------//
- void panel(int x,int y,int larg,int haut,int color)
- {
- hide();
- setfillstyle(1,color);
- bar(x,y,x+larg,y+haut);
- show();
- }
- //--------------------------------------------------------------------//
- void Warning(int x,int y,char *titre,char *message)
- {
- show();
- setfont(2,4);
- windows(x,y,300,120,titre);
- button("Ok",x+120,y+90,x+180,y+111,PAINT,mbOk);
- hide();
- setcolor(0);
- outtextxy(x+70,y+40,message);
- int x1=x+35,y1=y+45,x_centre=x+35,y_centre=y+55,rayon=25;
- setfillstyle(1,14);
- fillellipse(x1,y1,rayon,rayon);
- setcolor(0);
- circle(x+35,y+45,25);
- setfillstyle(1,0);
- fillellipse(x_centre,y_centre+5,4,4);
- setfillstyle(1,0);
- bar(x+31,y+24,x+38,y+51);
- show();
- while(1)
- {
- if(clic(x+120,y+90,x+180,y+111))
- {
- button("Ok",x+120,y+90,x+180,y+111,CLICK,mbOk);
- sound(570);
- delay(80);
- nosound();
- button("Ok",x+120,y+90,x+180,y+111,PAINT,mbOk);
- return;
- }
- }
- }
- //--------------------------------------------------------------------//
- void generator_aleatoire(int x,int y)
- {
- windows(x,y,250,80,"Initialisation ...");
- label("Initialiser Le Gen‚rateur Al‚atoire ...",x+10,y+15,0);
- text_edit(x+10,y+40,230,15);
- setfillstyle(1,4);
- for(int i = x+10 ; i <= x+240 ; i += 10)
- {
- hide();
- bar(x+10,y+41,i,y+54);
- show();
- delay(90);
- }
- for(i = 0 ; i < 10 ; i++)
- {
- List[i] = 0.0;
- }
- randomize();
- delay(150);
- return;
- }
- //--------------------------------------------------------------------//
- void saisie_aleatoire(int x,int y)
- {
- windows(x,y,270,100,"Nombre Al‚atoire ...");
- label("Saisie Le Nbre De Nombres Al‚atoire : ",x+15,y+12,0);
- text_edit(x+15,y+35,235,15);
- button("Ok",x+50,y+68,x+110,y+89,PAINT,mbOk);
- button("Cls",x+160,y+68,x+220,y+89,PAINT,mbExit);
- show();
- char car;
- char *mot = new char[2];
- int i = 1,cor_x = x+15,cor_y = y+37;
- nbre[0] = '\0';
- setcolor(4);
- while(1)
- {
- if(clic(x+50,y+68,x+110,y+89))
- {
- button("Ok",x+50,y+68,x+110,y+89,CLICK,mbOk);
- sound(550);
- delay(80);
- nosound();
- button("Ok",x+50,y+68,x+110,y+89,PAINT,mbOk);
- if(nbre[0] == '\0');
- else
- {
- for(int j = 0 ; j < 10 ; j++)
- {
- List[j] = (double) rand() / RAND_MAX;
- }
- return;
- }
- }
- if(clic(x+160,y+68,x+220,y+89))
- {
- button("Cls",x+160,y+68,x+220,y+89,CLICK,mbExit);
- sound(550);
- delay(80);
- nosound();
- button("Cls",x+160,y+68,x+220,y+89,PAINT,mbExit);
- text_edit(x+15,y+35,235,15);
- nbre[0] = '\0';
- cor_x = x+15;
- cor_y = y+37;
- i = 1;
- }
- ali : if(kbhit())
- {
- car = getch();
- if(!iscntrl(car) && isdigit(car))
- {
- setcolor(0);
- cor_x += 7;
- *(mot+0) = car;
- *(mot+1) = '\0';
- hide();
- outtextxy(cor_x,cor_y,mot);
- show();
- if(i == 1)
- {
- strcpy(nbre,mot);
- i++;
- }
- else
- {
- strcat(nbre,mot);
- }
- }
- else
- {
- car = 'a';
- }
- }
- }
- }
- //--------------------------------------------------------------------//
- void secteur_3D(int x,int y,double valeur)
- {
- hide();
- setcolor(0);
- int xy = y+13;
- for(int i = 13 ; i > 0 ; i--)
- {
- ellipse(x,xy,0,360,65,35);
- xy--;
- }
- setfillstyle(1,1);
- sector(x,y,0,360,65,35);
- setcolor(1);
- line(x,y,x+65,y);
- int val = valeur * 100;
- int angle = (int) (val * 360) / 100;
- if(angle < 0)
- {
- int k = -1 * angle;
- angle = k;
- }
- setfillstyle(1,4);
- sector(x,y,0,angle,65,35);
- setcolor(4);
- sector(x,y,0,angle,65,35);
- show();
- }
- //--------------------------------------------------------------------//
- int aleatoire_vide()
- {
- int fois = 0;
- for(int k = 0 ; k < 10 ; k++)
- {
- if(List[k] != 0)
- {
- fois++;
- }
- }
- return fois;
- }
- //--------------------------------------------------------------------//
- char * flaot_to_str(double val)
- {
- char *string,*virgule;
- int precision = 8,decimale,signe;
- strcpy(virgule,"0.");
- string = fcvt(val, precision, &decimale, &signe);
- strcat(virgule,string);
- return virgule;
- }
- //--------------------------------------------------------------------//
- void graphisme_aleatoire(int x,int y)
- {
- windows(x,y,300,210,"Graphisme ...");
- border(x+10,y+10,x+130,y+180);
- hide();
- setcolor(7);
- line(x+14,y+10,x+14+textwidth("Valeur")+6,y+10);
- line(x+14,y+11,x+14+textwidth("Valeur")+6,y+11);
- setcolor(1);
- outtextxy(x+14,y+6," Valeur ");
- show();
- border(x+140,y+10,x+290,y+180);
- hide();
- setcolor(7);
- line(x+144,y+10,x+144+textwidth("Graphe")+8,y+10);
- line(x+144,y+11,x+144+textwidth("Graphe")+8,y+11);
- setcolor(4);
- outtextxy(x+144,y+6," Graphe ");
- show();
- text_edit(x+20,y+20,100,150);
- button("Ok",x+230,y+185,x+290,y+206,PAINT,mbOk);
- panel(x+150,y+160,10,10,1);
- hide();
- setcolor(0);
- rectangle(x+150,y+160,x+160,y+170);
- show();
- panel(x+150,y+145,10,10,4);
- hide();
- setcolor(0);
- rectangle(x+150,y+145,x+160,y+155);
- show();
- label(" % Al‚atoire ...",x+165,y+145,0);
- label(" % Qui Reste ...",x+165,y+160,0);
- int var = y+22;
- char *string,*virgule;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- delay(120);
- }
- while(1)
- {
- if(clic(x+230,y+185,x+290,y+206))
- {
- button("Ok",x+230,y+185,x+290,y+206,CLICK,mbOk);
- sound(520);
- delay(80);
- nosound();
- button("Ok",x+230,y+185,x+290,y+206,PAINT,mbOk);
- return;
- }
- if(clic(x+20,y+20,x+120,y+35))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+21,99,14,1);
- label(flaot_to_str(List[0]),x+28,y+22,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[0]);
- }
- if(clic(x+20,y+35,x+120,y+50))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+36,99,14,1);
- label(flaot_to_str(List[1]),x+28,y+37,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[1]);
- }
- if(clic(x+20,y+50,x+120,y+65))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+51,99,14,1);
- label(flaot_to_str(List[2]),x+28,y+52,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[2]);
- }
- if(clic(x+20,y+65,x+120,y+80))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+66,99,14,1);
- label(flaot_to_str(List[3]),x+28,y+67,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[3]);
- }
- if(clic(x+20,y+80,x+120,y+95))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+81,99,14,1);
- label(flaot_to_str(List[4]),x+28,y+82,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[4]);
- }
- if(clic(x+20,y+95,x+120,y+110))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+97,99,14,1);
- label(flaot_to_str(List[5]),x+28,y+97,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[5]);
- }
- if(clic(x+20,y+110,x+120,y+125))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+111,99,14,1);
- label(flaot_to_str(List[6]),x+28,y+112,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[6]);
- }
- if(clic(x+20,y+125,x+120,y+140))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+126,99,14,1);
- label(flaot_to_str(List[7]),x+28,y+127,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[7]);
- }
- if(clic(x+20,y+140,x+120,y+155))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+141,99,14,1);
- label(flaot_to_str(List[8]),x+28,y+142,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[8]);
- }
- if(clic(x+20,y+155,x+120,y+170))
- {
- text_edit(x+20,y+20,100,150);
- var = y+22;
- for(int i = 0 ; i < 10 ; i++)
- {
- label(flaot_to_str(List[i]),x+28,var,0);
- var += 15;
- }
- panel(x+21,y+156,99,14,1);
- label(flaot_to_str(List[9]),x+28,y+157,15);
- panel(x+150,y+20,130,120,7);
- secteur_3D(x+215,y+70,List[9]);
- }
- }
- }
- //--------------------------------------------------------------------//
- void menu_principal(int x,int y)
- {
- page_arriere(3);
- windows(x,y,350,250,"Interface ...");
- panel(x,y+1,350,30,0);
- hide();
- setfillstyle(1,4);
- fillellipse(x,y-8,17,17);
- setcolor(4);
- circle(x,y-8,17);
- int xx = x-10,yy = y-17;
- setfillstyle(1,7);
- bar(xx,yy,xx+19,yy+16);
- setfillstyle(1,1);
- bar(xx,yy,xx+19,yy+4);
- setcolor(0);
- line(xx+19,yy+16,xx+19,yy);
- line(xx+19,yy+16,xx,yy+16);
- setcolor(15);
- line(xx,yy,xx+19,yy);
- line(xx,yy,xx,yy+16);
- show();
- label(" Menu Principal ...",x+5,y+10,11);
- panel(x,y+32,140,178,1);
- label(" Tp Modilisation ...",x+2,y+50,15);
- label(" Nombres Al‚atoire ",x+3,y+70,2);
- label(" R‚aliser Par : ",x+2,y+90,15);
- label(" Rebai Abdelhalim ",x+3,y+110,2);
- label(" Boulemdaisse Moncef ",x+2,y+130,2);
- label(" Groupe : ",x+2,y+150,15);
- label(" 6 , 7 ",x+70,y+150,2);
- panel(x,y+210,350,40,0);
- label("Disription De Services ... ",x+10,y+213,14);
- panel(x+145,y+35,70,15,6);
- setcolor(0);
- rectangle(x+145,y+35,x+145+70,y+35+15);
- label("Services : ",x+149,y+36,15);
- separator(x+220,y+42,120);
- separator(x+145,y+170,195);
- button("Ok",x+170,y+180,x+230,y+201,PAINT,1);
- button("Exit",x+260,y+180,x+320,y+201,PAINT,2);
- radiobutton(x+152,y+75,PAINT);
- label(" Initialisation ...",x+164,y+69,1);
- radiobutton(x+152,y+100,PAINT);
- label(" Nombre Al‚atoire ...",x+164,y+94,1);
- radiobutton(x+152,y+125,PAINT);
- label(" Graphisme Al‚atoire ...",x+164,y+119,1);
- radiobutton(x+152,y+150,PAINT);
- label(" Quitter L'Application ...",x+164,y+144,1);
- while(1)
- {
- if(clic(x+147,y+70,x+157,y+80))
- {
- choix_1 = 1;
- choix_2 = 0;
- choix_3 = 0;
- choix_4 = 0;
- signal = 1;
- radiobutton(x+152,y+75,CLICK);
- label(" Initialisation ...",x+164,y+69,4);
- label(" Nombre Al‚atoire ...",x+164,y+94,1);
- label(" Graphisme Al‚atoire ...",x+164,y+119,1);
- label(" Quitter L'Application ...",x+164,y+144,1);
- panel(x+5,y+226,330,17,0);
- label("Initialiser Le G‚nerateur De Nombres Psoudo Al‚atoire ...",x+10,y+230,11);
- radiobutton(x+152,y+100,PAINT);
- radiobutton(x+152,y+125,PAINT);
- radiobutton(x+152,y+150,PAINT);
- }
- if(clic(x+147,y+95,x+157,y+105))
- {
- choix_2 = 1;
- choix_1 = 0;
- choix_3 = 0;
- choix_4 = 0;
- radiobutton(x+152,y+100,CLICK);
- label(" Nombre Al‚atoire ...",x+164,y+94,4);
- label(" Initialisation ...",x+164,y+69,1);
- label(" Graphisme Al‚atoire ...",x+164,y+119,1);
- label(" Quitter L'Application ...",x+164,y+144,1);
- panel(x+5,y+226,330,17,0);
- label("Determiner Le Nbre Des Nombres Psoudo Al‚atoire ...",x+10,y+230,11);
- radiobutton(x+152,y+75,PAINT);
- radiobutton(x+152,y+125,PAINT);
- radiobutton(x+152,y+150,PAINT);
- }
- if(clic(x+147,y+120,x+157,y+130))
- {
- choix_2 = 0;
- choix_1 = 0;
- choix_3 = 1;
- choix_4 = 0;
- radiobutton(x+152,y+125,CLICK);
- label(" Nombre Al‚atoire ...",x+164,y+94,1);
- label(" Initialisation ...",x+164,y+69,1);
- label(" Graphisme Al‚atoire ...",x+164,y+119,4);
- label(" Quitter L'Application ...",x+164,y+144,1);
- panel(x+5,y+226,330,17,0);
- label("Repr‚sentation Graphique Pour Les Nombres Al‚atoire ...",x+10,y+230,11);
- radiobutton(x+152,y+75,PAINT);
- radiobutton(x+152,y+100,PAINT);
- radiobutton(x+152,y+150,PAINT);
- }
- if(clic(x+147,y+145,x+157,y+155))
- {
- choix_2 = 0;
- choix_1 = 0;
- choix_3 = 0;
- choix_4 = 1;
- radiobutton(x+152,y+150,CLICK);
- label(" Nombre Al‚atoire ...",x+164,y+94,1);
- label(" Initialisation ...",x+164,y+69,1);
- label(" Graphisme Al‚atoire ...",x+164,y+119,1);
- label(" Quitter L'Application ...",x+164,y+144,4);
- panel(x+5,y+226,330,17,0);
- label("Terminer L'Execution Du Programme ...",x+10,y+230,11);
- radiobutton(x+152,y+75,PAINT);
- radiobutton(x+152,y+100,PAINT);
- radiobutton(x+152,y+125,PAINT);
- }
- if(clic(x+260,y+180,x+320,y+201))
- {
- button("Exit",x+260,y+180,x+320,y+201,CLICK,2);
- sound(570);
- delay(80);
- nosound();
- button("Exit",x+260,y+180,x+320,y+201,PAINT,2);
- radiobutton(x+152,y+75,PAINT);
- radiobutton(x+152,y+100,PAINT);
- radiobutton(x+152,y+125,PAINT);
- radiobutton(x+152,y+150,PAINT);
- label(" Nombre Al‚atoire ...",x+164,y+94,1);
- label(" Initialisation ...",x+164,y+69,1);
- label(" Graphisme Al‚atoire ...",x+164,y+119,1);
- label(" Quitter L'Application ...",x+164,y+144,1);
- choix_1 = 0;
- choix_2 = 0;
- choix_3 = 0;
- choix_4 = 0;
- for(int hp = 0 ; hp < 10 ; hp++)
- {
- List[hp] = 0;
- }
- signal = 0;
- }
- if(clic(x+170,y+180,x+230,y+201))
- {
- button("Ok",x+170,y+180,x+230,y+201,CLICK,1);
- sound(570);
- delay(80);
- nosound();
- button("Ok",x+170,y+180,x+230,y+201,PAINT,1);
- if(choix_1)
- {
- generator_aleatoire(170,170);
- menu_principal(120,95);
- signal = 1;
- }
- if(choix_4)
- {
- for(int h = 0 ; h < 10 ; h++)
- {
- List[h] = 0;
- }
- signal = 0;
- exit(1);
- }
- if(choix_2 && signal == 1)
- {
- saisie_aleatoire(160,160);
- menu_principal(120,95);
- }
- if(choix_3 && aleatoire_vide() != 0)
- {
- graphisme_aleatoire(190,160);
- menu_principal(120,95);
- }
- }
- }
- }
- //--------------------------------------------------------------------//
- void Password(int x,int y)
- {
- page_arriere(0);
- windows(x,y,270,100,"S‚curite : Password");
- label("Le Mot De Passe Pour Continue : ",x+15,y+12,0);
- text_edit(x+15,y+35,235,15);
- button("Ok",x+50,y+68,x+110,y+89,PAINT,mbOk);
- button("Exit",x+160,y+68,x+220,y+89,PAINT,mbExit);
- show();
- char password[20],car;
- char *mot = new char[2];
- int i = 1,cor_x = x+20,cor_y = y+37;
- password[0] = '\0';
- setcolor(4);
- while(1)
- {
- if(clic(x+50,y+68,x+110,y+89))
- {
- button("Ok",x+50,y+68,x+110,y+89,CLICK,mbOk);
- sound(570);
- delay(80);
- nosound();
- button("Ok",x+50,y+68,x+110,y+89,PAINT,mbOk);
- if(strcmpi(password,"Algeria") == 0)
- {
- menu_principal(120,95);
- }
- else
- {
- text_edit(x+15,y+35,235,15);
- password[0] = '\0';
- cor_x = x+20;
- cor_y = y+37;
- goto ali;
- }
- }
- if(clic(x+160,y+68,x+220,y+89))
- {
- button("Exit",x+160,y+68,x+220,y+89,CLICK,mbExit);
- sound(570);
- delay(80);
- nosound();
- button("Exit",x+160,y+68,x+220,y+89,PAINT,mbExit);
- }
- ali : if(kbhit())
- {
- car = getch();
- if(!iscntrl(car))
- {
- setcolor(1);
- hide();
- outtextxy(cor_x,cor_y,"*");
- show();
- cor_x += 7;
- *(mot+0) = car;
- *(mot+1) = '\0';
- if(i == 1)
- {
- strcpy(password,mot);
- i++;
- }
- else
- {
- strcat(password,mot);
- }
- }
- }
- }
- }
- //--------------------------------------------------------------------//
- void intialisation()
- {
- choix_1 = 0;
- choix_2 = 0;
- choix_3 = 0;
- choix_4 = 0;
- signal = 0;
- nbre[0] = '\0';
- init_graph();
- show();
- setfont(2,4);
- }
- //--------------------------------------------------------------------//
- void main()
- {
- intialisation();
- Password(160,160);
- getch();
- }
- //-------------------------------------------------------------------//
