home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
291_01
/
jjbshow1.c
< prev
next >
Wrap
Text File
|
1989-06-28
|
10KB
|
195 lines
/***************************************************************************
* *
* JJBSHOW1.C *
* *
* Copyright (c) 1988, 1989, JJB. All rights reserved. *
* *
* This example shows Turbo C and Quick C programmers the basic concepts.*
* Just glance at it and move on to example JJBSHOW2.C. *
* *
* Turbo C is a trademark of Borland International, Inc. *
* Quick C is a trademark of Microsoft Corp. *
* JJB, 9236 church Rd suite 1082, Dallas, Tx 75231 (214) 341-1635 *
***************************************************************************/
/***************************************************************************
* For Turbo C programmers only: *
* To run this program from DOS: *
* *
* Enter 'TC JJBSHOW1' ( to load this file with Turbo C) *
* Press 'CTRL F9' ( to compile and begin executing) *
* *
***************************************************************************/
/***************************************************************************
* for Quick C programmers only: *
* To run this program, from DOS: *
* *
* Enter 'JJBQCS1' ( to load this file with JJB.QLB) *
* Press 'F5' ( to compile and begin executing) *
* *
* To make the .exe file JJBSHOW1.EXE, from DOS enter: *
* QCL /c /AM JJBSHOW1.C *
* LINK JJBSHOW1.OBJ + JJBQC.OBJ,,, C:LIB\, *
* *
***************************************************************************/
/***************************************************************************
* *
* for both TURBO C and QUICK C programmers: *
* *
* Not all options have been assigned functions. The options unassigned *
* execute the JJB copyright function. *
* *
* As JJB executes (runs) a program, the following keys can be pressed: *
* *
* ALT X to exit. *
* F1 to display a help screen. *
* F2-F9 to instantly select another option. *
* ALT to select a group of options. *
* ALT and a letter to select a specific group. *
* ESC means nevermind. *
* -> to select the group to the right. *
* <- to select the group to the left. *
* UPARROW to highlight the option above. *
* DOWNARROW to highlight the option below. *
* RETURN to select the option highlighted. *
* A LETTER to select a specific option. *
* ALT and a letter to select a different group. *
* ESC return exactly where you were in the function *
* currently being executed. *
* *
* If another option is selected, JJB will execute: *
* *
* the leave function for the current option. *
* the leave function for the current group. *
* the initalization function for the selected group. *
* the initalization function for the selected option. *
* and option function. *
* *
***************************************************************************/
/* see JJB-READ.DOC for an additional explanation of the functions below. */
#include <jjbset.h>
main()
{
jjb_initalize(); /* initalizes all JJB arrays & video */
jjb_setup(); /* setup options & assign functions */
jjb_start(); /* start executing the default option */
}
/***************************************************************************
* SAMPLE HELP FUNCTION *
***************************************************************************/
/* 'vfwc' puts out a window centered on the screen. */
vfwc(width,depth) int width,depth; { int row,col;
row = (25 - depth) / 2; /* compute row for making the window */
col = (80 - width) / 2; /* compute col for making the window */
vfw(row,col,width,depth); /* now make the window */
}
my_help() {
vsave_screen();
set_color(RED ONBLUE);
vfwc(38,7); /* 'vf' a window centered */
vfsdo(" ",SAME);
vfsdo("This example shows you how fast",SAME);
vfsdo("you can set up your options.",SAME);
vfsdo(" ",SAME);
vfsdo("Now move on to next show example.",SAME);
vfsdo(" ",SAME);
bright();
vfsc("Press any key "); getch();
normal();
vrest_screen();
}
/****************************************************************************
* *
* jjb_setup() *
* *
* jjb_setup() is where you define how your pull down menus will look *
* for for each group and option. *
* *
* This example shows you how to begin. *
* *
* The string descriptions have no meaning. *
* You may change them to any description you wish. *
* *
* Notice how easily you can assign function keys F2 thru F9. *
* *
* You may have up to 10 groups and 50 total options. *
* Any one group can have any number of options. *
* *
* 'group(' starts a new group of options. *
* 'option(' starts an option. *
* ' ' lets you specify any keypress for the options.