home *** CD-ROM | disk | FTP | other *** search
- /*****************************
- * HP100LX WINDOW ENVIRONMENT *
- * Demo program *
- * August 3,1994 *
- * by: Harry Konstas *
- *****************************/
-
- #include "hpclib.h"
-
- /* Environment Variable declarations */
-
-
- TOPMESSAGE =" HP100LX Graphics Environment Example.";
-
- MENUBARMSG ="File Edit Search Quit Help ";
-
- MENUITEMS ={
-
- /* menu1 */ {"Load F2","Save F10"},
- /* menu2 */ {"Edit F3","Insert F4","Delete F5"},
- /* menu3 */ {"Quit F8"},
- /* menu4 */ {"Help F1","About"}};
-
- KEYLABELS={
-
- " Help Find Next Last "
- " All Edit Add Quit "
- " PgUp PgDn "};
-
-
- #include "hpwenv.c" /* remove when library is created */
-
-
- /* Demo program variable declarations */
-
- char message[]="The HP100LX palmtop is amazing!";
-
-
- /***************
- * MAIN PROGRAM *
- ***************/
-
- main()
-
- {
- int f,optnum;
-
- /* Initialisation */
-
- is100(); /* Is it an HP100LX? */
- setgra(); /* Set graphics mode */
- announ(AN_LEFT); /* place announciators left */
- toplin(topmes); /* Create top line */
- botlin(botmes); /* Create bottom (key-label) line */
- setfon(LARGE_FONT); /* set text to large font */
-
- wrtext(65,20,"Welcome to the HP100LX palmtop.");
-
- line(0,35,639,35); /* draw a line */
- setfon(SMALL_FONT); /* set text to small font */
-
- for (f=0;f<12;f++)
- {
- wrtext(20,40+(f*12),message);
- wrtext(360,40+(f*12),message);
- }
-
-
- /* Demo starts here */
-
- open_win(1,50,50,450,120,"Demo window"); /* open window#1 */
- wrtext(140,80,"You can open windows..."); /* write message in window */
-
- sleep(3); /* wait 5 seconds */
-
- open_win(2,80,80,330,180,"Window #2"); /* open window#2 */
- wrtext(90,120,"You can also do menus"); /* write message in window */
-
- sleep(3); /* wait 5 seconds */
-
- close_win(2); /* close window #2 */
- click(); /* click + delay */
- close_win(1); /* close window #2 */
- click();
-
- open_mbar(); /* open menu bar */
- sleep(1);
-
- sel_menu(1); /* select menu #1 */
- click();
- sel_menu(1); /* unselect menu #1 */
-
- sel_menu(2); /* select menu #2 */
- optnum=open_menu(2); /* open menu #2 */
- /* optnum=#of items in menu */
-
- sel_opt(1); /* select 1st item in menu */
- click(); /* just a click + delay */
- sel_opt(1); /* unselect 1st item */
-
- sel_opt(2); /* select 2nd item in menu */
- click(); /* click + delay */
- sel_opt(2); /* unselect 2nd item */
-
- sel_opt(3); /* select 3rd item in menu */
- click(); /* click + delay */
- sel_opt(3); /* unselect 3rd item */
-
- close_menu(); /* close menu */
- click(); /* click + delay */
- close_mbar(); /* close menu bar */
- click();
-
- errwin("That's all! Press a key."); /* error window demo */
-
-
- sleep(1);
- announ(AN_RIGHT); /* Place announciators right */
- setmda(); /* Set screen mode to text mode */
- exit(0); /* Exit program */
- }
-
-
- /***************
- * WINDOW CLICK * < Used to slow things down...
- ***************/
-
- click()
-
- {
- sound(30,1);
- sleep(1);
- }
-
-