i am pasting here one program of CG in C....plzz help me...the menu for alphabet is working properly but menu for digits is not displayed properly...i have to submit it in college and it is very urgent...plzzz help...please mail me on "[DELETED]@yahoo.com"
#include <graphics.h>
#include <math.h>
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
void func_exit();
void func_a();
void func_b();
void func_c();
void func_b();
void func_d();
void func_e();
void func_e();
void func_f();
void func_g();
void func_h();
void func_i();
void func_j();
void func_k();
void func_l();
void func_m();
void func_n();
void func_o();
void func_p();
void func_q();
void func_r();
void func_s();
void func_t();
void func_u();
void func_v();
void func_w();
void func_x();
void func_y();
void func_z();
void func_0();
void func_1();
void func_2();
void func_3();
void func_4();
void func_5();
void func_6();
void func_7();
void func_8();
void func_9();
void func_Square();
void func_circle();
void func_oval();
void func_polygon();
void func_hexagon();
void func_pentagon();
void func_rectangle();
void func_triangle();
enum ITEMTYPE
{
MI_PARENT, MI_ACTION
};
struct MENUITEM
{
enum ITEMTYPE type;
char *name;
char *helpstring;
void *p;
};
struct MENU
{
int vertical;
char *name;
int left;
int top;
int right;
int bottom;
int count;
struct MENUITEM **menuitemlist;
int curritem;
struct MENU *parent;
};
struct MENUITEM draw_a =
{
MI_ACTION, "A image", "A", (void*) func_a
};
struct MENUITEM draw_b =
{
MI_ACTION, "B image", "B", (void*) func_b
};
struct MENUITEM draw_c =
{
MI_ACTION, "C Image", "C", (void*) func_c
};
struct MENUITEM draw_d =
{
MI_ACTION, "D Image", "D", (void*) func_d
};
struct MENUITEM draw_e =
{
MI_ACTION, "E Image", "E", (void*) func_e
};
struct MENUITEM draw_f =
{
MI_ACTION, "F Image", "F", (void*) func_f
};
struct MENUITEM draw_g =
{
MI_ACTION, "G Image", "G", (void*) func_g
};
struct MENUITEM draw_h =
{
MI_ACTION, "H Image", "H", (void*) func_h
};
struct MENUITEM draw_i =
{
MI_ACTION, "I Image", "I", (void*) func_i
};
struct MENUITEM draw_j =
{
MI_ACTION, "J Image", "J", (void*) func_j
};
struct MENUITEM draw_k =
{
MI_ACTION, "K Image", "K", (void*) func_k
};
struct MENUITEM draw_l =
{
MI_ACTION, "L Image", "L", (void*) func_l
};
struct MENUITEM draw_m =
{
MI_ACTION, "M Image", "M", (void*) func_m
};
struct MENUITEM draw_n =
{
MI_ACTION, "N Image", "N", (void*) func_n
};
struct MENUITEM draw_o =
{
MI_ACTION, "O Image", "O", (void*) func_o
};
struct MENUITEM draw_p =
{
MI_ACTION, "P Image", "P", (void*) func_p
};
struct MENUITEM draw_q =
{
MI_ACTION, "Q Image", "Q", (void*) func_q
};
struct MENUITEM draw_r =
{
MI_ACTION, "R Image", "R", (void*) func_r
};
struct MENUITEM draw_s =
{
MI_ACTION, "S Image", "S", (void*) func_s
};
struct MENUITEM draw_t =
{
MI_ACTION, "T Image", "T", (void*) func_t
};
struct MENUITEM draw_u =
{
MI_ACTION, "U Image", "U", (void*) func_u
};
struct MENUITEM draw_v =
{
MI_ACTION, "V Image", "V", (void*) func_v
};
struct MENUITEM draw_w =
{
MI_ACTION, "W Image", "W", (void*) func_w
};
struct MENUITEM draw_x =
{
MI_ACTION, "X Image", "X", (void*) func_x
};
struct MENUITEM draw_y =
{
MI_ACTION, "Y Image", "Y", (void*) func_y
};
struct MENUITEM draw_z =
{
MI_ACTION, "Z Image", "Z", (void*) func_z
};
struct MENUITEM *draw_list[] =
{
&draw_a,&draw_b,&draw_c,&draw_d,&draw_e,&draw_f,&draw_g,
&draw_h,&draw_i,&draw_j,&draw_k,&draw_l,&draw_m,&draw_n,
&draw_o,&draw_p,&draw_q,&draw_r,&draw_s,&draw_t,&draw_u,
&draw_v,&draw_w,&draw_x,&draw_y,&draw_z
};
struct MENUITEM draw_0 =
{
MI_ACTION, "0 Image", "0", (void*) func_0
};
struct MENUITEM draw_1 =
{
MI_ACTION, "1 Image", "1", (void*) func_1
};
struct MENUITEM draw_2 =
{
MI_ACTION, "2 Image", "2", (void*) func_2
};
struct MENUITEM draw_3 =
{
MI_ACTION, "3 Image", "3", (void*) func_3
};
struct MENUITEM draw_4 =
{
MI_ACTION, "4 Image", "4", (void*) func_4
};
struct MENUITEM draw_5 =
{
MI_ACTION, "5 Image", "5", (void*) func_5
};
struct MENUITEM draw_6 =
{
MI_ACTION, "6 Image", "6", (void*) func_6
};
struct MENUITEM draw_7 =
{
MI_ACTION, "7 Image", "7", (void*) func_7
};
struct MENUITEM draw_8 =
{
MI_ACTION, "8 Image", "8", (void*) func_8
};
struct MENUITEM draw_9 =
{
MI_ACTION, "9 Image", "9", (void*) func_9
};
struct MENUITEM *draw_list1[] =
{
&draw_0,&draw_1,&draw_2,&draw_3,&draw_4,&draw_5,&draw_6,
&draw_7,&draw_8,&draw_9
};
struct MENUITEM draw_Square =
{
MI_ACTION, "Square Image", "Square", (void*) func_Square
};
struct MENUITEM draw_circle =
{
MI_ACTION, "Circle Image", "Circle", (void*) func_circle
};
struct MENUITEM draw_oval =
{
MI_ACTION, "Oval Image", "Oval", (void*) func_oval
};
struct MENUITEM draw_polygon =
{
MI_ACTION, "Polygon Image", "Polygon", (void*) func_polygon
};
struct MENUITEM draw_hexagon =
{
MI_ACTION, "Hexagon Image", "Hexagon", (void*) func_hexagon
};
struct MENUITEM draw_pentagon =
{
MI_ACTION, "Pentagon Image", "Pentagon", (void*) func_pentagon
};
struct MENUITEM draw_rectangle =
{
MI_ACTION, "Rectangle Image", "Rectangle", (void*) func_rectangle
};
struct MENUITEM draw_triangle =
{
MI_ACTION, "Triangle Image", "Triangle", (void*) func_triangle
};
struct MENUITEM *draw_list2[] =
{
&draw_Square,&draw_circle,&draw_oval,&draw_polygon,&draw_hexagon,
&draw_pentagon,&draw_rectangle,&draw_triangle
};
extern struct MENU menu_root;
struct MENU menu_draw =
{
1, "draw menu", 2, 21, 80, 335, sizeof(draw_list) / sizeof(draw_list[0]),
draw_list, 0, &menu_root
};
struct MENUITEM root_draw =
{
MI_PARENT, "Alphabets", "Enter to list options menu",
(void*) &menu_draw
};
struct MENU menu_draw1 =
{
1, "draw menu", 90, 21, 160, 150, sizeof(draw_list) / sizeof(draw_list[0]),
draw_list1, 0, &menu_root
};
struct MENUITEM root_digits =
{
MI_PARENT, "Digits", "Enter to list options menu",
(void*) &menu_draw1
};
struct MENU menu_draw2 =
{
1, "draw menu", 2, 21, 85, 90, sizeof(draw_list) / sizeof(draw_list[0]),
draw_list1, 0, &menu_root
};
struct MENUITEM root_shapes =
{
MI_PARENT, "Shapes", "Enter to list options menu",
(void*) &menu_draw2
};
struct MENUITEM root_exit =
{
MI_ACTION, "Exit", "Enter to exit from this application",
(void*) func_exit
};
struct MENUITEM *root_list[] =
{
&root_draw,&root_digits,&root_shapes,&root_exit
};
struct MENU menu_root =
{
0, "Main Menu", 2, 2, 260, 18, sizeof(root_list) / sizeof(root_list[0]), root_list, 0, NULL
};
struct WINDOW
{
int title;
char *name;
int left;
int top;
int right;
int bottom;
int color;
};
struct WINDOW title_window =
{
1, "Menu Design - 11MCA35 , 11MCA39", 0, 0, 639, 50, RED
};
struct WINDOW message_window =
{
0, "Message", 0, 415, 639, 479, GREEN
};
struct WINDOW menu_window =
{
0, "Menu Window", 0, 55, 230, 410, DARKGRAY
};
struct WINDOW menu_window2 =
{
0, "Menu Window", 0, 70, 200, 365, DARKGRAY
};
struct WINDOW user_window =
{
0, "User Window", 235, 55, 639, 410, LIGHTBLUE
};
void displaywindow(struct WINDOW *wp)
{
int w, h;
setcolor(WHITE);
setfillstyle(SOLID_FILL, wp->color);
bar(wp->left, wp->top, wp->right, wp->bottom);
rectangle(wp->left, wp->top, wp->right, wp->bottom);
if(wp->title == 1)
{
settextstyle(DEFAULT_FONT, HORIZ_DIR, 2);
w = wp->left + wp->right - textwidth(wp->name);
h = wp->top + wp->bottom - textheight(wp->name);
outtextxy(w / 2, h / 2, wp->name);
}
else
{
settextstyle(DEFAULT_FONT, HORIZ_DIR, 1);
rectangle(wp->left, wp->top, wp->right, wp->top + 15);
w = wp->left + wp->right - textwidth(wp->name);
outtextxy(w / 2, wp->top + 2, wp->name);
}
}
void displaymenu(struct MENU *mp)
{
int i = 0;
int x, y;
struct WINDOW *wp = &menu_window2;
setfillstyle(SOLID_FILL, wp->color);
setcolor(WHITE);
bar(wp->left + mp->left, wp->top + mp->top, wp->left + mp->right, wp->top + mp->bottom);
rectangle(wp->left + mp->left, wp->top + mp->top, wp->left + mp->right, wp->top + mp->bottom);
if(mp->vertical == 1)
{
x = wp->left + mp->left + 5;
y = wp->top + mp->top + 5;
for(i = 0; i < mp->count; i++)
{
if(i == mp->curritem)
{
setfillstyle(SOLID_FILL, WHITE);
bar(x - 2, y - 1, x + textwidth(mp->menuitemlist[i]->name), y + textheight(mp->menuitemlist[i]->name));
setcolor(wp->color);
outtextxy(x, y, mp->menuitemlist[i]->name);
y += textheight(mp->menuitemlist[i]->name);
y += 4;
setfillstyle(SOLID_FILL, wp->color);
setcolor(WHITE);
}
else
{
outtextxy(x, y, mp->menuitemlist[i]->name);
y += textheight(mp->menuitemlist[i]->name);
y += 4;
}
}
}
else
{
x = wp->left + mp->left + 5;
y = wp->top + mp->top + 5;
for(i = 0; i < mp->count; i++)
{
if(i == mp->curritem)
{
setfillstyle(SOLID_FILL, WHITE);
bar(x - 2, y - 1, x + textwidth(mp->menuitemlist[i]->name), y + textheight(mp->menuitemlist[i]->name));
setcolor(wp->color);
outtextxy(x, y, mp->menuitemlist[i]->name);
x += textwidth(mp->menuitemlist[i]->name);
x += 15;
setfillstyle(SOLID_FILL, wp->color);
setcolor(WHITE);
}
else
{
outtextxy(x, y, mp->menuitemlist[i]->name);
x += textwidth(mp->menuitemlist[i]->name);
x += 15;
}
}
}
}
#define LTARROW 0x4B
#define RTARROW 0x4D
#define UPARROW 0x48
#define DNARROW 0x50
#define CR 0x0d
#define ESC 0x1b
#define ALT_X 0x2d
struct MENU* handlekey(struct MENU *mp, int key)
{
void (*fp) (void) = NULL;
if( (key & 0x00FF) > 0)
key = key & 0x00FF;
else
key = (key & 0xFF00) >> 8;
displaywindow(&message_window);
switch(key)
{
case UPARROW:
{
if(mp->vertical == 1)
{
mp->curritem--;
if(mp->curritem < 0)
mp->curritem = 0;
}
break;
}
case DNARROW:
{
if(mp->vertical == 1)
{
mp->curritem++;
if(mp->curritem > mp->count - 1)
mp->curritem = mp->count - 1;
}
break;
}
case LTARROW:
{
if(mp->vertical == 0)
{
mp->curritem--;
if(mp->curritem < 0)
mp->curritem = 0;
}
break;
}
case RTARROW:
{
if(mp->vertical == 0)
{
mp->curritem++;
if(mp->curritem > mp->count - 1)
mp->curritem = mp->count - 1;
}
break;
}
case CR:
{
struct MENUITEM *itemp = mp->menuitemlist[mp->curritem];
if(itemp->type == MI_PARENT)
{
struct MENU *mp2 = (struct MENU*) itemp->p;
displaymenu(mp);
mp = mp2;
}
else if(itemp->type == MI_ACTION)
{
fp = (void (*) ()) itemp->p;
fp();
}
}
break;
case ESC:
{
if(mp->parent != NULL)
{
displaywindow(&menu_window);
mp = mp->parent;
}
}
break;
case ALT_X:
return NULL;
}
displaymenu(mp);
return mp;
}
void func_exit()
{
closegraph();
exit(0);
}
void func_a()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "A" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "A for Android" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_b()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "B" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "B for Blog" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_c()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "C" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "C for Cognizant" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_d()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "D" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "D for Dell" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_e()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "E" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "E for E-commerce" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_f()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "F" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "F for Facebook" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_g()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "G" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "G for Google" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_h()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "H" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "H for Hotmail" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_i()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "I" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "I for Intel" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_j()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "J" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "J for Java" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}
void func_k()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "K" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "K for keepvid" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_l()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "L" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "L for Lic" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}
void func_m()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "M" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "M for Mozilla" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_n()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "N" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "N for Nokia" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}
void func_o()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "O" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "O for Orkut" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}
void func_p()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "P" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "P for Photofunia" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}
void func_q()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "Q" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "Q for Qatar" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}
void func_r()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "R" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "R for Radiff" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel, Radhika Panchal" );
}
void func_s()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "S" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "S for Samsung" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_t()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "T" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "T for Twitter" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal " );
}
void func_u()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "U" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "U for Union" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_v()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "V" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "V for Vodafone" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_w()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "W" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "W for Windos" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_x()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "X" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "X for Xerox" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal " );
}
void func_y()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "Y" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "Y for Yahoo" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_z()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < maxradius; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "Z" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 130, user_window.top + 250, "Z for Zapak" );
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_0()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "0" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Zero");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_1()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "1" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "One");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_2()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "2" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Two");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_3()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "3" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Three");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_4()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "4" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Four");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_5()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "5" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Five");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_6()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "6" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Six");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_7()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "7" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Seven");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_8()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "8" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Eight");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_9()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "9" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Nine");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_Square()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
rectangle(150,50,20,20);
}
void func_rectangle()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "Rectangle" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "rectangle");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_circle()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "7" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Circle");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_oval()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "7" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "oval");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_polygon()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "7" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Polygon");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_hexagon()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "7" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Hexagon");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_pentagon()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "7" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "Pentagon");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void func_triangle()
{
struct WINDOW *wp = &user_window;
int i = 0;
int maxradius = ((wp->bottom - wp->top) / 2 - 15);
displaywindow(wp);
randomize();
for(i = 0; i < 9; i += 3)
{
settextstyle(GOTHIC_FONT, HORIZ_DIR,50);
setcolor(CGA_CYAN);
outtextxy(user_window.left + 150, user_window.top + 50, "7" );
settextstyle(SANS_SERIF_FONT, HORIZ_DIR,2);
outtextxy(user_window.left + 160, user_window.top + 230, "triangle");
delay(2);
}
displaywindow(&message_window);
outtextxy(message_window.left + 10, message_window.top + 30, "Created By : Himadri Patel , Radhika Panchal" );
}
void main()
{
int i, grd=DETECT, grm;
struct MENU *mp = &menu_root;
detectgraph(&grd,&grm);
initgraph(&grd, &grm, "C:\\tc\\bgi");
displaywindow(&title_window);
displaywindow(&message_window);
displaywindow(&menu_window);
displaywindow(&user_window);
displaymenu(mp);
while(!kbhit())
{
int key = bioskey(0);
mp = handlekey(mp, key);
if(mp == NULL)
break;
}
func_exit();
getch();
}
[edit]Code block added, Email address removed - OriginalGriff[/edit]