home *** CD-ROM | disk | FTP | other *** search
- /*----------------------------------------------------------------------*/
- /*
- Variables used:
- int myint;
- char mychar;
- float myfloat;
- char mystring[25+1];
- */
- /*----------------------------------------------------------------------*/
-
- void displayme(void)
- /* screen code generated by formgen using: stest */
- {
- bfore = YELLOW; textcolor(YELLOW);
- bback = BLACK; textbackground(BLACK);
- /* change next line from bclear() to savescreen() if you */
- /* want the form to pop up over existing background */
- bclear(0);
- bfore = WHITE; textcolor(WHITE);
- bback = BLUE; textbackground(BLUE);
- bwrite(0,20,4,"╔═══════════════════════════════════════╗");
- bwrite(0,20,5,"║ Integer: ║");
- bwrite(0,20,6,"║ Char: ║");
- bwrite(0,20,7,"║ Float: ║");
- bwrite(0,20,8,"║ String: ║");
- bwrite(0,20,9,"║ ║");
- bwrite(0,20,10,"║ This (short) version excludes the ║");
- bwrite(0,20,11,"║ editor-in-a-box to illustrate how ║");
- bwrite(0,20,12,"║ much space you can save by not having ║");
- bwrite(0,20,13,"║ to link in the ioed module. ║");
- bwrite(0,20,14,"╚═══════════════════════════════════════╝");
- bfore = YELLOW; textcolor(YELLOW);
- bback = BLACK; textbackground(BLACK);
- restorescreen(0);
- }
-
- /*----------------------------------------------------------------------*/
-
- void fillme()
- {
- bfore = BLUE; textcolor(BLUE);
- bback = LIGHTGRAY; textbackground(LIGHTGRAY);
- gotoxy(32,5); cprintf("%6d",myint);
- gotoxy(32,6); cprintf("%c",mychar);
- gotoxy(32,7); cprintf("%6.2d",myfloat);
- gotoxy(32,8); cprintf("%-25s",mystring);
-
- bfore = YELLOW; textcolor(YELLOW);
- bback = BLACK; textbackground(BLACK);
- }
-
- /*----------------------------------------------------------------------*/
-
- void editme()
- {
- int rcode,fieldnumber,col,xp,yp;
-
- bfore = BLUE; textcolor(BLUE);
- bback = LIGHTGRAY; textbackground(LIGHTGRAY);
- fieldnumber = 0;
- do {
- col = xp = yp = rcode = 0;
- switch (fieldnumber) {
- case 0:
- rcode = getint(32,5,&myint,6);
- break;
- case 1:
- rcode = getachar(32,6,&mychar);
- break;
- case 2:
- rcode = getfloat(32,7,&myfloat,6,2);
- break;
- case 3:
- rcode = getstring(32,8,&col,mystring,25);
- break;
- } /* switch fieldnumber */
-
- switch (rcode) {
- case 0:
- case 1:
- case 5:
- case 6:
- case 10:
- fieldnumber++;
- break;
- case 3:
- case 4:
- case 9:
- fieldnumber--;
- break;
- case 2:
- case 7:
- case 8:
- rcode = 8; /* exit loop */
- break;
- } /* switch rcode */
-
- if (fieldnumber<0) fieldnumber = 3;
- if (fieldnumber>3) fieldnumber = 0;
- } while (rcode != 8);
- bfore = YELLOW; textcolor(YELLOW);
- bback = BLACK; textbackground(BLACK);
- /* insert any special instructions here */
-
- }
-
-