home *** CD-ROM | disk | FTP | other *** search
- #include <scl1.h>
- #include <scl1clor.h>
-
- /* Shows the use of Menu, MouseMenu and MouseMenu2 */
-
- struct MenuOpt Mainm[7]={/*Array of structures with 7 elements */
- 5,26,"Screen Related Functions ",'S', /* First option */
- 7,26,"Keyboard Handling Functions ",'K', /* Second option */
- 9,26,"Mouse Handling Functions ",'M', /* Third option */
- 11,26,"Program Flow Functions ",'P', /* Fourth option */
- 13,26,"File Handling Functions ",'F', /* Fifth option */
- 15,26,"Background and Miscellaneous",'B', /* Sixth option */
- 17,26,"Exit Demo ",'E', /* Seventh option */
- };
-
- main()
- {
- int Selection;
-
- Cls(WHITE_BLACK,CLS_ALL);
- Box(WHITE_BLACK,1,3,24,18,55); /* Box for menu */
- WriteScreen(WHITE_BLACK,3,38,"MENU"); /* Menu title */
-
- /* Menu */
-
- Selection=Menu(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,7,Mainm);
- Cls(WHITE_BLACK,CLS_ALL);
-
- if(Selection > 0)
- printf("You have selected option %i, press any key...\n",Selection);
- else
- printf("You have pressed ESCAPE, press any key...\n");
-
- GetKey();
- InitMouse(IM_SHOW);
-
- /* MouseMenu */
-
- Cls(WHITE_BLACK,CLS_ALL);
- Box(WHITE_BLACK,1,3,24,18,55); /* Box for menu */
- WriteScreen(WHITE_BLACK,3,35,"MOUSE MENU"); /* Menu title */
-
- Selection=MouseMenu(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,7,Mainm,24,55,3,18);
-
- Cls(WHITE_BLACK,CLS_ALL);
- if(Selection > 0)
- printf("You have selected option %i\n",Selection);
- else
- printf("You have pressed ESCAPE or clicked the mouse outside the menu area.\n");
- WaitKeyMouse();
-
- /* MouseMenu2 - with MouseMenu2 you can select the option that will be
- active when the menu first appears (last parameter) */
-
- Cls(WHITE_BLACK,CLS_ALL);
- Box(WHITE_BLACK,1,3,24,18,55); /* Box for menu */
- WriteScreen(WHITE_BLACK,3,35,"MOUSE MENU2 "); /* Menu title */
-
- Selection=MouseMenu2(WHITE_BLACK,BLACK_WHITE,WHITE_BLACK+HIGHLIGHT,7,Mainm,24,55,3,18,3);
-
- Cls(WHITE_BLACK,CLS_ALL);
- if(Selection > 0)
- printf("You have selected option %i\n",Selection);
- else
- printf("You have pressed ESCAPE or clicked the mouse outside the menu area.\n");
-
- }
-
-
-
-
-