home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / c / objease3 / docs / objeas30.doc < prev    next >
Encoding:
Text File  |  1994-05-18  |  140.2 KB  |  4,834 lines

  1.                             ObjectEase 3.0
  2.               (c) Copyright 1992,94 - David S. Reinhart
  3.                  1004 Marticville Rd.Pequea, PA 17565
  4.                            (717) 284-3736
  5.                             CIS 71572,304
  6.  
  7.  
  8.  
  9.  
  10. What Is ObjectEase?  
  11.  
  12.     ObjectEase is a set of libraries designed to work specifically with
  13. Borland(c) C++ compilers which will allow you, the programmer, to EASILY 
  14. incorporate user interface objects into your programs, saving you a 
  15. tremendous amount of coding time, and giving your programs a more 
  16. professional appearance.  
  17.  
  18.     ObjectEase libraries are broken into two groups...  a library for TEXT
  19. mode interfaces, and a separate library for GRAPHICS based interfaces.  The
  20. libraries are supplied in only the LARGE memory model.  If you need to use 
  21. these libraries in programs compiled under another memory model, then you 
  22. have two choices.  First, you can recompile your entire project under the 
  23. large memory model which will allow you to link with the ObjectEase 
  24. libraries.  Second, if your program must remain in another memory model, 
  25. you must purchase the source code for the ObjectEase libraries, and 
  26. recompile the source under the desired memory model.  Prices for the source 
  27. code are listed in the REGISTER.DOC file, included with this package.  
  28.  
  29.  
  30. The ObjectEase Philosophy 
  31.  
  32.     This is the third release of the ObjectEase libraries.  I have taken 
  33. the suggestions of registered users, along with my own ideas for expansion
  34. of the libraries, and combined them into what I feel is a fantastic bargain
  35. in high quality C++ libraries.  
  36.  
  37.     So how come you can register my libraries for such a low price when
  38. comparable commercial libraries cost hundreds of dollars?  Well, partly 
  39. because I am the only programmer involved in the creation of these 
  40. libraries.  I am not dependent on their income to pay other employees, only 
  41. to supplement my own income.  Also, it is because these libraries are 
  42. generic...  what I mean is...well it's like this.  You can use a button 
  43. object in your graphics application.  It performance is all you really need 
  44. right out of the library.  But, if you want to say...  change the font on 
  45. the buttons, you need to purchase the source and make the change yourself.  
  46. This was done on purpose.  I have provided high quality, easily used 
  47. classes.  They are very flexible as is, but if you want the utmost in 
  48. flexibility, then spend the few extra dollars and purchase the source.  
  49. That way, you can make whatever modifications you desire.  I'm sure you'll 
  50. agree that the prices for the source modules are also quite reasonable.  
  51.  
  52.  
  53. What's new in ObjectEase 3.0 
  54.  
  55.     Good question...I'm glad you asked.  Just about everything.  Firstly,
  56. each class has been coded in its own separate source module.  What this
  57. means for you is smaller .EXE files. In v2.0 there was only one source
  58. module for the entire library.  Therefore, when you linked in the library,
  59. you linked in the ENTIRE library, not just the parts that your program
  60. used.  I see this as a shortcoming in Borland's linker, but at any rate it
  61. won't happen anymore.  Only the code for the classes you actually use in
  62. your program will be linked into the executable.  
  63.  
  64.     There have been enhancements to just about all of the existing classes
  65. from v2.0.  Things that you used to have to purchase source to do can now 
  66. be done with the distributed version of the libraries.  Some classes, menus
  67. in particular have been completely recoded.  Menus are now MUCH easier to
  68. use for both the programmer, and the end user.  The old menu classes have
  69. still been included in the code for compatibility, but you'll want to use
  70. the new menu classes in any new projects.  
  71.  
  72.     New classes in both the TEXT and GRAPHICS versions of the libraries
  73. include:  
  74.  
  75.     - SCROLL BARS
  76.     - LIST BOXES
  77.     - DIRECTORY BOXES
  78.     - MESSAGE BOXES
  79.     - PCX FILE DISPLAYING (graphics only)
  80.     - NEW MENU CLASSES
  81.     - WINDOWS (in graphics mode, similar to a commercial product
  82.                 you'll recognize)
  83.  
  84. There's more, I'm sure, but thoughts escape me at the moment...  
  85.  
  86.     By the way, the video bios library has NOT changed since the last
  87. version, mostly because I have not needed to do anything new with this
  88. portion of the code for my own purposes.  
  89.  
  90.  
  91. THANK YOU's 
  92.  
  93.     I would most certainly like to thank all of you who have become
  94. registered users of versions 1.0 and 2.0 of the ObjectEase libraries.
  95. Without you and your support there would not be a version 3.0.  I really
  96. had no idea how many people might register this software with me when I
  97. first began distributing via the shareware method, but the response has far
  98. exceeded and expectations I might have had.  Thank you all!
  99.  
  100.     I would also like to thank my wife, Lynn, who has put up with me
  101. spending countless hours typing computer gibberish into my PC while she and
  102. the children tried to go about life in a normal manner.  Thank you Lynn,
  103. Kenny, and Amanda.  Without you and your support this project would not
  104. have reached completion.  
  105.  
  106.  
  107.  
  108.  
  109. On to the good stuff...  
  110.  
  111.     This manual is broken into three parts.  The first part describes the
  112. classes in the TUI library.  The second part describes the GUI library, and 
  113. finally the VIDBIOS library is described in part three.  
  114.  
  115.     If you can't seem to grasp the meaning of a particular function from
  116. this documentation, try looking at the sample code.  If all else fails, 
  117. feel free to give me a call.  I'll give a limited amount of phone support 
  118. to unregistered users.
  119.  
  120.  
  121.                         
  122.  
  123.  
  124.  
  125.                          TUI library reference
  126.  
  127.     The TUI.LIB library provides a complete set of TEXT mode user interface
  128. objects, as well as some supplemental functions that you'll find most 
  129. useful.  The classes are described in the following section, with the 
  130. standalone function calls being described first.  
  131.  
  132.  
  133. Standalone Function Calls 
  134.  
  135. void vprintat(int col,int row,int fore,int back,char *,...); 
  136.  
  137.     This functions works very similarly to the standard prinf function,
  138.     however, it writes directly to video memory, making output extremely
  139.     fast. The col and row parameters specify the starting position of the
  140.     string, and the fore and back parameters represent the colors in which
  141.     the string will be output.
  142.      
  143.     example:    int d=100;
  144.                 vprintat(1,1,14,0,"%d",d);
  145.      
  146. void vprintc(int row,int fore,int back,char *,...); 
  147.  
  148.     This function is that same as vprintat, however, it centers the text on
  149.     the row provided in the row parameter.
  150.      
  151.     example:    char name[10];
  152.                 strcpy(name."David");
  153.                 vprintc(1,14,0,"%s",name);
  154.      
  155.  
  156. void printat(int col,int row,int fore,int back,char *); 
  157.  
  158.     This function is also like vprintat, however, no formatting is done.
  159.     Only strings can be provided in the char * parameter.
  160.      
  161.     example:    printat(1,1,14,0,"Sample Text");
  162.      
  163. void printc(int row,int fore,int back,char *); 
  164.  
  165.     This function is similar to vprintc, however, no formatting is 
  166.     provided. Only strings can be provided in the char * parameter.  The
  167.     text is centered in the specified row.
  168.      
  169.     example:    printc(1,14,0,"Centered Text");
  170.                 void cprintat(int col,int row,int fore,int back,char *,...)
  171.  
  172.  
  173.     This function works the same as vprintat.  It provides formatting, and
  174.     additionally, it moves the cursor to the position at the end of the
  175.     string.
  176.      
  177.     example:    cprintat(1,1,14,0,"Cusrsor is at the end");
  178.      
  179. void cprintc(int row,int fore,int back,char *,...); 
  180.  
  181.     Same as cprintat, however, text is centered on the specified row.
  182.      
  183.     example:    cprintc(1,14,0,"Centered text");
  184.      
  185. void clear(char ch,int fore,int back); 
  186.  
  187.     This function fills the screen with the specified char in the specified
  188.     colors.
  189.      
  190.     example:    clear(176,14,4);
  191.      
  192. void cursoron(); 
  193.  
  194.     Turns the text mode cursor on.
  195.      
  196.     example:    cursoron();
  197.      
  198. void cursoroff(); 
  199.  
  200.     Turns the text mode cursor off.
  201.      
  202.     example:    cursoroff();
  203.      
  204. void settext(int fore,int back); 
  205.  
  206.     Sets the text output to the specified colors.  This is the same as
  207.     calling both the textcolor and textbackground functions with the
  208.     appropriate parameters.
  209.      
  210.     example:    SetText(7,0);
  211.      
  212. void chsattr(int fore,int back); 
  213.  
  214.     This function changes the foreground and background attributes of the
  215.     entire screen.  EVERYTHING on the screen will be displayed in these
  216.     colors after this call.
  217.      
  218.     example:    chsattr(7,0);
  219.      
  220. void chcattr(int col,int row,int length,int fore,int back); 
  221.  
  222.     This function changes length characters starting at col,row to the
  223.     specified foreground and background colors.  This function is used by
  224.     the library for such things as moving menu bars highlights (old style
  225.     menus only).
  226.      
  227.     example:    chcattr(1,1,80,14,0);
  228.      
  229. void dlay(int ticks); 
  230.  
  231.     This is an alternative to the delay() function.  The ticks parameter
  232.     represents timer ticks which occur normally at 18.2 times/second.
  233.      
  234.     example:    dlay(9); //delays 1/2 second
  235.      
  236. long getticks(); 
  237.  
  238.     This function return a long value which represents the current time in
  239.     timer ticks.  This value starts at 0 each midnight and increments
  240.     throughout the day.
  241.      
  242.     example:    long currticks;
  243.                 currticks=getticks();
  244.      
  245. int altkey(); 
  246.  
  247.     This function returns 1 if the ALT key is pressed at the time of the
  248.     function call, 0 otherwise.
  249.      
  250.     example:    if(altkey()) { 
  251.                 ...
  252.                  }
  253.      
  254. int ctrlkey(); 
  255.  
  256.     This function returns 1 if the CTRL key is pressed at the time of the
  257.     function call, 0 otherwise.
  258.      
  259.     example:    if(ctrlkey()) {
  260.                 ...
  261.                  }
  262.      
  263. int lshiftkey(); 
  264.  
  265.     This function returns 1 if the LEFT SHIFT key is pressed at the time of
  266.     the function call, 0 otherwise.
  267.      
  268.     example:    if(lshiftkey()) {
  269.                 ...
  270.                  }
  271.  
  272. int rshiftkey();
  273.  
  274.     This function returns 1 if the RIGHT SHIFT key is pressed at the time 
  275.     of the function call, 0 otherwise.
  276.      
  277.     example:    if(rshiftkey()) {
  278.                 ...
  279.                  }
  280.  
  281.      
  282. void flushkeys(); 
  283.  
  284.     This function clears the typeahead buffer
  285.      
  286.     example:    flushkeys();
  287.      
  288. unsigned char getvidmode(); 
  289.  
  290.     The return value of this function represents the current video mode. 
  291.     It can be compared with the Borland defined constants C40, C80, etc...
  292.      
  293.     example:    unsigned char vidmode;
  294.                 vidmode=getvidmode();
  295.      
  296. unsigned char alt_to_asc(unsigned char); 
  297.  
  298.     Use this function if you are checking for certain ALT key/character
  299.     combinations.  It will return one of the values defined at the top of
  300.     the TUI.h header file...ALTA through ALT0.
  301.      
  302.     example:    ch=getch();
  303.                 ch=alt_to_asc(ch);
  304.                 switch(ch) { 
  305.                 ...
  306.                  }
  307.  
  308. void smover(int row,int startpos,int endpos,int fgd,int bgd,char *string);
  309.     
  310.     This function causes the text string specified by string to move across
  311.     the screen starting at startpos and ending at endpos on row row, and in
  312.     the specified foreground and background colors.
  313.  
  314.     example:    smover(1,1,72,15,0,">>---->");
  315.  
  316.     This example moves the string >>----> from 1 to 72 on row 1.
  317.  
  318. void smovel(int row,int startpos,int endpos,int fgd,int bgd,char *string); 
  319.  
  320.     Same as smover, however the string is moved to the left rather than to
  321.     the right.
  322.  
  323. void smoveu(int col,int startpos,int endpos,int fgd,int bgd,char *string); 
  324.     
  325.     Same as smover, however the string is moved upward in the column
  326.     specied by col.
  327.  
  328. void smoved(int col,int startpos,int endpos,int fgd,int bgd,char *string); 
  329.  
  330.     Same as smoveu, however, the string is moved downward rather than
  331.     upward in the specified column.
  332.  
  333.  
  334.  
  335.  
  336.      
  337.                             Mcursor
  338.  
  339.  
  340.     The following data and functions are all part of the Mcursor
  341. class, which handles mouse functionality in both the text and graphics 
  342. modes.  Certain mouse functions are different, however, in the different 
  343. video modes.  
  344.  
  345. Global Variables 
  346.  
  347.     _MX An integer value representing the current x value of the mouse.
  348. This varible is updated with every call to get_status().  The LBP() and
  349. RBP() function call call get_status().
  350.  
  351.     _MY An integer value representing the current y value of the mouse.
  352. This varible is updated with every call to get_status().  The LBP() and
  353. RBP() function call call get_status().
  354.  
  355.     Using the above variable to get the mouse position can improve program
  356. performance because a function call is not necessary to retrive these 
  357. values.  
  358.  
  359. void far mhandler(); 
  360.     This is the interrupt handler for the mouse which allows
  361.     capturing such mouse events as double clicks.                
  362.  
  363. MCursor the_mouse 
  364.     Since the mouse is used by other classes a global MCursor
  365.     variable is defined in the library.  To use the mouse in your
  366.     programs simply declare "extern Mcursor the_mouse" at the top of
  367.     your source module(s). 
  368.  
  369.  
  370. Members - PRIVATE 
  371.  
  372. int shown
  373.     Indicates whether the mouse cursor is currently visible or not.
  374.  
  375. int xpos
  376.     The current x position of the mouse cursor.
  377.  
  378. int ypos
  379.     The current y position of the mouse cursor.
  380.  
  381. void mouse_interrupt();
  382.     The current procedure acting as the mouse handler.
  383.  
  384. int m1
  385.     Used as the AX register variable in mouse calls.
  386.  
  387. int m2
  388.     Used as the BX register variable in mouse calls.
  389.  
  390. int m3
  391.     Used as the CX register variable in mouse calls.
  392.  
  393. int m4
  394.     Used as the DX register variable in mouse calls.
  395.  
  396. int button
  397.     Represents the button being pressed or tested, left or right.
  398.  
  399. int count
  400.     Keeps track of the number of times a button has been pressed.
  401.  
  402. int disabled
  403.     If this variable is 1 the mouse cannot be shown.
  404.  
  405. int handler_installed
  406.     This value is 1 if the mouse handler has been installed, 0 if not.
  407.  
  408. int eventmask
  409.     Specifies which events the mouse handler captures.  By
  410.     default only left mouse button presses are captured.
  411.  
  412. void ClearHandler()
  413.     This function disables the mouse handler.
  414.  
  415. void InstallHandler()
  416.     This function installs the mouse handler.  The mouse handler is
  417.     installed by default by the arm() function.
  418.  
  419. Members - PUBLIC 
  420.  
  421. Mcursor()
  422.     The default constructor.
  423.  
  424. ~Mcursor()
  425.     The default destructor.
  426.  
  427. int init()
  428.     Call to initialize the mouse at the beginning of your program. If the
  429.     return value is 0, there is no mouse present.
  430.  
  431.     example:    extern Mcursor the_mouse;
  432.                 int mouse_present;
  433.                 mouse_present=the_mouse.init();
  434.  
  435. void get_status()
  436.     This function returns the current state of the mouse buttons.  It is
  437.     not normally called by the programmer.
  438.  
  439. void show() 
  440.     This function makes the mouse cursor visible if it has not been
  441.     disabled by a call to unarm();
  442.  
  443. void hide()
  444.     This function makes the mouse cursor invisible.
  445.  
  446. void set_hor_bounds(int min,int max)
  447.     This function sets the bounds of mouse movement on the x axis.  The
  448.     min value represents the left boundary of mouse movement, and the max
  449.     value represents the right boundary.
  450.  
  451. void set_ver_bounds(int min,int max)
  452.     This function sets the bounds of mouse movement on the y axis.  The
  453.     min value represents the top boundary of mouse movement, and the max
  454.     value represents the bottom boundary.
  455.  
  456. void conditional_off(int x1,int y1,int x2,int y2)
  457.     This function makes the mouse cursor invisible when it is in the
  458.     rectangle bounded by x1,y1,x2,y2.
  459.  
  460. void position(int x,int y) 
  461.     This function moves the mouse cursor to the screen position defined in
  462.     x,y.
  463.  
  464. int LBP()
  465.     Returns 1 if the left mouse button is currently pressed, 0 otherwise.
  466.  
  467. int RBP()
  468.     Returns 1 if the right mouse button is currently pressed, 0 otherwise.
  469.  
  470. int mousex()
  471.     This function returns the current x coordinate of the mouse cursor.
  472.     Use the global value _MX to avoid this function call.
  473.  
  474. int mousey()
  475.     This function returns the current y coordinate of the mouse cursor.
  476.     Use the global value _MY to avoid this function call.
  477.  
  478. int mx()
  479.     Same as mousex().
  480.  
  481. int my()
  482.     Same as mousey().
  483.  
  484. void unarm()
  485.     This function turns makes the mouse cursor invisible and does not 
  486.     allow it to be re-shown by the show() call.  To re-show the cursor
  487.     you must call arm().
  488.  
  489. void arm()
  490.     This function shows the mouse cursor and allows future calls to show()
  491.     to do the same.
  492.  
  493. int LBDCLK()
  494.     This function returns 1 if the left mouse button has been double
  495.     clicked, 0 otherwise.  The left mouse button must be pressed twice
  496.     within 1/2 second (9 timer ticks) for LBDCLK to return 1.
  497.  
  498. long thistick
  499.     Represents the current timer tick at the time of the mouse event.  Not
  500.     normally used by the programmer.
  501.  
  502. long prevtick
  503.     Represents the timer tick at the time of the previous mouse event. 
  504.     Not normally used by the programmer.
  505.  
  506. int doubleclicked 
  507.     This value is checked by the LBDCLK() function.  It is set by the 
  508.     mouse handler.  Not normally used by the programmer.
  509.  
  510.  
  511.  
  512.  
  513.                             Twindow
  514.  
  515.     The following functions and data members comprise the Twindow class.
  516. The Twindow is used for creating popup windows on the text screen.  All 
  517. underlying screen elements are saved in a buffer which is later redisplayed 
  518. when, and if, the Twindow object is removed from the screen.  
  519.  
  520. Members - PRIVATE 
  521.  
  522. int x
  523.     The left x screen coordinate of the window.
  524.  
  525. int y
  526.     The top y screen coordinate of the window.
  527.  
  528. int x1
  529.     The right x coordinate of the window.
  530.  
  531. int y1
  532.     The bottom y coordinate of the window.
  533.  
  534. int fgd
  535.     The color to be used for the foreground of the window.  Borders and
  536.     titles are drawn in the foreground color.
  537.  
  538. int bgd
  539.     The color to be used for the window background.
  540.  
  541. int shad 
  542.     If this value is non-zero the window will have a shadow cast under it
  543.     and to one side.  The shaddirection member variable indicate to
  544.     which side the shadow will be cast.
  545.  
  546. int shadcolor
  547.     The color in which any text within the shadow area will be displayed.
  548.  
  549. int size
  550.     The size of the buffer required to hold the underlying screen image.
  551.  
  552. char id[15]
  553.     The title to be displayed on the window.
  554.  
  555. int existtitle
  556.     This variable is non-zero if the window has a title.
  557.  
  558. int bordertype
  559.     This variable represents the border style of the window.
  560.     Use the global defines SINGLE and DOUBLE for this comparison.
  561.  
  562. int shown
  563.     This variable is non-zero if the window is currently displayed on the
  564.     screen.
  565.  
  566. unsigned char *save
  567.     This is the pointer to the buffer in which underlying screen data is
  568.     saved.
  569.  
  570. Members - PUBLIC 
  571.  
  572. Twindow();
  573.     The default constructor.
  574.  
  575. ~Twindow();
  576.     The default destructor.  The destructor will free any associated 
  577.     memory before destroying the object.
  578.  
  579. void getstyle();
  580.     This function is used internally by the class to determine which
  581.     character shapes to use to display the window border.
  582.  
  583. void init(int xpos,int ypos,int x1pos,int y1pos,int fore,int back,int
  584.             shadow,int shadowcolor,int shadowdir=0);
  585.  
  586.     This function must be called after declaring a variable of type 
  587. Twindow to initialize the object.  The window positions and colors a
  588. specified in this call.  Specifying a value of 1 for the shadow parameter
  589. will cause the window to be displayed with a shadow.  The shadowcolor
  590. parameter specified the color of any text which falls within the shadow
  591. area.  The shadowdir parameter specifies the direction in which the shadow
  592. will fall.  This parameter does not need to be specified and will default
  593. to a shadow falling on the left side of the window.  To cause the shadow
  594. to fall to the right side of the window, specify a 1 for this value.
  595.  
  596.     example:    Twindow theWindow;
  597.                 theWindow.init(10,10,71,20,14,4,1,8,1);
  598.  
  599.     This example initializes a window with an upper left coordinate of
  600.     10,10,and a lower right coordinate of 71,20.  The foreground color is
  601.     yellow(14) on a background of red(4).  It will have a shadow with text
  602.     falling in the shadow displayed as dark gray(8).  The shadow will be
  603.     cast to the right.
  604.  
  605. void border();
  606.     Causes the border of the window to be (re)drawn.
  607.  
  608. void setborder(int style);
  609.     Use this function to specify the border style, SINGLE or DOUBLE) 
  610.     before calling the show() member function.  Use the global defines
  611.     SINGLE and DOUBLE for the style parameter.
  612.  
  613. int getborder()
  614.     Returns the current border style, SINGLE or DOUBLE.  Use the global
  615.     defines SINGLE and DOUBLE for this comparison.
  616.  
  617. void cfgd(int fore);
  618.     Use this function to change the foreground color of the window.  The
  619.     border() function must be called to redraw the border in the new color.
  620.     The fore parameter represents the color to change to.
  621.  
  622. void cbgd(int back);
  623.     Use this function to change the background color of the window.  The
  624.     fill() function must be called to redraw the background in the new
  625.     color.  The back parameter represents the color tochange to.
  626.  
  627. int getfgd();
  628.     Returns the current foreground color.
  629.  
  630. int getbgd()
  631.     Returns the current background color.
  632.  
  633. void fill();
  634.     Causes the interior of the window to be drawn.  This function
  635.     can be called to clear a widow which has been filled with text.
  636.  
  637. void divider(int direction,int style,int offset);
  638.     Causes a divider to be drawn across the window.  Use the global 
  639.     defines HOR and VER for the direction parameter.  Use the global
  640.     defines SINGLE and DOUBLE for the style parameter.  offset represents
  641.     the distance from the top or left of the window to place the divider.
  642.  
  643. void show(); 
  644.     Displays the window on the screen.
  645.  
  646. void zoom();
  647.     Use instead of the show() function to cause the window to be zoomed
  648.     horizontally onto the screen.
  649.  
  650. void hide();
  651.     Use this function to remove the window from the screen.  The memory
  652.     used to hold the underlying screen image is not freed by a call to
  653.     hide().
  654.  
  655. void elim();
  656.     This function frees the memory associated with the window. The default
  657.     destructor calls elim() to free this memory before destroying
  658.     the Twindow object.
  659.  
  660. void title(char[15]);
  661.     This function specifies a title to be placed on the top border of the
  662.     window.  The title is limited to 14 chars.
  663.  
  664. int istitle();
  665.     Returns non-zero if the window has a title.
  666.  
  667. int isshown()
  668.     Returns non-zero if the window is currently displayed on the screen.
  669.  
  670. int isx();
  671.     Returns the left x coordinate of the window.
  672.  
  673. int isy();
  674.     Returns the top y coordinate of the window.
  675.  
  676. int isx1();
  677.     Returns the right x coordinate of the window.
  678.  
  679. int isy1();
  680.     Returns the bottom y coordinate of the window.
  681.  
  682. int issize();
  683.     Returns the size of the buffer required for holding the underlying
  684.     screen image.
  685.  
  686. void wprintat(int x,int y,int fgd,int bgd,char *text);
  687.     This function prints the text parameter at coordinates x,y, relative
  688.     to the upper left Twindow coordinate using the respective fgd and bgd
  689.     colors.
  690.  
  691. void wprintc(int y,int fgd,int bgd,char *text);
  692.     This function prints the text parameter on row y, respective to the 
  693.     top of the Twindow, in the specified fgd and bgd colors.
  694.  
  695. int hit();
  696.     This function returns non-zero if the mouse cursor is currently within
  697.     the bounds of the Twindow object.
  698.  
  699.  
  700.  
  701.                             TMENU
  702.  
  703.     The Tmenu class has been retained in version 3.0 of the ObjectEase
  704. libraries for compatibility only.  A new menu class, called simply 'menu', 
  705. has been developed and should be used for all menuing purposes because of 
  706. its greatly enhanced functionality, and ease of use for both the programmer 
  707. and the end user.  
  708.  
  709.     Class Tmenu is inherited from Twindow, and therefore inherits much of
  710. the functionaly of a Twindow object.  
  711.  
  712. Members - PRIVATE 
  713.  
  714. int itemcount
  715.     The number of items contained in the menu.
  716.  
  717. itemarray items
  718.     An array of text items representing the text within the
  719.     menu.
  720.  
  721. int hifore
  722.     The foreground color of a highlighted menu selection.
  723.  
  724. int hiback
  725.     The background color of a highlighted menu selection.
  726.  
  727. int menuchoice
  728.     The value that will be returned to the caller representing the index
  729.     into the menu of the chosen selection.
  730.  
  731. Members - PUBLIC 
  732.  
  733. void init(int itemcnt,itemarray item,int xpos,int ypos,int width,int fore, 
  734.             int back,int hfore,int hback,int shadow,int shadowcolor);
  735.  
  736.     Call this function to initialize a Tmenu object after declaring a
  737.     variable of this type.  The itemcnt parameter represents the number of
  738.     items in the menu. The item parameter is an array of type itemarray 
  739.     and contains the strings to be displayed in the menu.  Index 0 of this
  740.     array must not be used. xpos and ypos indicate the upper left corner 
  741.     of the Tmenu on the screen. Width represents the width of the menu
  742.     window.  This variable must be large enough to accomodate the longest
  743.     text string to be displayed within the menu.  The fore and back
  744.     parameters represent the colors of a menu item that is not currently
  745.     highlighted.  The hfore and hback parameters represent the colors in
  746.     which to display a highlighted menu option.  If the shadow parameter is
  747.     non_zero the menu will be displayed with a shadow cast to the right.
  748.     The shadow color parameter represents the color in which text within 
  749.     the shadow area will be displayed.
  750.  
  751.     example:    itemarray items;
  752.                 strcpy(items[1],"Selection #1");
  753.                 strcpy(items[2],"Last Selection");
  754.  
  755.                 Tmenu theMenu;
  756.                 theMenu.init(2,items,10,10,20,15,1,14,5,1,8);
  757.  
  758. int show(int seconds=0);
  759.     This function displays and activates the menu. It will not return 
  760.     until either the RETURN or the ENTER key has been pressed.  The return
  761.     value is the index into the itemarray array of the highlighted menu
  762.     selection.  If the ESCAPE key is pressed the function returns 27.
  763.     Optionally a parameter of seconds can be supplied which will
  764.     cause the menu to time out and return 255.
  765.  
  766. void move(int newx,int newy) 
  767.     This function moves the menu to the newly specified x,y coordinates on
  768.     the screen.  The new coordinates will not take effect until the next
  769.     time the menu is displayed.
  770.  
  771.  
  772.  
  773.  
  774.                             TSTRING
  775.  
  776.     A Tstring object can be used to easily retrieve textual information 
  777. from the users of your program.  Tstring objects supply a visual editing
  778. field on the screen and can format the text for all caps if so desired. 
  779. Two descendants of the Tstring class, Tnumeral and Tdate,
  780. provide specialized classes for capturing formatted numeric and date input.
  781.  
  782.  
  783. Supporting Functions 
  784.  
  785.     Though not part of the formal class, the following three functions
  786. provide support for the string formatting functions of Tstring objects.
  787. These functions can be used for other purposes by the programmer.  
  788.  
  789. void beep();
  790.     Causes a beep on the computer speaker indicating that the key
  791.     being pressed cannot be inserted into the Tstring object at the 
  792.     current position.
  793.  
  794. char *strdel(char *orig,int pos);
  795.     This function deletes 1 character from the supplied char * orig at the
  796.     position pos and returns a pointer to the new string.
  797.  
  798. char *strins(char *orig,int pos,char ch);
  799.     This function inserts the char ch into the text string orig at 
  800.     position pos and returns a pointer to the new string.
  801.  
  802.  
  803. Members - PRIVATE 
  804.  
  805. char laststring[81]
  806.     This array contains the string as it is being entered and edited by 
  807.     the user.
  808.  
  809. char bar[81]
  810.     This array contains the characters used to display the input field on
  811.     the screen.
  812.  
  813. int xpos 
  814.     The position of the cursor in releation to the left coordinate of the
  815.     input field.
  816.  
  817. int x 
  818.     The left coordinate of the input field.
  819.  
  820. int y
  821.     The top coordinate of the input field.
  822.  
  823. int length 
  824.     The length of the input field.  The string that is input and returned
  825.     cannot be longer than this value.  Tstrings cannot scroll the text that
  826.     is input into them.
  827.  
  828. int ucase 
  829.     If this value is 1 the text will be converted to uppercase as it is
  830.     enetered.
  831.  
  832. int escape
  833.     This value is set to 1 if the ESCAPE key is pressed while the Tstring 
  834.     is receiving input.
  835.  
  836. int retrn
  837.     This value is set to 1 if the ENTER key is pressed while the Tstring 
  838.     is receiving input.
  839.  
  840. int tab 
  841.     This value is set to 1 if the TAB key is pressed while the Tstring is
  842.     receiving input.
  843.  
  844. int uparrow 
  845.     This value is set to 1 if the UP ARROW key is pressed while the 
  846.     Tstring is receiving input.
  847.  
  848. int dnarrow 
  849.     This value is set to 1 if the DOWN ARROW key is pressed while the
  850.     Tstring is receiving input.
  851.  
  852. int shown 
  853.     This value is 1 if the Tstring object is currently displayed on
  854.     the screen.
  855.  
  856. int barred 
  857.     This value is 1 if the input field has been displayed on the screen.
  858.  
  859. int firstchar
  860.     This value is true each time the Tstring is activated until a key has
  861.     been pressed.
  862.  
  863. int infgd 
  864.     This value represents the foreground color of the input field.
  865.  
  866. int inbgd 
  867.     This value represents the background color of the input field.
  868.  
  869. Members - PUBLIC 
  870.  
  871. Tstring(); 
  872.     The default constructor.
  873.  
  874. ~Tstring(); 
  875.     The default destructor.
  876.  
  877. void init(int xpos,int ypos,int len,int uppercase)
  878.     This function must be called to initialize a Tstring object after a
  879. variable of this type has been declared.  The xpos and ypos parameters
  880. represent the left and top coordinates of the input field on the screen.
  881. The len parameter represents the length of the input field.  If the
  882. uppercase parameter is non-zero the text will be converted to uppercase as
  883. it is entered into the input field.  
  884.  
  885.     example:    Tstring theString;
  886.                 theString.init(10,10,20,0);
  887.  
  888. void draw_bar();
  889.     This function is called internally by the Tstring object to draw the
  890.     input field on the screen.
  891.  
  892. void show();
  893.     This functions displays the input field on the screen.
  894.  
  895. void input(); 
  896.     This functions checks to see if a character is waiting to be placed
  897.     into the input field.  If so it processes the character appropriately.
  898.     If not, it returns immediately.  This function can be used to provide a
  899.     sort of multitasking.
  900.  
  901.     example:    int i=0;
  902.                 int done=0;
  903.                 Tstring theString;
  904.  
  905.                 while(!done) {
  906.                     theString.input();
  907.                     i++;
  908.                     vprintat(1,1,14,0,"%d",i);
  909.                     }
  910.  
  911. void get_input()
  912.     This function will receive input into the Tstring object until either
  913.     the ENTER ot the ESCAPE key has been pressed.
  914.  
  915. void get_form_input()
  916.     This function will receive input into the Tstring object until either
  917.     the ENTER, ESCAPE, TAB, UP ARROW, or DOWN ARROW key has     been pressed.
  918.  
  919. void get_form_mouse_input()
  920.     This funtion works the same as get_form_input() and in addition will
  921.     return it the left mouse button is pressed while the mouse cursor is
  922.     positioned within the input field.
  923.  
  924. void reset()
  925.     Clears the input string.
  926.  
  927. void preset(char *text)
  928.     This function allows a string to be inserted into the input field
  929.     before it is displayed on the screen.
  930.  
  931. void erase() 
  932.     This function visually clears an input field.
  933.  
  934. char *getstring()
  935.     Use this function to return a pointer to the string contained within
  936.     the Tstring object.
  937.  
  938.     example:    Tstring theString;
  939.                 theString.init(10,10,20,0);
  940.                 theString.get_input();
  941.  
  942.                 vprintat(1,1,14,0,"%s",theString.getstring());
  943.  
  944. int escapehit();
  945.     Returns 1 if the ESCAPE key was pressed while editing the Tstring
  946.     field.
  947.  
  948. int returnhit(); 
  949.     Returns 1 if the ENTER key was pressed while editing the Tstring 
  950.     field.
  951.  
  952. int tabhit();
  953.     Returns 1 if the TAB key was pressed while editing the Tstring field.
  954.  
  955. int uparrowhit();
  956.     Returns 1 if the UP ARROW key was pressed while editing the Tstring
  957.     field.
  958.  
  959. int dnarrowhit();
  960.     Returns 1 if the DOWN ARROW key was pressed while editing the Tstring
  961.     field.
  962.  
  963. int isshown();
  964.     Returns 1 if the Tstring field is currently displayed on the screen.
  965.  
  966. int isbarred();
  967.     Returns 1 if the input field has been displayed on the screen.
  968.  
  969. int hit();
  970.     Returns 1 if the mouse cursor is currently within the Tstring field.
  971.  
  972. void setincolors(int fgd,int bgd);
  973.     Sets the foreground and background colors of the input field.  By
  974.     default these colors are yellow(14) on blue(1).
  975.  
  976.  
  977.  
  978.                             TNUMERAL
  979.  
  980.     A Tnumeral object functions very much like a Tstring object, except 
  981. that it has been specialized for the input and return of numeric data.
  982. Almost all of the same member functions are used.  Those that differ from,
  983. or are in addition to Tstring are listed here:  
  984.  
  985. Members - PROTECTED 
  986.  
  987. int real; 
  988.     This value is 1 if the value being entered is a float value, 0
  989.     otherwise.
  990.  
  991. Members - PUBLIC 
  992.  
  993. void init(int xloc,int yloc,int length,int int_or_float);
  994.     xloc and yloc specify the coordinates of the left and top of the input
  995.     field.  Length specifies the maximum length of the numeric string to 
  996.     be input. int_or_float should be 0 to indicate that the value to be
  997.     entered is an integer, or 1 to indicate the value will be a float.
  998.     Float values can include the '.'  character.  Both ints and floats can
  999.     include a '-' sign.
  1000.  
  1001. float getfloat();
  1002.     Returns a float value representing the text string in the input field.
  1003.  
  1004. int getint();
  1005.     Returns and int representing the text in the input field.
  1006.  
  1007. long getlong() 
  1008.     Returns a long representing the text in the input field.
  1009.  
  1010.  
  1011.  
  1012.  
  1013.                             TDATE
  1014.  
  1015.     Like Tnumeral, Tdate is a derivative of the Tstring class, but in this
  1016. case has been specialized for the input of date values.  Again, all of the 
  1017. member functions from Tstring can be utilized.  Following are those that 
  1018. differ.  
  1019.  
  1020. Members - PROTECTED 
  1021.  
  1022. int date_ok;
  1023.     This value is 1 if the date entered is a valid date, 0 otherwise.
  1024.  
  1025. Members - PUBLIC 
  1026.  
  1027. void init(int xloc,int yloc);
  1028.     xloc and yloc specift the starting coordinates of the input field.
  1029.  
  1030. void validate();
  1031.     Not normally called by the programmer.  The class uses this function 
  1032.     to verfify that the date entered is a valid date.
  1033.  
  1034. int verified(); 
  1035.     Returns 1 if the date entered has been validated, 0 otherwise.
  1036.  
  1037. char * getdatestring();
  1038.     Returns a char * that points to a text string representing the data
  1039.     entered.  If the date field contains the characters "12/31/93" then 
  1040.     the string that is referenced will also contain the string
  1041.     "12/31/93"
  1042.  
  1043. long getdate(); 
  1044.     Returns a long value representing the date entered.  If the date field
  1045.     contains the characters "12/31/93" the value returned will be 931231.
  1046.  
  1047.  
  1048.  
  1049.                             TBUTTON
  1050.  
  1051.     A Tbutton provides a user interface object which simulates the actions
  1052. of a pushbutton.  An additional style of Tbutton, called Tbutton3d, has 
  1053. been added in this version of the ObjectEase libraries.  It has all of the
  1054. same functionality of a standard Tbutton, but it's screen appearance is 
  1055. different.  Use this documentation for both the Tbutton and Tbutton3d 
  1056. classes.  
  1057.  
  1058. Members - PROTECTED 
  1059.  
  1060. int xpos
  1061.     The left x coordinate of the button on the screen.
  1062.  
  1063. int ypos
  1064.     The top y position of the button on the screen.
  1065.  
  1066. int width
  1067.     The width of the button on the screen.
  1068.  
  1069. int pressed 
  1070.     This value is 1 if the button is currently pressed, 0 otherwise.
  1071.  
  1072. int hilite
  1073.     This value represents the index into the string of the highlighted
  1074.     character.
  1075.  
  1076. char button[81]
  1077.     The text string that is actually the button on the screen.
  1078.  
  1079. char shadow[81]
  1080.     The text string which forms the button's shadow on the screen.
  1081.  
  1082. char id[41]
  1083.     The actual text that is displayed on the button.
  1084.  
  1085. Members - PUBLIC 
  1086.  
  1087. Tbutton();
  1088.     The default constructor.
  1089.  
  1090. ~Tbutton()
  1091.     The default destructor.
  1092.  
  1093. void init(int xpos,int ypos,int char *text,int hilite_pos); 
  1094.     Call this function to initialize the Tbutton object before displaying
  1095.     it on the screen.  xpos and ypos represent the left and top 
  1096.     coordinates of the Tbutton.  The text parameter represents the text to
  1097.     be displayed on the button.  hilite_pos represents the index into the
  1098.     string of the letter to be highlighted.
  1099.  
  1100.     example:    Tbutton mybutton;
  1101.                 mybutton.init(10,10,"Hello",1);
  1102.  
  1103.     This example will create a button with the word "Hello" displayed on 
  1104.     it with the letter "H" highlighted.
  1105.  
  1106. void show(int bgd);
  1107.     Displays the Tbutton on the screen.  The bgd value represents color of
  1108.     the background onto which the Tbutton will be displayed.  The Tbutton3d
  1109.     version of this function does not take any parameters.
  1110.  
  1111. int buttonpressed();
  1112.     Returns 1 if the Tbutton is currently pressed, 0 otherwise.  For
  1113.     compatibility, use the ispressed() function instead of buttonpressed().
  1114.  
  1115. int hit(); 
  1116.     Returns 1 if the mouse cursor is currently positioned over the 
  1117.     Tbutton, 0 otherwise.
  1118.  
  1119. void press(int bgd); 
  1120.     Displays the Tbutton on the screen in its depressed state.  The bgd
  1121.     value represents the color of the screen background on which the
  1122.     Tbutton will be displayed.  The Tbutton3d version of this function 
  1123.     does not take any parameters.
  1124.  
  1125. int ispressed();
  1126.     Returns 1 if the Tbutton is currently depressed, 0 otherwise.
  1127.  
  1128.  
  1129.  
  1130.  
  1131.                             TCHECKBOX
  1132.  
  1133.     A Tcheckbox can be used in text mode as an indicator for making multple
  1134. choice selections.  When used in a group, multiple checkboxes can be 
  1135. checked, or it can be used more like a radiobutton, where only one 
  1136. selection from a group can be checked at any one time.  
  1137.  
  1138. Members - PROTECTED 
  1139.  
  1140. int xpos
  1141.     The left x coordinate of the Tcheckbox
  1142.  
  1143. int ypos
  1144.     The top y position of the Tcheckbox.
  1145.  
  1146. int fgd 
  1147.     The foreground color of the Tcheckbox.
  1148.  
  1149. int bgd 
  1150.     The background color of the Tcheckbox
  1151.  
  1152. int checked 
  1153.     This value is 1 if the Tcheckbox is currently checked, 0 otherwise.
  1154.  
  1155. Members - PUBLIC 
  1156.  
  1157. Tcheckbox(); 
  1158.     The default constructor.
  1159.  
  1160. ~Tcheckbox(); 
  1161.     The default destructor.
  1162.  
  1163. void init(int xpos,int ypos,int fgd,int bgd) 
  1164.     Call this functions to initialize the Tcheckbox before displaying it 
  1165.     on the screen.  The xpos and ypos values represent the left and top
  1166.     coordinates of the Tcheckbox.  The fgd and bgd values represent the
  1167.     colors in which the Tcheckbox will be displayed.
  1168.  
  1169. void show(); 
  1170.     Displays the Tcheckbox on the screen.
  1171.  
  1172. void grabcursor();
  1173.     Causes the cursor to appear within the Tcheckbox
  1174.     object.  If the cursor has been turned off by a call to cursoroff(), it
  1175.     will not be visible, but it will still be positioned within the
  1176.     Tcheckbox.
  1177.  
  1178. int hit(); 
  1179.     This function returns 1 if the mouse cursor is currently positioned
  1180.     over the Tcheckbox, 0 otherwise.
  1181.  
  1182. void check(); 
  1183.     Causes the Tcheckbox to appear checked.
  1184.  
  1185. void uncheck(); 
  1186.     Causes the Tcheckbox to appear unchecked.
  1187.  
  1188. int ischecked() 
  1189.     Returns 1 if the Tcheckbox is currently checked, 0 otherwise.
  1190.  
  1191.  
  1192.  
  1193.  
  1194.                             SOUNDQ
  1195.  
  1196.     The SoundQ class is useful for having the computer make sounds or play
  1197. music in the background, allowing foreground processing to continue 
  1198. undisturbed.  Most of the functions affecting this class are actully not 
  1199. part of the class.  This is because they act on data through an interrupt 
  1200. procedure which is not part of the class itself.  
  1201.  
  1202. Members - PROTECTED 
  1203.  
  1204. float speed_factor 
  1205.     This value represents a speed factor representing the speed of the
  1206.     sound playback.  The default play back speed is 1.
  1207.  
  1208. Members _ PUBLIC 
  1209.  
  1210. SoundQ(); 
  1211.     The default constructor.
  1212.  
  1213. ~SoundQ(); 
  1214.     The default destructor.
  1215.  
  1216. void play(int freq, int duration); 
  1217.     Places a note at the specified frequency and duration into the sound
  1218.     queue for playback.  The sound queue will begin playing immediately 
  1219.     and will continue as long as there are notes available in the queue.
  1220.     Use the values defines in TUI.H to more easily specify the freq and
  1221.     duration parameters.
  1222.  
  1223.     example:    SoundQ sq;
  1224.                 sq.play(C,HN);
  1225.                 sq.play(D,HN);
  1226.                 sq.play(E,HN);
  1227.                 sq.play(F,HN);
  1228.                 sq.play(G,HN);
  1229.                 sq.play(A,HN);
  1230.                 sq.play(B,HN);
  1231.                 sq.play(C*2,HN);
  1232.  
  1233.     This example plays a C scale in half notes.
  1234.  
  1235. void adjust_speed(float);
  1236.     Sets the speed factor at which to play back the sound.  The default
  1237.     value is 1. To cause the speed of the music to double call
  1238.     adjust_speed()with a parameter of 2.
  1239.  
  1240. Functions - THESE APPEAR OUTSIDE OF THE CLASS BODY 
  1241.  
  1242. void empty_sound_queue();
  1243.     Empties all notes out of the queue and causes the sound to stop
  1244.     immediately.
  1245.  
  1246. void init_sound(); 
  1247.     Do NOT call this function.  It is called by the default constuctor.
  1248.  
  1249. void restore_sound();
  1250.     Do NOT call this function.  It is called by the destructor.
  1251.  
  1252. int submit_sound(int freq,int duration);
  1253.     Do NOT call this function.  It is called by the play() member function.
  1254.  
  1255.  
  1256.  
  1257.  
  1258.                             OPTION
  1259.  
  1260.     The option class is used by the menu and listbox classes.  It 
  1261. represents a single line in the menu or listbox, and has no useful
  1262. functionality of its own.  For this reason the option class is not
  1263. documented.  There is no loss of functionality to the programmer by the
  1264. lack of this documentation.  The functionality of this class can easily be
  1265. duplicated by the programmer.  
  1266.  
  1267.  
  1268.  
  1269.                         PULLDOWN
  1270.  
  1271.  
  1272.         The pulldown class is the replacement for the Tmenu class.
  1273. Unlike the Tmenu, a pulldown object can be navigated with the
  1274. keyboard, the mouse , or both. The programmer also has complete
  1275. control over the value returned for a specific menu choice. The
  1276. menu can also display separator bars to logically group sections
  1277. of a pulldown object.
  1278.  
  1279. Members - PROTECTED
  1280.  
  1281. friend menubar
  1282.     The menubar which is the parent of the pulldown. Can be NULL
  1283.     
  1284. int nfg
  1285.     The fgd color of an unhighlighted menu option
  1286.     
  1287. int nbg
  1288.     The bgd color of an unhighlighted menu option
  1289.     
  1290. int hfg
  1291.     The fgd color of a highlighted menu option
  1292.     
  1293. int hbg
  1294.     The bgd color of a highlighted menu option
  1295.     
  1296. int x
  1297.     The left x coordinate of the pulldown menu
  1298.     
  1299. int y
  1300.     The top y coordinate of the pulldown menu
  1301.  
  1302. TWindow frame
  1303.     A Twindow object which serves as the frame for the pulldown menu
  1304.  
  1305. int shown
  1306.     Indicates the visible status of the pulldown object
  1307.  
  1308. int width
  1309.     The width of the pulldown object
  1310.  
  1311. int height
  1312.     The height of the pulldown object
  1313.  
  1314. int num_options
  1315.     The number of options contained in the pulldown menu
  1316.  
  1317. int part_of_menubar
  1318.     Indicates whether the pulldown object is the child of a menubar
  1319.     object 
  1320.  
  1321. char hotkeys[20]
  1322.     Contains the programmer defined accelerator keys for accessing
  1323.     the pulldown menu 
  1324.  
  1325. int kbtrigger_index
  1326.     The index into the options of the pulldown of the option that
  1327.     is selected using keyboard accelerators 
  1328.  
  1329.  
  1330. Menbers - PUBLIC
  1331.  
  1332. option options[20]
  1333.     The array of options within the pulldown. A pulldown menu is
  1334.     limited to 20 options. 
  1335.  
  1336. void init(int norm_fgd,int norm_bgd,int hi_fgd,int hi_bgd,
  1337.             int xpos,int ypos) 
  1338.  
  1339.     Call this function to initialize the pulldown object after
  1340.     declaring a variable of this type. The norm_fgd and norm_bgd
  1341.     parameters represent the unhighlighted fgd and bgd colors. The
  1342.     hi_fgd and hi_bgd parameters represent the fgd and bgd colors of
  1343.     a highlighted option. xpos and ypos are the left and top
  1344.     coordinates at which the pulldown should be displayed. 
  1345.     
  1346.     example:    pulldown pd;
  1347.                 pd.init(BLACK,WHITE,YELLOW,RED,10,10);
  1348.  
  1349. void set_option(int index,char *text,int ret_value)
  1350.     Adds an option to the menu. Call this function to fill the menu
  1351.     after declarinring and initializing it. The index parameter is
  1352.     the index into the array of options in the pulldown. The *text
  1353.     parameter is the text that you want to be displayed in the menu,
  1354.     and the ret_value is the value that will be returned if this
  1355.     menu option is chosen. To add a separator bar to the menu make
  1356.     the *text parameter a "-" .
  1357.  
  1358.     NOTE: The *text parameter can contain the '&' character to
  1359.         indicate the letter to be highlighted and represent the
  1360.         accelerator for that particular option. For instance, to
  1361.         highlight the letter 'x' in the word "Exit" and have it
  1362.         serve as an accelerator, enter the text as "E&xit". 
  1363.  
  1364.     example:    pulldown pd;
  1365.                 pd.init(BLACK,WHITE,YELLOW,RED,10,10);
  1366.  
  1367.                 pd.set_option(0,"&Option #1",1);
  1368.                 pd.set_option(1,"&Second Option",2);
  1369.  
  1370. void determine_width_height()
  1371.     Do NOT call this function directly. It is used internally to
  1372.     determine the width and height to display the pulldown based on
  1373.     the strings it will contain.
  1374.  
  1375. void display()
  1376.     Displays the pulldown menu on the screen.
  1377.  
  1378. void position(int xpos,int ypos)
  1379.     Positions the pulldown's upper left corner at xpos,ypos.
  1380.  
  1381. int trackmenu()
  1382.     This is the main engine of the pulldown object. It captures all
  1383.     input both from the keyboard and the mouse. The return value is
  1384.     127 if the ESCAPE key has been hit. Be careful not to duplicate
  1385.     this value with one of your own options. Otherwise, the return
  1386.     value is the value that the programmer has defined in the
  1387.     set_option call for the option that has been selected.
  1388.  
  1389.     example:    pulldown pd;
  1390.                 pd.init(BLACK,WHITE,YELLOW,RED,10,10);
  1391.  
  1392.                 pd.set_option(0,"&Option #1",1);
  1393.                 pd.set_option(1,"&Second Option",2);
  1394.                 
  1395.                 int choice=pd.trackmenu();        
  1396.                 switch(choice) {
  1397.                     case 1:...
  1398.                     case 2:...
  1399.                     }
  1400.  
  1401. void hide()
  1402.     removes the pulldown menu from the screen.
  1403.  
  1404. int is_shown()
  1405.     Returns 1 if the menu is currently displayed, 0 otherwise.
  1406.  
  1407. void adjust_option_widths()
  1408.     Do NOT call this function directly. It is used internally by
  1409.     the class.
  1410.  
  1411. void adjust_pos_to_menubar(int)
  1412.     Do NOT call this function directly. It is used internally by
  1413.     the class.
  1414.     
  1415. int is_part_of_menubar()
  1416.     Returns 1 if the pulldown is the child of a menubar
  1417.     object, 0 otherwise. 
  1418.  
  1419.  
  1420. PULLDOWN NOTE:
  1421.     YOU CAN CAUSE CERTAIN PULLDOWN OPTIONS TO APPEAR IN A UNIQUE
  1422.     COLOR BY CALLING THE self_color(int fgd,int bgd,int hfgd,int
  1423.     hbgd) MEMBER OF THE OPTION CLASS.
  1424.  
  1425.     example:    pulldown pd;
  1426.                 pd.init(1,7,7,1,10,10);
  1427.  
  1428.                 pd.set_option(0,"&Option 1",1);
  1429.                 pd.set_option(1,"&Second Option",2);
  1430.  
  1431.                 pd.options[1].self_color(3,7,7,3);
  1432.  
  1433.  
  1434.  
  1435.                             MENUBAR
  1436.  
  1437.     A menubar object can serve as a parent to several pulldown
  1438. objects. A menubar is typically a bar across the top of the screen
  1439. with various options which will invoke the appropriate pulldown
  1440. menu.
  1441.  
  1442. Members - PROTECTED
  1443.  
  1444. option *titles[10] 
  1445.     An array of pointers to options which represent the options in
  1446.     the menubar. A menubar can have a maximum of 10 titles. 
  1447.  
  1448. pulldown *pd[10]
  1449.     An array of pointers to pulldowns. A menubar can have a maximum
  1450.     of 10 associated pulldown menus. 
  1451.  
  1452. int nfg
  1453.     The fgd color of an unhighlighted option
  1454.  
  1455. int nbg
  1456.     The bgd color of an unhighlighted option
  1457.  
  1458. int hfg
  1459.     The fgd color of a highlighted option
  1460.  
  1461. int hbg
  1462.     The bgd color of a highlighted option
  1463.  
  1464. int num_titles
  1465.     The number of titles currently in the menubar.
  1466.  
  1467. char hotkeys[10]
  1468.     An array of characters which act as accelerators for the
  1469.     menubar titles.
  1470.  
  1471. int kbtrigger_index
  1472.     The index into the array of titles for the option that was
  1473.     selected by a keyboard accelerator. 
  1474.  
  1475. Members - PUBLIC
  1476.  
  1477. menubar()
  1478.     The default constructor
  1479.  
  1480. ~menubar()
  1481.     The defaule destructor
  1482.  
  1483. void init(int nfg,int nbg,int hfg,int hbg)
  1484.     Call this function to initialize a menubar object after
  1485.     declaring a variable of this type. The 4 parameters represent
  1486.     the normal (unhighlighted) fgd and bgd colors, and the
  1487.     highlighted fgd and bgd colors. 
  1488.  
  1489. void set_title(int index,char *text,pulldown *)
  1490.     Adds a title and an association with a pulldown menu to the
  1491.     menubar. 
  1492.  
  1493.     NOTE: The *text parameter can contain the '&' character to
  1494.     indicate the letter to be highlighted and represent the
  1495.     accelerator for that particular option. For instance, to
  1496.     highlight the letter 'F' in the word "File" and have it
  1497.     serve as an accelerator, enter the text as "&File". 
  1498.  
  1499.     example:    menubar mb;
  1500.                 pulldown pd;
  1501.  
  1502.                 pd.init(BLUE,WHITE,WHITE,BLUE,10,10);
  1503.                 //The xpos and ypos parameters here are irrevelant
  1504.                 //because the pulldown will be positioned by the
  1505.                 //menubar object 
  1506.  
  1507.                 pd.set_option(0,"&Open",1);
  1508.                 pd.set_option(1,"-",0);
  1509.                 pd.set_option(2,"E&xit",2);
  1510.  
  1511.                 mb.init(BLUE,WHITE,WHITE,BLUE);
  1512.                 mb.set_title(0,"&File",&pd);
  1513.  
  1514. void display()
  1515.     Displays a menubar object on the screen
  1516.  
  1517. int trackbar()
  1518.     This is the main engine of the menubar object. It handles all
  1519.     mouse and keyboard input to navigate the menubar. The up and
  1520.     down arrow keys will move the highlight within a single
  1521.     pulldown. The right and left arrow keys will move to the next or
  1522.     previous pulldown. The return value is 127 if the ESCAPE key
  1523.     was hit, or it is the value of the pulldown option as defined
  1524.     by the programmer in the pulldown::set_option call. 
  1525.  
  1526.     example:    menubar mb;
  1527.                 pulldown pd;
  1528.  
  1529.                 pd.init(BLUE,WHITE,WHITE,BLUE,10,10);
  1530.                 //The xpos and ypos parameters here are irrevelant
  1531.                 //because the pulldown will be positioned by the
  1532.                 //menubar object 
  1533.  
  1534.                 pd.set_option(0,"&Open",1);
  1535.                 pd.set_option(1,"-",0);
  1536.                 pd.set_option(2,"E&xit",2);
  1537.  
  1538.                 mb.init(BLUE,WHITE,WHITE,BLUE);
  1539.                 mb.set_title(0,"&File",&pd);
  1540.  
  1541.                 int choice=mb.trackbar();
  1542.                 if(choice==2)
  1543.                     Exit the program
  1544.  
  1545. int hit()
  1546.     Returns 1 if the mouse cursor is currently over the menubar, 0
  1547.     otherwise 
  1548.  
  1549. int mouse_triggered()
  1550.     Returns 1 if the menubar has been activated by clicking the
  1551.     left mouse button while the cursor is positioned over a menubar
  1552.     title, 0 otherwise. 
  1553.  
  1554. int kb_triggered()
  1555.     Returns 1 if the menubar has been activated by a keyboard
  1556.     accelerator, 0 otherwise.
  1557.  
  1558.     NOTE:   The menu is activated from the keyboard by pressing the
  1559.     ALT key along with the highlighted letter from the desired
  1560.     menubar title. For example, if the first titles in a menubar is
  1561.     "&File", it would be activated by presseing ALT-F.
  1562.  
  1563. int triggered()
  1564.     Returns mouse_triggered() | kb_triggered()
  1565.  
  1566.  
  1567.  
  1568.                                PAD
  1569.  
  1570.     The PAD class is solely for use in the scroll bar class and
  1571. therefore is not documented here. There is not other useful
  1572. functionality for this class.
  1573.  
  1574.  
  1575.  
  1576.                              SCROLLBAR     
  1577.  
  1578.     The scrollbar object is used to visually control the contents
  1579. of a particular screen area, allowing the user to manipulate the
  1580. screen by changing the position of the scrollbar. It is important
  1581. for the programmer to remember that the scrollbar object does not
  1582. manipulate the screen in any way on its own, it merely return a
  1583. value which must be used by the programmer to make any necessary
  1584. changes in display.
  1585.  
  1586.     
  1587. Members - PROTECTED
  1588.  
  1589. int x
  1590.     The left x coordinate of the scrollbar
  1591.     
  1592. int y
  1593.     The top y coordinate of the scrollbar
  1594.     
  1595. pad *thumbpad
  1596. pad *increase
  1597. pad *decrease
  1598.     Pointers to pad objects which represent the thumbpad and the
  1599.     buttons at the ends of the scrollbar used for changing the
  1600.     scrollbar's value.
  1601.  
  1602. int vertical
  1603.     Represents the orientation of the scrollbar.
  1604.  
  1605. int length
  1606.     The total overall length of the scrollbar object
  1607.  
  1608. int small_d
  1609.     The amount that the scrollbar's value will change if one of the
  1610.     end buttons is pressed. 
  1611.  
  1612. int large_d
  1613.     The amount that the scrollbar's value will change if it is
  1614.     clicked between the thumbpad and one of the end buttons. 
  1615.  
  1616. long minimum
  1617.     The minimum value of the scrollbar
  1618.  
  1619. long maximum
  1620.     The maximum value of the scrollbar
  1621.  
  1622. long value
  1623.     The current value of the scrollbar
  1624.  
  1625. int changed
  1626.     Indicates the status of the scrollbar
  1627.  
  1628. Members _ PUBLIC
  1629.  
  1630. void init(int xpos,int ypos,int length,int vert,long min,long max)
  1631.     Call this function to initialize a scrollbar object. The xpos
  1632.     and ypos parameters are the left and top coordinates of the
  1633.     scrollbar. Length represents the number of screen characters
  1634.     long to make the scrollbar. Use the global #defines HORIZONTAL
  1635.     and VERTICAL for the vert parameter, The min and max parameters
  1636.     represent the range of the scrollbar's value. 
  1637.  
  1638.     example:    scrollbar sb;
  1639.                 sb.init(10,5,15,VERTICAL,0,10);
  1640.  
  1641. void show()
  1642.     Displays the scrollbar on the screen.
  1643.     
  1644. int thumbpad_hit()
  1645.     Returns 1 if the mouse cursor is currently positioned over
  1646.     the thumbpad, 0 otherwise. 
  1647.  
  1648. int decrease_hit()
  1649.     Returns 1 if the mouse cursor is currently positioned over the
  1650.     top button of a VERTICAL scrollbar or the left button of a
  1651.     HORIZONTAL scrollbar, 0 otherwise.  
  1652.  
  1653. int increase_hit()
  1654.     Returns 1 if the mouse cursor is currently positioned over the
  1655.     bottom button of a VERTICAL scrollbar or the right button of a
  1656.     HORIZONTAL scrollbar, 0 otherwise.  
  1657.  
  1658. int hit()
  1659.     Returns 1 if the mouse cursor is positioned over the scrollbar
  1660.     object, 0 otherwise.
  1661.  
  1662. void track_scrollbar()
  1663.     Captures all mouse input into the scrollbar and adjusts its
  1664.     appearance and value accordingly. 
  1665.  
  1666.     example:    scrollbar sb;
  1667.                 sb.init(10,5,15,VERTICAL,0,10);
  1668.  
  1669.                 while(!the_mouse.RBP()) {
  1670.                     if(sb.hit())
  1671.                         sb.track_scrollbar();
  1672.                     }
  1673.  
  1674. long get_value()
  1675.     Returns the current value of the scrollbar.
  1676.  
  1677. int value_changed()
  1678.     Returns 1 if the value of the scrollbar has changed since the
  1679.     last call to get_value(). 
  1680.  
  1681. void set_small_d(int val)
  1682.     Sets the amount to change the value of the scrollbar if the end
  1683.     buttons are clicked. This value is 1 by default. 
  1684.  
  1685. void set_large_d(int val)
  1686.     Sets the amount to change the value of the scrollbar if the
  1687.     users clicks between the thumbpad and one of the end buttons.
  1688.     This value is 10 by default. 
  1689.  
  1690. void set_maximum(long val)
  1691.     Sets the value to be used as the maximum scrollbar value
  1692.  
  1693. void set_minimum(long val)
  1694.     Sets the value to be used as the minimum scrollbar value
  1695.  
  1696. void update_value(long)
  1697.     Sets the current value and adjusts the scrollbar's appearance
  1698.     accordingly. 
  1699.  
  1700.     
  1701.     
  1702.     
  1703.                             LISTBOX
  1704.                             
  1705.     A listbox object can be used similarly to a pulldown menu to
  1706. make a single selection from a list of options. Unlike a pulldown,
  1707. a listbox has the capability to scroll, so that it may contain
  1708. many more options than are currently visible on the screen. The
  1709. listbox maintains and navigates a list of optionrec structures
  1710. which represent the options in the list.
  1711.  
  1712. Members - PROTECTED
  1713.  
  1714. int x
  1715. int y
  1716.     The upper left coordinates of the listbox object
  1717.  
  1718. optionrec *listroot
  1719.     The root of the list of optionrecs
  1720.  
  1721. optionrec *listend
  1722.     The end of the list of optionrecs
  1723.  
  1724. optionrec *currentsel
  1725.     A pointer to the currently selected optionrec
  1726.  
  1727. Twindow box
  1728.     The Twindow object which serves as the frame for the listbox
  1729.  
  1730. scrollbar sbar
  1731.     The listbox's scrollbar
  1732.  
  1733. int selected_index
  1734.     The index into the list of the currently selected option
  1735.  
  1736. char *selected_string
  1737.     The text of the currently selected option
  1738.  
  1739. int option_string_length
  1740.     The length of the strings in the list
  1741.  
  1742. int changed
  1743.     Represents the status of the listbox
  1744.  
  1745. int size_forced
  1746.     Represents whether the listbox has sized itself, or the
  1747.     programmer has determined the size at which to display. 
  1748.  
  1749. int forced_width
  1750.     The width that the programmer has determined for the listbox
  1751.  
  1752. int forced_height
  1753.     The height that the programmer has determined for the listbox
  1754.  
  1755. Members _ PUBLIC
  1756.  
  1757. listbox()
  1758.     The default constructor
  1759.  
  1760. ~listbox()
  1761.     The default destructor
  1762.  
  1763. void init(int xpos,int ypos,int num_displayed,int winfgd,int winbgd,
  1764.             int hfgd,int hbgd)
  1765.     Call this function to initialize a listbox object. The xpos and
  1766. ypos parameter are the upper left screen coordinates. The
  1767. num_displayed value is the number of options that can be displayed
  1768. in the listbox, NOT the number that it can hold, only the number
  1769. that it can display at one time. The winfgd and winbgd parameters
  1770. are the fgd and bgd colors of the window and unhighlighted
  1771. options. The hfgd and hbgd parameters are the fgd and bgd colors of
  1772. a highlighted option.
  1773.  
  1774.     example:    listbox lb;
  1775.                 lb.init(5,5,5,15,1,1,7);
  1776.                 
  1777. void force_size(int width,int height)
  1778.     By default a listbox will determine the width
  1779.     and height at which it should be displayed. Use this function to
  1780.     override these default value and force it to be displayed at a
  1781.     chosen size. 
  1782.  
  1783. void set_highlight_position(int index)
  1784.     Moves the highlight to the position specified in index.
  1785.  
  1786. void append_item(char *text)
  1787.     Use this function to add strings to the listbox. Strings can
  1788.     only be added to the end of the list. 
  1789.  
  1790.     example:    listbox lb;
  1791.                 lb.init(5,5,3,15,1,1,7);
  1792.  
  1793.                 lb.append_item("Item Number 1");
  1794.                 lb.append_item("Second Item");
  1795.  
  1796. void show()
  1797.     Displays the listbox on the screen
  1798.  
  1799. void show_options(int index)
  1800.     Used internally to show a particular segment of the list
  1801.  
  1802. void hide()
  1803.     Removes the listbox from the screen.
  1804.  
  1805. void scroll_list_up()
  1806. void scroll_list_down()
  1807.     Used internally to position the list within the listbox
  1808.  
  1809. int tracklist()
  1810.     The main engine of the listbox object. Captures all keyboard
  1811.     and mouse input and adjusts the appearance of the listbox
  1812.     accordingly. The return value is 1 if successful, 0 otherwise.
  1813.  
  1814.     example:    listbox lb;
  1815.                 lb.init(5,5,3,15,1,1,7);
  1816.  
  1817.                 lb.append_item("Item Number 1");
  1818.                 lb.append_item("Second Item");
  1819.                 
  1820.                 int choice=lb.tracklist();
  1821.  
  1822. int options_displayed
  1823.     The number of options currently displayed
  1824.  
  1825. int options_in_list
  1826.     The number of options currently in the list
  1827.  
  1828. int option_width
  1829.     The width if the strings in the list
  1830.  
  1831. int shown
  1832.     The current visible status
  1833.  
  1834. int nfg
  1835.     The fgd color of an unhighlighted option
  1836.  
  1837. int nbg
  1838.     The bgd color of an unhighlighted option
  1839.  
  1840. int hfg
  1841.     The fgd color of a highlighted option
  1842.  
  1843. int hbg
  1844.     The bgd color of a highlighted option
  1845.  
  1846. int index_at_top
  1847.     The index into the list of the option currently displayed at
  1848.     the top of the list.
  1849.  
  1850. int index at bottom
  1851.     The index into the list of the option currently displayed at
  1852.     the bottom of the list.
  1853.  
  1854. int hit()
  1855.     Returns 1 if the mouse cursor is currently positioned over the
  1856.     listbox, 0 otherwise. 
  1857.  
  1858. int is_current_index()
  1859.     Returns the index into the list of the currently selected option
  1860.  
  1861. char *is_current_string()
  1862.     Returns a pointer to the string of the option that is currently
  1863.     selected 
  1864.  
  1865. int is_selected_index()
  1866.     Returns the index into the list of the selected option
  1867.  
  1868. char *is_selected_string()
  1869.     Returns a pointer to the string of the selected option
  1870.  
  1871. void deactivate()
  1872.     Turns off the highlighting of the selected option
  1873.  
  1874. void reactivate()
  1875.     Turns on the highlighting for the currently selecting option
  1876.  
  1877. int active
  1878.     Indicates the current status
  1879.  
  1880. int part_of_structure
  1881.     This field is 1 if the listbox is part of another structure,
  1882.     such as a directory box. 
  1883.  
  1884. int Getx()
  1885.     Returns the left x coordinate of the listbox
  1886.  
  1887. int Gety()
  1888.     Returns the top y coordinate of the listbox
  1889.  
  1890. int list_index
  1891.     The current index into the list
  1892.  
  1893.  
  1894.  
  1895.  
  1896.                             DIRBOX
  1897.  
  1898.     The dirbox object provides a convenient way to access the
  1899. directory and file structure of a disk. Because of the large
  1900. memory requirements of the dirbox, it should be contained to a very
  1901. small scope so as not to interfere with the other parts of the
  1902. application.
  1903.  
  1904. Members _ PROTECTED
  1905.  
  1906. Twindow *box
  1907.     The frame of the dirbox
  1908.     
  1909. listbox *drive
  1910.     listbox containing the available drives
  1911.     
  1912. listbox *directory
  1913.     listbox containing the available directories         
  1914.  
  1915. Tbutton *OK
  1916.     The OK button
  1917.  
  1918. Tbutton *CANCEL
  1919.     The CANCEL button
  1920.  
  1921. char fullpath[]
  1922.     The current path displayed in the dirbox
  1923.  
  1924. char returnpath[]
  1925.     The path, including the filename and extension that will be
  1926.     returned to the caller 
  1927.  
  1928. Tstring *filename
  1929.     The currently selected filename
  1930.  
  1931. int shown
  1932.     Indicates the current status
  1933.  
  1934. int turn
  1935.     A counter representing the region of the dirbox that currently
  1936.     has the input focus 
  1937.  
  1938. char dirmask[]
  1939.     A mask used to determine which files are listed in the dirbox
  1940.  
  1941. int intnumber
  1942.     The value of the "Abort, Retry, Fail" interrupt
  1943.  
  1944. void interrupt (*)(...)
  1945.     A pointer to the "Abort, Retry, Fail" interrupt
  1946.  
  1947. Members - PUBLIC
  1948.  
  1949. dirbox()
  1950.     The default constructor
  1951.  
  1952. ~dirbox()
  1953.     The default destructor
  1954.  
  1955. void show()
  1956.     Displays the dirbox on the screen
  1957.  
  1958. void hide()
  1959.     Removes the dirbox from the screen
  1960.  
  1961. char *trackdir()
  1962.     The main engine of the dirbox object. Captures all mouse and
  1963.     keyboard input and updates the internal variables accordingly.
  1964.     The return value is a pointer to the currently selected file. 
  1965.  
  1966.     example:    {
  1967.                     dirbox db;
  1968.                     char file[MAXPATH];
  1969.                     strcpy(file,db.trackdir());
  1970.                 }
  1971.  
  1972.     NOTE: The above section of code is enclosed in its own braces
  1973.             to limit the scope of the dirbox object and keep a
  1974.             maximum amount of memory available for the application.
  1975.  
  1976. void print_current_path()
  1977.     Used internally to display the current path
  1978.  
  1979. void change_directory(char *)
  1980.     Used Internally
  1981.  
  1982. void fill_directory_list()
  1983.     Used internally to populate the list of available directories
  1984.  
  1985. void fill_drive_list()
  1986.     Used internally to populate the list of available drives
  1987.  
  1988. void set_mask(char *mask)
  1989.     Use this function to specify a mask for a particular file type.
  1990.     By defaule this mask is "*.*"
  1991.  
  1992. static void interrupt _handler(...)
  1993.     This handler is responsible for printing an error if the disk
  1994.     is not ready in the currently selected drive.
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.     This completes the documentation of the TUI portion of the
  2001. ObjectEase libraries.
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.      
  2029.  
  2030.  
  2031.                          GUI library reference
  2032.  
  2033.     The GUI.LIB library provides a complete set of graphics mode
  2034. user interface objects, as well as some supplemental functions that
  2035. you'll find most useful.  The classes are described in the
  2036. following section, with the standalone function calls being
  2037. described first. 
  2038.  
  2039.  
  2040. Standalone Function Calls 
  2041.  
  2042. Gprintxy(
  2043.  
  2044. void dlay(int ticks);
  2045.     Causes a program delay for the specified number of timer ticks.
  2046.     The timer ticks at 18.2 times per second.
  2047.  
  2048.     long getticks();
  2049.     Returns the timer value representing the current time expressed
  2050.     in timer ticks. 
  2051.  
  2052. int altkey();
  2053.     Returns 1 if the ALT key is currently pressed, 0 otherwise.
  2054.  
  2055. int shiftkey();
  2056.     Returns 1 if the SHIFT key is currently pressed, 0 otherwise
  2057.  
  2058. void flushkeys();
  2059.     Empties out the keyboard type ahead buffer
  2060.  
  2061. unsigned char getvidmode();
  2062.     Returns the current video mode. This value can be compared
  2063.     against the Borland defined values C40, C80, etc...
  2064.  
  2065. void beep(); 
  2066.     Causes the PC speaker to emit a beep
  2067.  
  2068. char *strdel(char *text,int pos); 
  2069.     Deletes the character at position pos from the string text and
  2070.     returns a pointer to the new string. 
  2071.  
  2072. char *strins(char *text,int pos,char ch);
  2073.     Inserts the character ch into the string text at position pos,
  2074.     and returns a pointer to the new string. 
  2075.  
  2076. void gprintxy(int xloc,int yloc,char *fmt,...);
  2077.     Use like the standard Printf() function to print text on the
  2078.     graphics screen. 
  2079.  
  2080.  
  2081.  
  2082.  
  2083.                             Mcursor
  2084.  
  2085.  
  2086.     The following data and functions are all part of the Mcursor
  2087. class, which handles mouse functionality in both the text and graphics 
  2088. modes.  Certain mouse functions are different, however, in the different 
  2089. video modes.  
  2090.  
  2091. Global Variables 
  2092.  
  2093.     _MX An integer value representing the current x value of the mouse.
  2094. This varible is updated with every call to get_status().  The LBP() and
  2095. RBP() function call call get_status().
  2096.  
  2097.     _MY An integer value representing the current y value of the mouse.
  2098. This varible is updated with every call to get_status().  The LBP() and
  2099. RBP() function call call get_status().
  2100.  
  2101.     Using the above variable to get the mouse position can improve program
  2102. performance because a function call is not necessary to retrieve
  2103. these values.  
  2104.  
  2105. void far mhandler(); 
  2106.     This is the interrupt handler for the mouse which allows
  2107.     capturing such mouse events as double clicks. 
  2108.  
  2109. MCursor the_mouse 
  2110.     Since the mouse is used by other classes a global MCursor
  2111.     variable is defined in the library.  To use the mouse in your
  2112.     programs simply declare "extern Mcursor the_mouse" at the top of
  2113.     your source module(s). 
  2114.  
  2115.  
  2116. Members - PRIVATE 
  2117.  
  2118. int shown
  2119.     Indicates whether the mouse cursor is currently visible or not.
  2120.  
  2121. int current
  2122.     Indicates the shape of the currently selected cursor
  2123.  
  2124. int xpos
  2125.     The current x position of the mouse cursor.
  2126.  
  2127. int ypos
  2128.     The current y position of the mouse cursor.
  2129.  
  2130. void mouse_interrupt();
  2131.     The current procedure acting as the mouse handler.
  2132.  
  2133. int m1
  2134.     Used as the AX register variable in mouse calls.
  2135.  
  2136. int m2
  2137.     Used as the BX register variable in mouse calls.
  2138.  
  2139. int m3
  2140.     Used as the CX register variable in mouse calls.
  2141.  
  2142. int m4
  2143.     Used as the DX register variable in mouse calls.
  2144.  
  2145. int button
  2146.     Represents the button being pressed or tested, left or right.
  2147.  
  2148. int count
  2149.     Keeps track of the number of times a button has been pressed.
  2150.  
  2151. int disabled
  2152.     If this variable is 1 the mouse cannot be shown.
  2153.  
  2154. int handler_installed
  2155.     This value is 1 if the mouse handler has been installed, 0 if not.
  2156.  
  2157. int eventmask
  2158.     Specifies which events the mouse handler captures.  By
  2159.     default only left mouse button presses are captured.
  2160.  
  2161. void ClearHandler()
  2162.     This function disables the mouse handler.
  2163.  
  2164. void InstallHandler()
  2165.     This function installs the mouse handler.  The mouse handler is
  2166.     installed by default by the arm() function.
  2167.  
  2168. Members - PUBLIC 
  2169.  
  2170. Mcursor()
  2171.     The default constructor.
  2172.  
  2173. ~Mcursor()
  2174.     The default destructor.
  2175.  
  2176. int init()
  2177.     Call to initialize the mouse at the beginning of your program. If the
  2178.     return value is 0, there is no mouse present.
  2179.  
  2180.     example:    extern Mcursor the_mouse;
  2181.                 int mouse_present;
  2182.                 mouse_present=the_mouse.init();
  2183.  
  2184. void changeto(int shape)
  2185.     Changes the shape of the mouse cursor. Use the global #defines
  2186.     in GUI.H for the value of shape.
  2187.  
  2188. void get_status()
  2189.     This function returns the current state of the mouse buttons.  It is
  2190.     not normally called by the programmer.
  2191.  
  2192. void show() 
  2193.     This function makes the mouse cursor visible if it has not been
  2194.     disabled by a call to unarm();
  2195.  
  2196. void hide()
  2197.     This function makes the mouse cursor invisible.
  2198.  
  2199. void set_hor_bounds(int min,int max)
  2200.     This function sets the bounds of mouse movement on the x axis.  The
  2201.     min value represents the left boundary of mouse movement, and the max
  2202.     value represents the right boundary.
  2203.  
  2204. void set_ver_bounds(int min,int max)
  2205.     This function sets the bounds of mouse movement on the y axis.  The
  2206.     min value represents the top boundary of mouse movement, and the max
  2207.     value represents the bottom boundary.
  2208.  
  2209. void conditional_off(int x1,int y1,int x2,int y2)
  2210.     This function makes the mouse cursor invisible when it is in the
  2211.     rectangle bounded by x1,y1,x2,y2.
  2212.  
  2213. void position(int x,int y) 
  2214.     This function moves the mouse cursor to the screen position defined in
  2215.     x,y.
  2216.  
  2217. int LBP()
  2218.     Returns 1 if the left mouse button is currently pressed, 0 otherwise.
  2219.  
  2220. int RBP()
  2221.     Returns 1 if the right mouse button is currently pressed, 0 otherwise.
  2222.  
  2223. int mousex()
  2224.     This function returns the current x coordinate of the mouse cursor.
  2225.     Use the global value _MX to avoid this function call.
  2226.  
  2227. int mousey()
  2228.     This function returns the current y coordinate of the mouse cursor.
  2229.     Use the global value _MY to avoid this function call.
  2230.  
  2231. int mx()
  2232.     Same as mousex().
  2233.  
  2234. int my()
  2235.     Same as mousey().
  2236.  
  2237. void unarm()
  2238.     This function turns makes the mouse cursor invisible and does not 
  2239.     allow it to be re-shown by the show() call.  To re-show the cursor
  2240.     you must call arm().
  2241.  
  2242. void arm()
  2243.     This function shows the mouse cursor and allows future calls to show()
  2244.     to do the same.
  2245.  
  2246. int LBDCLK()
  2247.     This function returns 1 if the left mouse button has been double
  2248.     clicked, 0 otherwise.  The left mouse button must be pressed twice
  2249.     within 1/2 second (9 timer ticks) for LBDCLK to return 1.
  2250.  
  2251. long thistick
  2252.     Represents the current timer tick at the time of the mouse event.  Not
  2253.     normally used by the programmer.
  2254.  
  2255. long prevtick
  2256.     Represents the timer tick at the time of the previous mouse event. 
  2257.     Not normally used by the programmer.
  2258.  
  2259. int doubleclicked 
  2260.     This value is checked by the LBDCLK() function.  It is set by the 
  2261.     mouse handler.  Not normally used by the programmer.
  2262.  
  2263.  
  2264.  
  2265.  
  2266.  
  2267.                                 POINT
  2268.  
  2269.     The point class serves as the base class for all of the other
  2270. graphics mode classes. As such, it contains the data members and
  2271. functions which are common to the other classes derived from point.
  2272. The point class by itself has no valuable purpose.
  2273.  
  2274. Members - PROTECTED
  2275.  
  2276. int x
  2277.     The x coordinate of the point
  2278.  
  2279. int y
  2280.     The y coordinate of the point
  2281.  
  2282. int color
  2283.     The color of the point
  2284.  
  2285. void far *background
  2286.     A pointer to a memory buffer containg the underlying screen
  2287.     image.
  2288.  
  2289. long backgroundsize
  2290.     The size of the buffer containing the underlying screen image.
  2291.  
  2292. char tempfile[MAXPATH]
  2293.     The name of a temporary file used to store the underlying
  2294.     screen image
  2295.  
  2296. int image_is_on_disk
  2297.     Indicates the current placement of the buffer comtaining
  2298.     the underlying screen image,
  2299.  
  2300. Members - PUBLIC
  2301.  
  2302. Point()
  2303.     The default constructor
  2304.  
  2305. ~Point()
  2306.     The default destructor
  2307.  
  2308. void elim()
  2309.     Frees the memory associated with the *background data member
  2310.  
  2311. int Getx()
  2312.     Returns the x coordinate
  2313.  
  2314. int Gety()
  2315.     Returns the y coordinate
  2316.  
  2317. int Getcolor()
  2318.     Returns the color associated with the point
  2319.  
  2320. int write_background()
  2321.     Writes the background buffer to disk. Returns 1 if successful,
  2322.     0 otherwise. 
  2323.  
  2324. int read_background()
  2325.     Fills the background buffer by reading the image off of the
  2326.     disk. Returns 1 if successful, 0 otherwise. 
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.                                 
  2333.                                     GSTRING
  2334.  
  2335.     The Gstring class provides a convenient way to gather user input while
  2336. in the graphics modes.  
  2337.  
  2338.  
  2339. Members - PROTECTED
  2340.  
  2341. int xpos
  2342.     The left x coordinate of the input field
  2343.  
  2344. int ypos
  2345.     The top y coordinate of the input field
  2346.  
  2347. int strlength
  2348.     The length of the string that has been input in pixels
  2349.  
  2350. int height
  2351.     The height of the input field
  2352.  
  2353. int ucase
  2354.     Indicates whether or not the string is to be in all upper case
  2355.  
  2356. char laststring[81]
  2357.     The string being editted
  2358.  
  2359. int shown
  2360. int wasshown
  2361.     Indicates the current and previous visible states of the input field
  2362.  
  2363. int outlined
  2364. int was outlined
  2365.     Indicates the current previous outlined states of the input field
  2366.  
  2367. int escape
  2368.     Indicates that the escape key was pressed
  2369.  
  2370. int retrn
  2371.     Indicates that the ENTER key was pressed
  2372.  
  2373. int tab
  2374.     Indicates that the tab key was pressed
  2375.  
  2376. int uparrow
  2377.     Indicates that the up arrow key has been pressed
  2378.  
  2379. int dnarrow
  2380.     Indicates that the down arrow key has been pressed
  2381.  
  2382. int infgd
  2383.     The fgd color of the input field
  2384.  
  2385. int inbgd
  2386.     The bgd color of the input field
  2387.  
  2388. int firstchar
  2389.     TRUE until a character has been entered
  2390.  
  2391. int curpos
  2392.     The current index into the string at which editting is taking place
  2393.  
  2394. int curson
  2395.     Indicates the flashing state of the cursor
  2396.  
  2397. void showcurs()
  2398.     Makes the flashing cursor visible
  2399.  
  2400. void hidecurs()
  2401.     Hides the flashing cursor();
  2402.  
  2403. long last_tick
  2404.     The clock tick of the last mouse click
  2405.  
  2406. int clickcount
  2407.     The number of times that the input field has been clicked by the mouse
  2408.     within the last 1/2 second 
  2409.  
  2410. Members -PUBLIC
  2411.  
  2412. Gstring()
  2413.     The default constructor
  2414.  
  2415. ~Gstring
  2416.     The default destructor
  2417.  
  2418. void elim()
  2419.     Frees the memory that is associated with the buffer containing the
  2420.     underlying screen image 
  2421.  
  2422. void init(int xloc,int yloc,int length,int uppercase,int savebgd=0)
  2423.     Call this function to initialize a Gstring object. The xloc and yloc
  2424.     parameter represent the upper left coordinates of the input field.  The
  2425.     length parameter refers to the number of characters that the input
  2426.     field will hold. If uppercase is non-zero, then all input is forced
  2427.     into upper case. The savebgd parameter indicates whether or not the
  2428.     underlying screen image should be captured to a buffer before drawing
  2429.     the input field on the screen. By default, this value is 0. 
  2430.  
  2431.     example:    Gstring mystring;
  2432.                 mystring.init(10,10,20,0);
  2433.  
  2434. void reinit(int xloc,int yloc,int uppercase,int savebgd=0)
  2435.     This function allows a Gstring object to be re-initialized after a
  2436.     previous call to init(). 
  2437.  
  2438. void show()
  2439.     Displays a Gstring object on the screen
  2440.  
  2441. void input()
  2442.     The main input function. The other input function repeatedly pass
  2443.     through this function checking for certain characters.
  2444.  
  2445. void get_input()
  2446.     Call this function to get user input. The function will terminate
  2447.     on the following keys: 
  2448.         ENTER
  2449.         ESCAPE
  2450.         TAB
  2451.  
  2452. void get_form_input()
  2453.     Call this function to get user input. The function will terminate
  2454.     on the following keys: 
  2455.         ENTER
  2456.         ESCAPE
  2457.         TAB
  2458.         UP ARROW
  2459.         DOWN ARROW
  2460.  
  2461. void get_form_mouse_input()
  2462.     Call this function to get user input. The function will terminate
  2463.     on the following keys: 
  2464.         ENTER
  2465.         ESCAPE
  2466.         TAB
  2467.         UP ARROW
  2468.         DOWN ARROW
  2469.         A LEFT MOUSE BUTTON PRESS
  2470.  
  2471. char *getstring()
  2472.     Returns a pointer to the string in the input field
  2473.  
  2474. void reset()
  2475.     Clears out the input field.
  2476.  
  2477. void preset(char *text)
  2478.     Pleces the specified text into the input field before the user begins
  2479.     editting 
  2480.  
  2481. int isshown()
  2482.     Returns 1 if the input field is currently displayed on the screen, 0
  2483.     otherwise.
  2484.  
  2485. void check_for_blink();
  2486.     Used internally to check if it is time to blink the cursor.
  2487.  
  2488. int returnhit()
  2489.     Returns non-zero if the ENTER key has been pressed
  2490.  
  2491. int escapehit()
  2492.     Returns non-zero if the ESCAPE key has been pressed
  2493.  
  2494. int dnarrowhit()
  2495.     Returns non-zero if the down arrow key has been pressed.
  2496.     
  2497. int uparrowhit()
  2498.     Returns non-zero if the up arrow key has been pressed.
  2499.     
  2500. int tabhit()
  2501.     Returns non-zero if the tab key has been pressed.
  2502.  
  2503. void setincolors(int fgd,int bgd)
  2504.     Sets the colors of the input field to the specified fgd and bgd colors.
  2505.  
  2506. int hit()
  2507.     Returns 1 if the mouse cursor is currently over the input field, 0
  2508.     otherwise.
  2509.  
  2510. void outline(int color,int offset=0)
  2511.     Draws a dotted outline around the input field in the specified color,
  2512.     offset pixels from the outside edge of the input field. 
  2513.  
  2514. void move(int xloc,int yloc)
  2515.     Moves the input field to the specified coordinates
  2516.  
  2517. void hide()
  2518.     Removes the input field from the screen
  2519.  
  2520. int Getx()
  2521.     Returns the left x coordinate of the input field
  2522.  
  2523. int Gety()
  2524.     Returns the top y coordinate of the input field
  2525.  
  2526. int is_ucase()
  2527.     Returns 1 if all letters are being forced to capitals
  2528.  
  2529. int clicked()
  2530.     Returns 1 if the left mouse button has been pressed while the mouse
  2531.     cursor is positioned over the input field. 
  2532.  
  2533. int LBDCLK()
  2534.     Returns 1 if the left mouse button has been pressed twice within 1/2
  2535.     second over the input field 
  2536.  
  2537. int Getlength()
  2538.     Returns the length of the string that has been entered
  2539.  
  2540.  
  2541.     Gstring example:    Gstring mystring;
  2542.                         mystring.init(10,10,20,0);
  2543.                         mystring.get_input();
  2544.  
  2545.                         gprintxy(10,50,"%s",mystring.getstring());
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.                                 LINE
  2552.  
  2553.     Line is a new class that has been added to version 3.0 of ObjectEase.
  2554. It is simply that, a class representing a graphic line on the screen. 
  2555.  
  2556. Members - PROTECTED
  2557.  
  2558. int x2
  2559.     The x coordinate of the end of the line
  2560.     
  2561. int y2
  2562.     The y coordinate of the end of the line
  2563.     
  2564. int style
  2565.     Represents the thickness of the line
  2566.     
  2567. Members - PUBLIC
  2568.  
  2569. Line()
  2570.     The default constructor
  2571.     
  2572. ~Line()
  2573.     The default destructor
  2574.     
  2575. int Getx2()
  2576.     Returns the x coordinate of the end of the line
  2577.     
  2578. int Gety2()
  2579.     Returns the y coordinate of the end of the line 
  2580.  
  2581. int Getstyle()
  2582.     Returns an integer representing the line thickness
  2583.     
  2584. void init(int xpos,int ypos,int x2pos,int y2pos,int color, int thickness)
  2585.     The xpos and ypos represent the starting point of the line. The x2pos
  2586.     and y2pos parameters are the coordinates of the end of the line. color
  2587.     is the line color, and thickness is a value of 1 for thin lines, and 3
  2588.     for thick lines. 
  2589.  
  2590.     example:    Line ln;
  2591.                 ln.init(0,0,getmaxx(),getmaxy(),15,1);
  2592.  
  2593. void show()
  2594.     Displays the Line object on the screen
  2595.  
  2596. void outline()
  2597.     Displays the Line object as a dashed line.
  2598.  
  2599. int starthit()
  2600.     Returns 1 if the mouse cursor is within 4 pixels of the starting x,y
  2601.     coordinates 
  2602.  
  2603. int endhit()
  2604.     Returns 1 if the mouse cursor is within 4 pixels of the ending x,y
  2605.     coordinates 
  2606.  
  2607. void end_to_start()
  2608.     Sets x and y equal to x2 and y2 respectively
  2609.  
  2610. void start_to_end()
  2611.     Sets x2 and y2 equal to x and y respectively
  2612.  
  2613. void swap_ends()
  2614.     Sets x = x2 and vice versa
  2615.     Sets y = y2 and vice versa
  2616.  
  2617. void new_end(int xloc,int yloc)
  2618.     Sets a new end point for the line
  2619.  
  2620. void new_start(int xloc,int yloc)
  2621.     Sets a new start point for the line
  2622.  
  2623.  
  2624.  
  2625.  
  2626.  
  2627.                                 GTEXT
  2628.  
  2629.     The Gtext class is new to version 3.0 of ObjectEase, and provides a
  2630. convenient class wrapper for placing text on a graphics screen.
  2631.  
  2632.  
  2633. Members - PROTECTED
  2634.  
  2635. struct textsettingstype ts
  2636.     A structure containing relevant information about the text font
  2637.     
  2638. int length
  2639.     The length of the text string in pixels
  2640.     
  2641. int height         
  2642.     The height of the text string in pixels
  2643.  
  2644. int strlength
  2645.     The length of the text string in characters
  2646.  
  2647. int fgd
  2648.     The foreground color of the text
  2649.  
  2650. int bgd
  2651.     The background color of the text
  2652.  
  2653. char text[41]
  2654.     The actual text string
  2655.  
  2656. int shown,wasshown
  2657.     These values indicate the visible status of the Gtext object
  2658.  
  2659. int outline, wasoutlines
  2660.     These values indicate the outlined status of the Gtext object
  2661.  
  2662. long last_tick
  2663.     The clock tick at the time of the last mouse left button press
  2664.  
  2665. int clickcount
  2666.     Indicates the number of times that the left mouse button has been
  2667.     pressed within the last 1/2 second 
  2668.  
  2669. Members - PUBLIC
  2670.  
  2671. Gtext()
  2672.     The default constructor
  2673.  
  2674. ~Gtext
  2675.     The default destructor
  2676.  
  2677. int Getlength()
  2678.     Returns the length of the text in pixels
  2679.  
  2680. int Getstrlength()
  2681.     Returns the length of the text in characters
  2682.  
  2683. int GetSize()
  2684.     Returns an integer representing the size of the font
  2685.  
  2686. void init(int xloc,int yloc,char *text,int fgd,int bgd,int size,
  2687.             int savebgd=0) 
  2688.     Call this function to initialize a Gtext object. The xloc and yloc
  2689.     parameters are the coordinate of the upper left corner. The *text
  2690.     parameter is a pointer to the text string. Colors are specified in the
  2691.     fgd and bgd parameters. If the savebgd parameter is non-zero, the
  2692.     unserlying screen imgae is saved in a buffer before the text is output
  2693.     to the screen. By default this value is 0. 
  2694.  
  2695.     example:    Gtext textline;
  2696.                 textline.init(10,10,"TEST",2,14,0);
  2697.  
  2698. void show()
  2699.     Displays the Gtext object on the screen
  2700.  
  2701. void hide()
  2702.     Removes the Gtext object from the screen
  2703.  
  2704. void outline(int color,int offset=0)
  2705.     Draws a dotted line around the Gtext object in the specified color,
  2706.     offset pixels from the outside of the Gtext object 
  2707.  
  2708. void reinit(int xloc,int yloc,char *text,int fgd,int bgd)
  2709.     Allows the Gtext object to be re-initialized after a previous call to
  2710.     init() 
  2711.  
  2712. int is_shown()
  2713.     Returns 1 if the Gtext object is currently visible on the screen
  2714.  
  2715. int hit()
  2716.     Returns 1 if the mouse cursor is currently positioned over the Gtext
  2717.     object 
  2718.  
  2719. int clicked()
  2720.     Returns 1 if the left mouse button is pressed while over the Gtext
  2721.     object
  2722.  
  2723. int LBDCLK()
  2724.     Returns 1 if the left mouse button is clicked 2 times within 1/2
  2725.     second over the Gtext object
  2726.  
  2727. void move(int newx,int newy)
  2728.     Moves the upper left corner of the Gtext object to the new coordinates
  2729.  
  2730. char *Gettext()
  2731.     Returns a pointer to the string in the Gtext Object
  2732.  
  2733. int Getfgd()
  2734.     Returns the current fgd color
  2735.  
  2736. int Getbgd()
  2737.     Returns the current bgd color
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.                                 COLORBUTTON
  2744.  
  2745.  
  2746.     A colorbutton is useful for drawing a color selection palette as in
  2747. many paint programs. 
  2748.  
  2749. Members - PROTECTED
  2750.  
  2751. int color
  2752.     The color of the colorbutton
  2753.  
  2754. int width
  2755.     The width of the colorbutton
  2756.  
  2757. int height
  2758.     The height of the colorbutton
  2759.  
  2760. Members - PUBLIC
  2761.  
  2762. void init(int xloc,int yloc,int width,int height,int color)
  2763.     Call this function to initialize a colorbutton object
  2764.  
  2765.     example:    This example will create a color palette bar containing
  2766.                 colors 0 through 15 
  2767.  
  2768.                 colorbutton colors[16];
  2769.  
  2770.                 for(int i=0;i<16;i++) {
  2771.                     colors[i].init(100+(i*15),10,15,15,i);
  2772.                     }
  2773.  
  2774. void show()
  2775.     Displays the colorbutton on the screen
  2776.  
  2777. int clicked()
  2778.     Returns 1 if the left mouse button is clicked over the colorbutton
  2779.  
  2780. int hit()
  2781.     Returns 1 if the mouse cursor is currently positioned over the
  2782.     colorbutton 
  2783.  
  2784. int getcolor()
  2785.     Returns the color associated with the colorbutton
  2786.  
  2787.  
  2788.  
  2789.  
  2790.                             CLOSEBUTTON
  2791.  
  2792.     The Closebutton class is used only within the Gwindow class and
  2793. therefore is not documented here.
  2794.  
  2795.  
  2796.  
  2797.  
  2798.                             ICON
  2799.                             
  2800.     The Icon class is useful for creating and
  2801. manipulating small graphic icons. These icons can easily be created using
  2802. the ICONEDIT utility in the ObjectEase package.
  2803.  
  2804. Members - PROTECTED
  2805.     
  2806. int state
  2807.     The current state of the icon
  2808.  
  2809. int w
  2810.     The width of the icon
  2811.  
  2812. int h
  2813.     The height of the icon
  2814.  
  2815. void far *picture
  2816.     A pointer to the bitmap image to be shown in the icon
  2817.  
  2818. int shown,wasshown
  2819.     Indicate the visible status of the icon
  2820.  
  2821. int outlined,wasoutlined
  2822.     Indicate the outlined status of the icon
  2823.  
  2824. char fn[9]
  2825.     The name of the bitmap to be loaded into the icon
  2826.  
  2827. char filename[13]
  2828.     The complete filename (including the extension) of the file to be
  2829.     loaded into the icon 
  2830.  
  2831. long last_tick
  2832.     The clock tick when the left mouse button was last pressed while over
  2833.     the icon 
  2834.  
  2835. int clickcount
  2836.     The number of times that the left mouse button has been pressed within
  2837.     the last 1/2 second 
  2838.  
  2839. Members - PUBLIC
  2840.  
  2841. Icon()
  2842.     The default constructor
  2843.  
  2844. ~Icon
  2845.     The default destructor
  2846.  
  2847. void init(int xloc,int yloc,char *file,int savebgd=0)
  2848.     Initializes and Icon object. The xloc and yloc paremeters are the
  2849.     upper left coordinate at which the Icon will be displayed. The *file
  2850.     parameter is a pointer to the name of the file that contains the bitmap
  2851.     for the Icon. This parameter does not include a file extension;.ICN is
  2852.     assumed. If the savebgd parameter is non-zero, the underlying screen
  2853.     image is saved to a buffer before the Icon is displayed on the screen.
  2854.     By default this value is 0. 
  2855.  
  2856.     example:    Icon myicon;
  2857.                 myicon.init(10,10,"PAINT");
  2858.  
  2859. void reinit(int xloc,int yloc,char *file)
  2860.     Allows an Icon object to be reinitialized after a previous call to
  2861.     init(). 
  2862.  
  2863. void freepicture()
  2864.     Frees the memory associated with the bitmap displayed in an Icon
  2865.  
  2866. void show()
  2867.     Displays an Icon object on the screen.
  2868.  
  2869. void choose()
  2870.     Causes the Icon to be displayed in negative form, usually indicating
  2871.     that it has been selected. 
  2872.  
  2873. int hit()
  2874.     Returns 1 if the mouse cursor is currently positioned over the Icon
  2875.  
  2876. int clicked()
  2877.     Returns 1 if the left mouse button is pressed while over the Icon
  2878.  
  2879. int ispressed()
  2880.     Returns 1 if the Icon is currently selected
  2881.  
  2882. int outline(int color,offset=0)
  2883.     Draws a dotted outline around the Icon in the specified color, offset
  2884.     pixels from the outside edge 
  2885.  
  2886. void hide()
  2887.     Removes an Icon object from the screen
  2888.  
  2889. void move(int newx,int newy)
  2890.     Repositions an Icon at the specified coordinates
  2891.  
  2892. char *Getfilename()
  2893.     Returns a pointer to a string represting the file name of the file
  2894.     containing the bitmap image in the Icon 
  2895.  
  2896. int LBDCLK()
  2897.     Returns 1 if the left mouse button is pressed 2 times within 1/2
  2898.     second over the Icon
  2899.  
  2900. int Getw()
  2901.     Returns the width of the Icon
  2902.  
  2903. int Geth()
  2904.     Returns the height of the Icon
  2905.  
  2906.  
  2907.     Icon example:   Icon myicon;
  2908.                     myicon.init(10,10,"PAINT");
  2909.                     myicon.show();
  2910.  
  2911.                     while(1) {
  2912.                         if(the_mouse.LBP()) {
  2913.                             if(myicon.hit()) {
  2914.                                 myicon.choose();
  2915.                                 while(the_mouse.LBP() && myicon.hit());
  2916.                                 myicon.show();
  2917.                                 }
  2918.                             }
  2919.                         }
  2920.  
  2921.  
  2922.  
  2923.  
  2924.  
  2925.                                 ACTICON
  2926.  
  2927.     An Acticon provides functions similar to those of an Icon object,
  2928. however, Acticons provide for animation of the bitmap image displayed on
  2929. them. Acticon sequences can easily be created using the ICONEDIT editor
  2930. supplied with the ObjectEase libraries.
  2931.  
  2932. Members - PROTECTED
  2933.  
  2934. void far *picture[32]
  2935.     An array of pointers to memory containg the graphic images to be
  2936.     displayed on the Acticon. The maximum number of frames is 32. 
  2937.  
  2938. int state
  2939.     The current state of the Acticon
  2940.  
  2941. int numpix
  2942.     The number of frames in the animation
  2943.  
  2944. Members - PUBLIC
  2945.  
  2946. Acticon()
  2947.     The default constructor
  2948.  
  2949. ~Acticon()    
  2950.     The default destructor
  2951.  
  2952. void init(int xloc,int yloc,char *file)
  2953.     Call this function to initialize an Acticon object. The xloc and yloc
  2954.     parameters refer to the upper left coordinate, and the *text parameter
  2955.     is a pointer to a string containing the filename of the file containing
  2956.     the image(s). This string should be supplied without an extension, .ICN
  2957.     is assumed. 
  2958.  
  2959. void show(int index)
  2960.     Displays the specified sequence frame in the Acticon
  2961.  
  2962. void choose()
  2963.     Displays frame 0 in negative form, usually indicating that the icon
  2964.     has been selected
  2965.  
  2966. int ispressed()
  2967.     Returns 1 if the Acticon is currently selected, 0 otherwise
  2968.  
  2969. void animate(int ticks)
  2970.     Plays the animations sequence within the Acticon, pausing the
  2971.     specified number of clock ticks between frames. The lower this number,
  2972.     the faster the sequence will play. The function must be called within
  2973.     some sort of loop to function properly. 
  2974.  
  2975.     example:    Acticon myicon;
  2976.                 myicon.int(10,10,"RUNNING");
  2977.  
  2978.                 while(!kbhit()) {
  2979.                     myicon.animate(3);
  2980.                     }
  2981.  
  2982. void backforth(int ticks)
  2983.     This function operates in the same manner as the animate function,
  2984.     however once it reaches the last frame it continues to play the
  2985.     sequence in reverse until it reaches the first frame, then it repeats. 
  2986.  
  2987.  
  2988.  
  2989.  
  2990.                                 BUTTON
  2991.  
  2992.     The button object is a graphic pushbutton that can be made to appear
  2993. to be pressed when the mouse is clicked while positioned on the button.
  2994. Buttons can contain either text or graphic images. Graphic images for
  2995. buttons can be created using the ICONEDIT utility sullpied with the
  2996. ObejctEase package. 
  2997.  
  2998. Members - PROTECTED
  2999.  
  3000. int state
  3001.     The current status of the button
  3002.  
  3003. int sizex
  3004.     The width of the button
  3005.  
  3006. int sizey
  3007.     The height of the button
  3008.  
  3009. char btntxt[40]
  3010.     The text string to appear on the button
  3011.  
  3012. int file_text
  3013.     Indicates if the button contains a graphic or text
  3014.  
  3015. void far *picture
  3016.     A pointer to memory containg the graphic
  3017.  
  3018. void getpic(char* file)
  3019.     Loads the graphic from the file whose name is specified. Do NOT call
  3020.     this function directly 
  3021.  
  3022. int outlined,wasoutlined
  3023.     Indicates the outlined status of the button
  3024.  
  3025. int shown,wasshown
  3026.     Indicates the visible status of the button
  3027.  
  3028. long last_tick
  3029.     The clock tick at the time the left mouse button was last pressed
  3030.  
  3031. int clickcount
  3032.     The number of times that the left mouse button has been pressed within
  3033.     the last 1/2 second 
  3034.  
  3035. int w
  3036.     The button width
  3037.  
  3038. int h
  3039.     The button height
  3040.  
  3041. Members - PUBLIC
  3042.  
  3043. Button()
  3044.     The default constructor
  3045.  
  3046. ~Button()
  3047.     The default destructor
  3048.  
  3049. void show()
  3050.     Displays the button on the screen
  3051.  
  3052. void press()
  3053.     Displays the button on the screen in its pressed state
  3054.  
  3055. void init(int xloc,int yloc,char *text,int type,int savebgd=0)
  3056.     Call this function to initialize a Button object. The xloc and yloc
  3057.     parameter indicate the upper left coordinat of the object. The *text
  3058.     parameter is either the text to print on the button, or than name of
  3059.     the file from which to load the graphic image. If the type parameter is
  3060.     TEXT, then the text will be printed on the button. If the type
  3061.     parameter is IMAGE, then the image will be loaded from a file by this
  3062.     name. If the file name is being specified, do not include the file
  3063.     extension as .BTN is assumed. If the savebgd parameter is non-zero then
  3064.     the underlying screen image will be saved in a buffer before the button
  3065.     is drawn. By default this value is 0. 
  3066.  
  3067.     example:    Button textbutton,imagebutton;
  3068.                 textbutton.init(10,10,"TEXT",TEXT);
  3069.                 imagebutton.init(10,50,"GRAPHIC",IMAGE);
  3070.  
  3071. void reinit(int xloc,int yloc,char *text,int type)
  3072.     This function allows a Button to be reinitialized after a previous
  3073.     call to init()
  3074.  
  3075. void freepicture()
  3076.     Frees the memory associated with the graphic. Called automatically by
  3077.     the destructor.
  3078.  
  3079. void resize(int newwidth,int newheight,int savebgd=0)
  3080.     Allows a Button to be resized from its default width and height.
  3081.  
  3082. int hit()
  3083.     Returns 1 if the mouse cursor is currently positioned ober a Button
  3084.  
  3085. int pressed()
  3086.     Returns 1 if the button is currently in its pressed state
  3087.  
  3088. void hide()
  3089.     Removes a Button object from the screen
  3090.  
  3091. void outline(int color,int offset=0)
  3092.     Draws a dotted outline around the button in the specified color,
  3093.     offset pixels from the outside edge
  3094.  
  3095. void move(int newx,int newy)
  3096.     Moves the upper left corner of the button to the new coordinates
  3097.  
  3098. int Getformat()
  3099.     Returns TEXT if the button contains text, IMAGE if the button contains
  3100.     a graphic 
  3101.  
  3102. char *Getcontents()
  3103.     Returns the text that appears on the button
  3104.  
  3105. int clicked()
  3106.     Returns 1 if the left mouse button is pressed while over the button
  3107.  
  3108. int LBDCLK()
  3109.     Returns 1 if the left mouse button has been clicked 2 times within the
  3110.     last 1/2 second 
  3111.  
  3112. int Getw()
  3113.     Returns the width of the button
  3114.  
  3115. int Geth()
  3116.     Returns the height of the button
  3117.  
  3118.  
  3119.  
  3120.     Button example:     Button mybutton;
  3121.                         mybutton.init(10,10,"Test Button",TEXT);
  3122.                         mybutton.show();
  3123.  
  3124.                         while(!kbhit()) {
  3125.                             if(the_mouse.LBP()) {
  3126.                                 if(mybutton.hit()) {
  3127.                                    mybutton.press();
  3128.                                    while(mybutton.hit()&&the_mouse.LBP()); 
  3129.                                    mybutton.show();
  3130.                                    //branch to the desired function here!
  3131.                                    }
  3132.                                 }
  3133.                             }
  3134.  
  3135.  
  3136.  
  3137.  
  3138.  
  3139.  
  3140.                             
  3141.                                 GCHECKBOX
  3142.  
  3143.     The Gcheckbox class provides an alternative way for the user to make
  3144. selections within your program. Visual checkboxes can be checked and
  3145. unchecked using the mouse or the keyboard.
  3146.  
  3147. Members - PROTECTED
  3148.  
  3149. int checked
  3150.     The current state
  3151.     
  3152. char desc[40]
  3153.     The descriptive text associated with the checkbox
  3154.  
  3155. int length
  3156.     The length of the Gcheckbox object in pixels
  3157.  
  3158. int shown,wasshown
  3159.     Indicate the visible staus of the Gcheckbox
  3160.  
  3161. int outlined,wasoutlined
  3162.     Indicate the outlined status of the Gcheckbox
  3163.  
  3164. long last_tick
  3165.     The clock tick at the time the left mouse button was last pressed
  3166.  
  3167. int clickcount
  3168.     The number of times the left mouse button has been pressed within the
  3169.     last 1/2 second 
  3170.  
  3171. int bgd
  3172.     The bgd color of the Gcheckbox
  3173.  
  3174. Members - PUBLIC
  3175.  
  3176. GCheckbox()
  3177.     The default constructor
  3178.  
  3179. ~Gcheckbox()
  3180.     The default destructor
  3181.  
  3182. void init(int xloc,int yloc,char *text,int savebgd=0)
  3183.     Call this function to initialize a Gcheckbox object. The xloc and yloc
  3184.     parameters are the upper left coordinate. The *text parameter is a
  3185.     pointer to the text string that will be displayed to the right of the
  3186.     Gcheckbox. If the sacebgd parameter is non-zero the underlying screen
  3187.     image will be saved to a buffer before the Gcheckbox is drawn. By
  3188.     default this value is 0. 
  3189.  
  3190. void reinit(int xloc,int yloc,char *text)
  3191.     This function allows a Gcheckbox object to be reinitialized after a
  3192.     previous call to init() 
  3193.  
  3194. void show()
  3195.     Displays a Gcheckbox on the screen
  3196.  
  3197. void check()
  3198.     Places a check mark inside a Gcheckbox
  3199.  
  3200. void uncheck()
  3201.     Removes the checkmark from a Gcheckbox
  3202.  
  3203. int is_checked()
  3204.     Returns 1 if the Gcheckbox is currently checked, 0 otherwise
  3205.  
  3206. int hit()
  3207.     Returns 1 if the mouse cursor is currently positioned over the
  3208.     Gcheckbox 
  3209.  
  3210. void outline(int color,int offset=0)
  3211.     Draws a dotted outline around the Gcheckbox in the specified color,
  3212.     offset pixels from the outside edge
  3213.  
  3214. void hide()
  3215.     Removes a Gcheckbox from the screen
  3216.  
  3217. void move(int newx,int newy)
  3218.     Moves a Gcheckbox to the newly specified x and y coordinates
  3219.  
  3220. char *Gettext()
  3221.     Returns a pointer to the text associated with the Gcheckbox
  3222.  
  3223. int clicked()
  3224.     Returns 1 if the left mouse button has been pressed while over the
  3225.     Gcheckbox 
  3226.  
  3227. int LBDCLK()
  3228.     Returns 1 if the left mouse button has been clicked 2 times within the
  3229.     last 1/2 second 
  3230.  
  3231. void setbgd(int bgd)
  3232.     Sets the bgd coor of the Gcheckbox to the specified color
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.                                 GRADIO
  3239.  
  3240.     A Gradio is similar in action to a Gcheckbox object. Only the screen
  3241. appearance is different. For this reason, refer to the documentation for
  3242. the Gcheckbox for a Gradio as well.
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.                                 BITMAP
  3250.  
  3251.     The Bitmap class allows for graphic images to be displayed on the
  3252. graphics screen. These graphics must be in Borland's BGI format, and can
  3253. be created using the 16IMAGE or 256IMAGE editors supplied with the
  3254. ObjectEase package.
  3255.  
  3256. Members - PROTECTED
  3257.  
  3258. int sizex
  3259.     The width of the Bitmap
  3260.     
  3261. int sizey
  3262.     The height of the bitmap
  3263.     
  3264. void far *picture
  3265.     A pointer to the memory containg the bitmap image             
  3266.  
  3267. int shown
  3268.     The current visible status
  3269.  
  3270. int clickcount
  3271.     The number of times the left mouse button has been pressed within the
  3272.     last 1/2 second 
  3273.  
  3274. long last_tick
  3275.     The clock tick at the time of the last left mouse button press
  3276.  
  3277. Members _ PUBLIC
  3278.  
  3279. Bitmap()
  3280.     The default constructor
  3281.  
  3282. ~Bitmap()
  3283.     The default destructor
  3284.  
  3285. void init(int xloc,int yloc)
  3286.     Initializes the bitmap object and places the upper left coordinate at
  3287.     xloc,yloc 
  3288.  
  3289. void load(char *file)
  3290.     Loads a graphic from the specified file into memory. The file name
  3291.     supplied should be complete, including the extension. 
  3292.  
  3293. void save(char *)
  3294.     Saves the graphic within the Bitmap's coordinates to a file with the
  3295.     specified name 
  3296.  
  3297. void show_XOR()
  3298.     Places the bitmap on the screen using the XOR_PUT operator
  3299.  
  3300. void show_COPY()
  3301.     Places the bitmap on the screen using the XOR_COPY operator
  3302.  
  3303. void show_AND()
  3304.     Places the bitmap on the screen using the XOR_AND operator
  3305.  
  3306. void show_OR()
  3307.     Places the bitmap on the screen using the XOR_OR operator
  3308.  
  3309. void show_NOT()
  3310.     Places the bitmap on the screen using the XOR_NOT operator
  3311.  
  3312. int is_shown()
  3313.     Returns 1 if the bitmap is currently displayed on the screen
  3314.  
  3315. void hide()
  3316.     Removes the graphic image from the screen
  3317.  
  3318. void moveto(int newx,int newy)
  3319.     Moves the Bitmap's upper left corner to the newly specified
  3320.     coordinates 
  3321.  
  3322. int capture(int x,int y,int x1,int y1)
  3323.     Captures the screen image bounded by the coordinates x,y,x1,y1 to a
  3324.     memory buffer 
  3325.  
  3326. int hit()
  3327.     Returns 1 if the mouse cursor is currently positioned over the Bitmap
  3328.  
  3329. int clicked()
  3330.     Returns 1 if the left mouse button has been pressed while over the
  3331.     Bitmap
  3332.  
  3333. int LBDCLK()
  3334.     Returns 1 if the left mouse button has been clicked 2 times within the
  3335.     last 1/2 second
  3336.    
  3337. int xsize()
  3338.     Returns the width of the Bitmap
  3339.  
  3340. int ysize()
  3341.     Returns the height of the bitmap
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.                                     PANEL
  3349.  
  3350.  
  3351.     Panels provide a way of sectioning off a portion of the screen. Panels
  3352. function in much the same way that a Twindow does in text mode. Panels
  3353. can contain other controls.
  3354.  
  3355. Members - PROTECTED
  3356.  
  3357. int w
  3358.     The width of the Panel
  3359.  
  3360. int h
  3361.     The height of the Panel
  3362.  
  3363. int in_or_out
  3364.     The bevel state of the Panel
  3365.  
  3366. int thick_or_thin
  3367.     The bevel characteristics
  3368.  
  3369. int shown,wasshown
  3370.     The visible status of the Panel
  3371.  
  3372. int outlined,wasoutlined    
  3373.     The outlined status of the Panel
  3374.  
  3375. long last_tick
  3376.     The clock tick at the time of the last left mouse button press
  3377.  
  3378. int clickcount
  3379.     The number of times that the left mouse button has been pressed within
  3380.     the last 1/2 second 
  3381.  
  3382. int panelcolor
  3383.     The bgd color of the panel
  3384.  
  3385. Members - PUBLIC
  3386.  
  3387. Panel()
  3388.     The default constructor
  3389.  
  3390. ~Panel()
  3391.     The default destructor
  3392.  
  3393. void show()
  3394.     Displays the Panel on the screen
  3395.  
  3396. void init(int xloc,int yloc,int width, int height,int inorout,  
  3397.             int thickorthin,int savebgd=0)
  3398.     Call this function to initialize a Panel object. The paremeters xloc
  3399.     and yloc specify the upper left corner, and widht and height specify
  3400.     the size of the Panel. Use the global #defines IN, OUT, THICK, and THIN
  3401.     for the Panel characteristics parameters. If the savebgd parameter is
  3402.     non-zero, the underlying screen image will be saved to a buffer before
  3403.     the Panel is drawn. This value is 0 by default.
  3404.  
  3405.     example:    Panel panel;
  3406.                 panel.init(10,10,300,200,IN,THICK);
  3407.  
  3408.  
  3409. void reinit(int xloc,int yloc,int width,int height,int inorout,
  3410.             int thickorthin)
  3411.     This function allows a Panel object to be reinitialized after a
  3412.     previous call to init() 
  3413.  
  3414. void hide()
  3415.     Removes a Panel from the screen.
  3416.  
  3417. int isshown()
  3418.     Returns 1 if the Panel is currently visible, 0 otherwise
  3419.  
  3420. void outline(int color,int offset=0)
  3421.     Draws a dotted outline around the Panel in the specified color, offset
  3422.     pixels from the outer edge 
  3423.  
  3424. void move(int newx,int newy)
  3425.     Moves the upper left corner of the Panel to the newly specified
  3426.     coordinate 
  3427.  
  3428. int hit()
  3429.     Returns 1 if the mouse cursor is currently positioned over the
  3430.     Panel 
  3431.  
  3432. void resize(int width,int height,int savebgd=0)
  3433.     Allows the widht and height of the Panel to be changed
  3434.  
  3435. int sizerhit()
  3436.     Returns 1 if the mouse cursor is within 4 pixels of the lower right
  3437.     corner of the Panel 
  3438.  
  3439. int Getw()
  3440.     Returns the width of the Panel
  3441.  
  3442. int Geth()
  3443.     Returns the height of the Panel
  3444.  
  3445. int clicked()
  3446.     Returns 1 if the left mouse button has been pressed while over the
  3447.     Panel
  3448.  
  3449. int LBDCLK()
  3450.     Returns 1 if the left mouse button has been clicked 2 times within the
  3451.     last 1/2 second
  3452.  
  3453. int Getthick()
  3454.     Returns 1 if the Panel has a THICK bevel style
  3455.  
  3456. int Getin()
  3457.     Returns 1 if the Panel has an IN bevel style
  3458.  
  3459. void setpanelcolor(int color)
  3460.     Changes the bgd color of the Panel to the specified color
  3461.  
  3462.  
  3463.     Panel example:  Panel panel;
  3464.                     panel.init(10,10,300,200);
  3465.                     panel.setpanelcolor(3);
  3466.                     panel.show();
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.                                     BEVEL
  3474.  
  3475.     The Bevel object provides similar functionality to the Panel object,
  3476. and differs only in screen appearance. For this reason, please refer to
  3477. the documentation for the Panel object for the Bevel function
  3478. descriptions as well.
  3479.  
  3480.  
  3481.  
  3482.  
  3483.  
  3484.  
  3485.  
  3486.                                  BUTTONBOX
  3487.  
  3488.  
  3489.     The Buttonbox object provides the functionality of a floating toolbox
  3490. of buttons.
  3491.  
  3492. Members - PROTECTED
  3493.  
  3494. Bevel *box
  3495.     The moveable box containing the buttons
  3496.     
  3497. Button *buttons[16]
  3498.     An array of pointers to the buttons. A maximum of 16 buttons is
  3499.     allowed 
  3500.  
  3501. int outlined,wasoutlined
  3502.     Indicates the outlined status of the Buttonbox
  3503.  
  3504. int shown,wasshown
  3505.     Indicates the visible status
  3506.  
  3507. int numbuttons
  3508.     The number of buttons in the Buttonbox
  3509.  
  3510. int w
  3511.     The width of the buttonbox
  3512.  
  3513. int h
  3514.     The height of the buttonbox
  3515.  
  3516. Members - PUBLIC
  3517.  
  3518. Buttonbox()
  3519.     The default constructor
  3520.  
  3521. ~Buttonbox()
  3522.     The default destructor
  3523.  
  3524. void init(int xloc,int yloc,int numofbuttons)
  3525.     Initializes a Buttonbox object. The xloc and yloc parameters indicate
  3526.     the upper left corner, and the numbuttons parameter indicates the
  3527.     number of buttons to be contained in the box.
  3528.  
  3529. void setbutton(int index,char *file)
  3530.     Use this function to load a particular button image. The index
  3531.     parameter is the index into the array of button pointers, and the *file
  3532.     parameter indicates the file name of the file containing the graphic to
  3533.     be loaded, excluding the file extension. .BTN is assumed.
  3534.  
  3535. int hit()
  3536.     Returns 1 if the mouse cursor is currently positioned over the
  3537.     Buttonbox 
  3538.  
  3539. int moverhit()
  3540.     Returns 1 if the mouse cursor is currently within the top 10 pixels of
  3541.     the containing box 
  3542.  
  3543. void show()
  3544.     Displays the Buttonbox on the screen
  3545.  
  3546. void outline(int color,int offset=0)
  3547.     Draws a dotted outline around the Buttonbox in the specified color,
  3548.     offset pixels from the outside edge 
  3549.  
  3550. void hide()
  3551.     Removes the Buttonbox from the screen
  3552.  
  3553. void move(int newx,int newy)
  3554.     Moves the upper left corner to the newly specified coordinates
  3555.  
  3556. int buttoncount()
  3557.     Returns the number of buttons in the Buttonbox
  3558.     
  3559. int buttonhit(int index)
  3560.     Returns 1 if the button at the specified index is under the
  3561.     mouse cursor 
  3562.  
  3563. void buttonpress(int index)
  3564.     Draws the button at the specified index in its pressed state
  3565.  
  3566. void buttonshow(int index)
  3567.     Draws the button at the specified index in its normal state    
  3568.  
  3569. int isshown()
  3570.     Returns 1 if the Buttonbox is currently visible
  3571.  
  3572.  
  3573.     Buttonbox example:  Buttonbox tb;
  3574.                         tb.init(10,10,4);
  3575.                         tb.setbutton(0,"ONE");
  3576.                         tb.setbutton(1,"TWO");
  3577.                         tb.setbutton(2,"THREE");
  3578.                         tb.setbutton(3,"FOUR");
  3579.  
  3580.                         while(1) {
  3581.                             if(the_mouse.LBP()) {
  3582.                                 for(int i=0;i<4;i++) {
  3583.                                     if(tb.buttonhit(i)) {
  3584.                                         tb.buttonpress[i];
  3585.                                         while(tb.buttonhit(i));
  3586.                                         tb.buttonshow(i);
  3587.                                         }
  3588.                                     }
  3589.                                 }
  3590.                             }
  3591.  
  3592.  
  3593.  
  3594.  
  3595.  
  3596.                                 GWINDOW
  3597.  
  3598.     The Gwindow class provide the capability to use moveable,
  3599. sizeable graphic container windows within your application. At the current
  3600. time the windows are limited in size to an area that encompasses 64K in
  3601. screen image are. This is due to the limitations imposed by the Borland
  3602. BGI functions getimage() and putimage().
  3603.  
  3604. Members - PROTECTED
  3605.  
  3606. Closebutton *closebox
  3607.     A pointer to a Closebutton object used to close the window
  3608.     
  3609. int w
  3610.     The width of the window
  3611.     
  3612. int h
  3613.     The height of the window
  3614.     
  3615. int tfgd
  3616.     The fgd color of the title bar
  3617.     
  3618. int tbgd
  3619.     The bgd color of the title bar
  3620.     
  3621. int active
  3622.     Indicates the active status of the window
  3623.     
  3624. char title[48]
  3625.     Contains the text to be used in the title
  3626.     bar
  3627.  
  3628. void *beneath
  3629.     A pointer to memory containing the underlying screen image
  3630.  
  3631. Members - PUBLIC
  3632.  
  3633. Gwindow()
  3634.     The default constructor
  3635.     
  3636. ~Gwindow
  3637.     The default destructor
  3638.     
  3639. void init(int xloc,int yloc,int width,int height,int tfore,
  3640.             int tback,char *text)
  3641.     Call this function to initialize the Gwindow object. The xloc and yloc
  3642.     parameter indicate the upper left corner. Be sure that the specified
  3643.     width and height will not create a Gwindow that is larger than 64K in
  3644.     screen area. The tfore and tback parameter represent the fgd and bgd
  3645.     colors used to draw the title bar, and the *text parameter indicates
  3646.     the text to be displayed in the title bar. 
  3647.  
  3648.     example:    Gwindow gwin;
  3649.                 gwin.init(10,10,200,100,14,1,"Test Window");
  3650.  
  3651. void show()
  3652.     Displays the Gwindow on the screen
  3653.  
  3654. void redraw()
  3655.     Cause the Gwindow object to be redrawn. Do not use this in place of
  3656.     show() 
  3657.  
  3658. void hide()
  3659.     Removes the Gwindow from the screen
  3660.  
  3661. int closeboxhit()
  3662.     Returns 1 if the mouse cursor is currently over the closebox
  3663.  
  3664. int sizecornerhit()
  3665.     Returns 1 if the mouse cursor is currently within 4 pixels of the
  3666.     lower right corner of the Gwindow
  3667.  
  3668. int titlebarhit()
  3669.     Returns 1 if the mouse cursor is currently positioned over the title
  3670.     bar of the Gwindow 
  3671.  
  3672. void resize()
  3673.     Allows the user to interactively resize the Gwindow using the mouse
  3674.  
  3675. void move()
  3676.     Allows the user to interactively move the Gwindow using the mouse
  3677.  
  3678. int write_to_disk()
  3679.     Writes the buffer containing the underlying screen image to disk thus
  3680.     reducing memory consumption. Returns 1 if successful
  3681.  
  3682. int read_from_disk()
  3683.     Reads the underlying screen image from disk and places it in a buffer
  3684.     to be replaced on the screen. Returns 1 if successful 
  3685.  
  3686. int totalGwindow()
  3687.     Returns the number of Gwindows currently in use
  3688.  
  3689.  
  3690.     Gwindow example:    Gwindow gwim;
  3691.                         gwin.init(10,10,300,200,14,1,"Test Window");
  3692.                         gwin.show();
  3693.  
  3694.                         while(!gwin.closeboxhit()) {
  3695.                             if(gwin.sizecornerhit())
  3696.                                 gwin.resize();
  3697.                             if(gwin.titlebarhit())
  3698.                                 gwin.move();
  3699.                             }
  3700.                         gwin.hide();
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.                               GMENU & GMENUBUTTON
  3707.  
  3708.     The Gmenu and Gmenubutton classes has been superceded by the new
  3709. menubar and pulldown classes in version 3.0. The code for Gmenu and
  3710. Gmenubutton is still included in the library for compatibility, but it has
  3711. not been updated since version 2.0. The documentation from v2.0 is also
  3712. included here. 
  3713.  
  3714. Gmenubutton & Gmenu
  3715.  
  3716.         The classes Gmenubutton and Gmenu provide the capabilities for you
  3717. to include pulldown menus in you graphics applications. The
  3718. Gmenubutton is simply the text that will appear in the menu bar
  3719. whereas the Gmenu is the moving bar menu that will pop up when a
  3720. Gmenubutton is selected. Since these two objects are so closely
  3721. related I will discuss them together.
  3722.  
  3723.         The data element gitemarray is a predefined two dimensional
  3724. array containing the strings that will appear in the Gmenu.
  3725. The maximum number of items in a Gmenu is 10, and the width of
  3726. the pop-up menu is fixed at 100 pixels. When initializing the
  3727. strings in the gitemarray always start at index 1 rather than
  3728. index 0. Like this:
  3729.  
  3730.         gitemarray menu1array;
  3731.         strcpy(menu1array[1],"ITEM 1");
  3732.         strcpy(menu1array[2],"ITEM 2");
  3733.         etc...
  3734.  
  3735.         A Gmenubutton is initialized with parameters for x and y screen
  3736. locations, normal state fgd and bgd colors, selected state fgd
  3737. and bgd colors, and the text to be displayed.
  3738.  
  3739.         A Gmenu is initialized with parameters for the x and y screen
  3740. locations, the number of entries to be in the menu, and the
  3741. gitemarray containing the item strings. The Gmenu is popped-up
  3742. with a call to "show()" which returns an integer representing the
  3743. index of the gitemarray the bar was on when the selection was made.
  3744. If no selection was made "show()" returns 11.
  3745.  
  3746.         Let's look at an example to hopefully clear this all up.
  3747.  
  3748.         gitemarray itemarray;
  3749.         Gmenu mymenu;
  3750.         Gmenubutton mymenubutton;
  3751.         int menuchoice;
  3752.  
  3753.         strcpy(itemarray[1],"ITEM 1");
  3754.         strcpy(itemarray[2],"ITEM 2");
  3755.         strcpy(itemarray[3],"ITEM 3");
  3756.         strcpy(itemarray[4],"ITEM 4");
  3757.  
  3758.         setfillstyle(SOLID_FILL,15);        MAKE A MENU BAR AT TOP OF
  3759.                                                         SCREEN
  3760.         bar(0,0,getmaxx(),10);
  3761.  
  3762.         mymenubutton.init(0,0,0,15,15,0,"MENU 1");
  3763.         mymenubutton.show();
  3764.  
  3765.         mymenu.init(0,11,4,itemarray);
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771.         if(the_mouse.LBP()) {
  3772.                 if(mymenubutton.hit()) {
  3773.                         mymenubutton.press();
  3774.                         choice=mymenu.show();
  3775.                         mymenu.hide();
  3776.                         mymenubutton.show();
  3777.                         }
  3778.                 }
  3779.  
  3780.  
  3781.         In this example the integer variable choice will contain the
  3782. number of the item that was selected. Execution can then branch
  3783. to the appropriate functions based on this value using case
  3784. statements.
  3785.  
  3786.  
  3787.  
  3788.  
  3789.  
  3790.             
  3791.                                  OPTION
  3792.  
  3793.     As in the TUI library, the option class is used solely as a piece of
  3794. larger classes, and has little or no functionality on its own. For this
  3795. reason the option class is not documented. 
  3796.  
  3797.  
  3798.  
  3799.  
  3800.  
  3801.                             PULLDOWN
  3802.  
  3803.  
  3804.     The pulldown class is the replacement for the Gmenu class.  Unlike the
  3805. Gmenu, a pulldown object can be navigated with the keyboard, the mouse , or
  3806. both. The programmer also has complete control over the value returned for a
  3807. specific menu choice. The menu can also display separator bars to logically
  3808. group sections of a pulldown object.
  3809.  
  3810. Members - PROTECTED
  3811.  
  3812. friend menubar
  3813.     The menubar which is the parent of the pulldown. Can be NULL
  3814.     
  3815. int nfg
  3816.     The fgd color of an unhighlighted menu option
  3817.     
  3818. int nbg
  3819.     The bgd color of an unhighlighted menu option
  3820.     
  3821. int hfg
  3822.     The fgd color of a highlighted menu option
  3823.     
  3824. int hbg
  3825.     The bgd color of a highlighted menu option
  3826.     
  3827. int shown
  3828.     Indicates the visible status of the pulldown object
  3829.  
  3830. int width
  3831.     The width of the pulldown object
  3832.  
  3833. int height
  3834.     The height of the pulldown object
  3835.  
  3836. int num_options
  3837.     The number of options contained in the pulldown menu
  3838.  
  3839. int part_of_menubar
  3840.     Indicates whether the pulldown object is the child of a menubar
  3841.     object 
  3842.  
  3843. char hotkeys[20]
  3844.     Contains the programmer defined accelerator keys for accessing
  3845.     the pulldown menu 
  3846.  
  3847. int kbtrigger_index
  3848.     The index into the options of the pulldown of the option that
  3849.     is selected using keyboard accelerators 
  3850.  
  3851.  
  3852. Menbers - PUBLIC
  3853.  
  3854. option options[20]
  3855.     The array of options within the pulldown. A pulldown menu is
  3856.     limited to 20 options. 
  3857.  
  3858. void init(int norm_fgd,int norm_bgd,int hi_fgd,int hi_bgd,
  3859.             int xpos,int ypos) 
  3860.  
  3861.     Call this function to initialize the pulldown object after
  3862.     declaring a variable of this type. The norm_fgd and norm_bgd
  3863.     parameters represent the unhighlighted fgd and bgd colors. The
  3864.     hi_fgd and hi_bgd parameters represent the fgd and bgd colors of
  3865.     a highlighted option. xpos and ypos are the left and top
  3866.     coordinates at which the pulldown should be displayed. 
  3867.     
  3868.     example:    pulldown pd;
  3869.                 pd.init(BLACK,WHITE,YELLOW,RED,10,10);
  3870.  
  3871. void set_option(int index,char *text,int ret_value)
  3872.     Adds an option to the menu. Call this function to fill the menu
  3873.     after declarinring and initializing it. The index parameter is
  3874.     the index into the array of options in the pulldown. The *text
  3875.     parameter is the text that you want to be displayed in the menu,
  3876.     and the ret_value is the value that will be returned if this
  3877.     menu option is chosen. To add a separator bar to the menu make
  3878.     the *text parameter a "-" .
  3879.  
  3880.     NOTE: The *text parameter can contain the '&' character to
  3881.         indicate the letter to be underlined and represent the
  3882.         accelerator for that particular option. For instance, to
  3883.         underline the letter 'x' in the word "Exit" and have it
  3884.         serve as an accelerator, enter the text as "E&xit". 
  3885.  
  3886.     example:    pulldown pd;
  3887.                 pd.init(BLACK,WHITE,YELLOW,RED,10,10);
  3888.  
  3889.                 pd.set_option(0,"&Option #1",1);
  3890.                 pd.set_option(1,"&Second Option",2);
  3891.  
  3892. void determine_width_height()
  3893.     Do NOT call this function directly. It is used internally to
  3894.     determine the width and height to display the pulldown based on
  3895.     the strings it will contain.
  3896.  
  3897. void display()
  3898.     Displays the pulldown menu on the screen.
  3899.  
  3900. void position(int xpos,int ypos)
  3901.     Positions the pulldown's upper left corner at xpos,ypos.
  3902.  
  3903. int trackmenu()
  3904.     This is the main engine of the pulldown object. It captures all
  3905.     input both from the keyboard and the mouse. The return value is
  3906.     127 if the ESCAPE key has been hit. Be careful not to duplicate
  3907.     this value with one of your own options. Otherwise, the return
  3908.     value is the value that the programmer has defined in the
  3909.     set_option call for the option that has been selected.
  3910.  
  3911.     example:    pulldown pd;
  3912.                 pd.init(BLACK,WHITE,YELLOW,RED,10,10);
  3913.  
  3914.                 pd.set_option(0,"&Option #1",1);
  3915.                 pd.set_option(1,"&Second Option",2);
  3916.                 
  3917.                 int choice=pd.trackmenu();        
  3918.                 switch(choice) {
  3919.                     case 1:...
  3920.                     case 2:...
  3921.                     }
  3922.  
  3923. void hide()
  3924.     removes the pulldown menu from the screen.
  3925.  
  3926. int is_shown()
  3927.     Returns 1 if the menu is currently displayed, 0 otherwise.
  3928.  
  3929. void adjust_option_widths()
  3930.     Do NOT call this function directly. It is used internally by
  3931.     the class.
  3932.  
  3933. void adjust_pos_to_menubar(int)
  3934.     Do NOT call this function directly. It is used internally by
  3935.     the class.
  3936.     
  3937. int is_part_of_menubar()
  3938.     Returns 1 if the pulldown is the child of a menubar
  3939.     object, 0 otherwise. 
  3940.  
  3941.  
  3942. PULLDOWN NOTE:
  3943.     YOU CAN CAUSE CERTAIN PULLDOWN OPTIONS TO APPEAR IN A UNIQUE
  3944.     COLOR BY CALLING THE self_color(int fgd,int bgd,int hfgd,int
  3945.     hbgd) MEMBER OF THE OPTION CLASS.
  3946.  
  3947.     example:    pulldown pd;
  3948.                 pd.init(1,7,7,1,10,10);
  3949.  
  3950.                 pd.set_option(0,"&Option 1",1);
  3951.                 pd.set_option(1,"&Second Option",2);
  3952.  
  3953.                 pd.options[1].self_color(3,7,7,3);
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.                             MENUBAR
  3961.  
  3962.     A menubar object can serve as a parent to several pulldown
  3963. objects. A menubar is typically a bar across the top of the screen
  3964. with various options which will invoke the appropriate pulldown
  3965. menu.
  3966.  
  3967. Members - PROTECTED
  3968.  
  3969. option *titles[10] 
  3970.     An array of pointers to options which represent the options in
  3971.     the menubar. A menubar can have a maximum of 10 titles. 
  3972.  
  3973. pulldown *pd[10]
  3974.     An array of pointers to pulldowns. A menubar can have a maximum
  3975.     of 10 associated pulldown menus. 
  3976.  
  3977. int nfg
  3978.     The fgd color of an unhighlighted option
  3979.  
  3980. int nbg
  3981.     The bgd color of an unhighlighted option
  3982.  
  3983. int hfg
  3984.     The fgd color of a highlighted option
  3985.  
  3986. int hbg
  3987.     The bgd color of a highlighted option
  3988.  
  3989. int num_titles
  3990.     The number of titles currently in the menubar.
  3991.  
  3992. char hotkeys[10]
  3993.     An array of characters which act as accelerators for the
  3994.     menubar titles.
  3995.  
  3996. int kbtrigger_index
  3997.     The index into the array of titles for the option that was
  3998.     selected by a keyboard accelerator. 
  3999.  
  4000. Members - PUBLIC
  4001.  
  4002. menubar()
  4003.     The default constructor
  4004.  
  4005. ~menubar()
  4006.     The defaule destructor
  4007.  
  4008. void init(int nfg,int nbg,int hfg,int hbg)
  4009.     Call this function to initialize a menubar object after
  4010.     declaring a variable of this type. The 4 parameters represent
  4011.     the normal (unhighlighted) fgd and bgd colors, and the
  4012.     highlighted fgd and bgd colors. 
  4013.  
  4014. void set_title(int index,char *text,pulldown *)
  4015.     Adds a title and an association with a pulldown menu to the
  4016.     menubar. 
  4017.  
  4018.     NOTE: The *text parameter can contain the '&' character to
  4019.     indicate the letter to be highlighted and represent the
  4020.     accelerator for that particular option. For instance, to
  4021.     highlight the letter 'F' in the word "File" and have it
  4022.     serve as an accelerator, enter the text as "&File". 
  4023.  
  4024.     example:    menubar mb;
  4025.                 pulldown pd;
  4026.  
  4027.                 pd.init(BLUE,WHITE,WHITE,BLUE,10,10);
  4028.                 //The xpos and ypos parameters here are irrevelant
  4029.                 //because the pulldown will be positioned by the
  4030.                 //menubar object 
  4031.  
  4032.                 pd.set_option(0,"&Open",1);
  4033.                 pd.set_option(1,"-",0);
  4034.                 pd.set_option(2,"E&xit",2);
  4035.  
  4036.                 mb.init(BLUE,WHITE,WHITE,BLUE);
  4037.                 mb.set_title(0,"&File",&pd);
  4038.  
  4039. void display()
  4040.     Displays a menubar object on the screen
  4041.  
  4042. int trackbar()
  4043.     This is the main engine of the menubar object. It handles all
  4044.     mouse and keyboard input to navigate the menubar. The up and
  4045.     down arrow keys will move the highlight within a single
  4046.     pulldown. The right and left arrow keys will move to the next or
  4047.     previous pulldown. The return value is 127 if the ESCAPE key
  4048.     was hit, or it is the value of the pulldown option as defined
  4049.     by the programmer in the pulldown::set_option call. 
  4050.  
  4051.     example:    menubar mb;
  4052.                 pulldown pd;
  4053.  
  4054.                 pd.init(BLUE,WHITE,WHITE,BLUE,10,10);
  4055.                 //The xpos and ypos parameters here are irrevelant
  4056.                 //because the pulldown will be positioned by the
  4057.                 //menubar object 
  4058.  
  4059.                 pd.set_option(0,"&Open",1);
  4060.                 pd.set_option(1,"-",0);
  4061.                 pd.set_option(2,"E&xit",2);
  4062.  
  4063.                 mb.init(BLUE,WHITE,WHITE,BLUE);
  4064.                 mb.set_title(0,"&File",&pd);
  4065.  
  4066.                 int choice=mb.trackbar();
  4067.                 if(choice==2)
  4068.                     Exit the program
  4069.  
  4070. int hit()
  4071.     Returns 1 if the mouse cursor is currently over the menubar, 0
  4072.     otherwise 
  4073.  
  4074. int mouse_triggered()
  4075.     Returns 1 if the menubar has been activated by clicking the
  4076.     left mouse button while the cursor is positioned over a menubar
  4077.     title, 0 otherwise. 
  4078.  
  4079. int kb_triggered()
  4080.     Returns 1 if the menubar has been activated by a keyboard
  4081.     accelerator, 0 otherwise.
  4082.  
  4083.     NOTE:   The menu is activated from the keyboard by pressing the
  4084.     ALT key along with the highlighted letter from the desired
  4085.     menubar title. For example, if the first titles in a menubar is
  4086.     "&File", it would be activated by presseing ALT-F.
  4087.  
  4088. int triggered()
  4089.     Returns mouse_triggered() | kb_triggered()
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.                             SOUNDQ
  4096.  
  4097.     The SoundQ class is useful for having the computer make sounds or play
  4098. music in the background, allowing foreground processing to continue 
  4099. undisturbed.  Most of the functions affecting this class are actully not 
  4100. part of the class.  This is because they act on data through an interrupt 
  4101. procedure which is not part of the class itself.  
  4102.  
  4103. Members - PROTECTED 
  4104.  
  4105. float speed_factor 
  4106.     This value represents a speed factor representing the speed of the
  4107.     sound playback.  The default play back speed is 1.
  4108.  
  4109. Members _ PUBLIC 
  4110.  
  4111. SoundQ(); 
  4112.     The default constructor.
  4113.  
  4114. ~SoundQ(); 
  4115.     The default destructor.
  4116.  
  4117. void play(int freq, int duration); 
  4118.     Places a note at the specified frequency and duration into the sound
  4119.     queue for playback.  The sound queue will begin playing immediately 
  4120.     and will continue as long as there are notes available in the queue.
  4121.     Use the values defines in TUI.H to more easily specify the freq and
  4122.     duration parameters.
  4123.  
  4124.     example:    SoundQ sq;
  4125.                 sq.play(C,HN);
  4126.                 sq.play(D,HN);
  4127.                 sq.play(E,HN);
  4128.                 sq.play(F,HN);
  4129.                 sq.play(G,HN);
  4130.                 sq.play(A,HN);
  4131.                 sq.play(B,HN);
  4132.                 sq.play(C*2,HN);
  4133.  
  4134.     This example plays a C scale in half notes.
  4135.  
  4136. void adjust_speed(float);
  4137.     Sets the speed factor at which to play back the sound.  The default
  4138.     value is 1. To cause the speed of the music to double call
  4139.     adjust_speed()with a parameter of 2.
  4140.  
  4141. Functions - THESE APPEAR OUTSIDE OF THE CLASS BODY 
  4142.  
  4143. void empty_sound_queue();
  4144.     Empties all notes out of the queue and causes the sound to stop
  4145.     immediately.
  4146.  
  4147. void init_sound(); 
  4148.     Do NOT call this function.  It is called by the default constuctor.
  4149.  
  4150. void restore_sound();
  4151.     Do NOT call this function.  It is called by the destructor.
  4152.  
  4153. int submit_sound(int freq,int duration);
  4154.     Do NOT call this function.  It is called by the play() member function.
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.                                 SCREEN
  4161.  
  4162.     The screen class is provided to simplify placing the display into
  4163. various graphics modes. If you wish to use the more traditional
  4164. initgraph() function for this purpose that is perfectly acceptable.
  4165.  
  4166. Members - PUBLIC
  4167.  
  4168. int VGA_480_16()
  4169.     Places the display into 640x480 16 color resolution
  4170.  
  4171. int VGA_350_16()
  4172.     Places the display into 640x350 16 color resolution
  4173.  
  4174. int VGA_200_16()
  4175.     Places the display into 320x200 16 color resolution
  4176.  
  4177. int VGA-200_256()
  4178.     Places the display into 320x200 256 color resolution
  4179.  
  4180. void fill(int color)
  4181.     Fills the screen with the specified color.
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.                             LISTBOX
  4188.                             
  4189.     A listbox object can be used similarly to a pulldown menu to
  4190. make a single selection from a list of options. Unlike a pulldown,
  4191. a listbox has the capability to scroll, so that it may contain
  4192. many more options than are currently visible on the screen. The
  4193. listbox maintains and navigates a list of optionrec structures
  4194. which represent the options in the list.
  4195.  
  4196. Members - PROTECTED
  4197.  
  4198. option *entry
  4199.     A pointer to the current option
  4200.  
  4201. int index   
  4202.     The current index into the list
  4203.  
  4204. optionrec *next
  4205.     A pointer to the next option in the list
  4206.  
  4207. optionrec *previous
  4208.     A pointer to the previous item in the list
  4209.  
  4210. optionrec *listroot
  4211.     The root of the list of optionrecs
  4212.  
  4213. optionrec *listend
  4214.     The end of the list of optionrecs
  4215.  
  4216. optionrec *currentsel
  4217.     A pointer to the currently selected optionrec
  4218.  
  4219. Bevel box
  4220.     The Bevel object which serves as the frame for the listbox
  4221.  
  4222. Button *up,*down,*pageup,*pagedown
  4223.     Pointers to the buttons which control the navigation of the list
  4224.  
  4225. Panel *controlpanel
  4226.     The Apnel object which contains the control buttons
  4227.  
  4228. int should_show_controls
  4229.     Indicates whether or not the navigation buttons need to be shown
  4230.  
  4231. int should_save_bgd
  4232.     Indicates whether or not the underlying image should be sabved in a
  4233.     buffer 
  4234.  
  4235. int selected_index
  4236.     The index into the list of the currently selected option
  4237.  
  4238. char *selected_string
  4239.     The text of the currently selected option
  4240.  
  4241. int option_string_length
  4242.     The length of the strings in the list
  4243.  
  4244. int changed
  4245.     Represents the status of the listbox
  4246.  
  4247. int size_forced
  4248.     Represents whether the listbox has sized itself, or the
  4249.     programmer has determined the size at which to display. 
  4250.  
  4251. int forced_width
  4252.     The width that the programmer has determined for the listbox
  4253.  
  4254. int forced_height
  4255.     The height that the programmer has determined for the listbox
  4256.  
  4257. Members _ PUBLIC
  4258.  
  4259. listbox()
  4260.     The default constructor
  4261.  
  4262. ~listbox()
  4263.     The default destructor
  4264.  
  4265. void init(int xpos,int ypos,int num_displayed,int savebgd=0)
  4266.     Call this function to initialize a listbox object. The xpos and
  4267. ypos parameter are the upper left screen coordinates. The
  4268. num_displayed value is the number of options that can be displayed
  4269. in the listbox, NOT the number that it can hold, only the number
  4270. that it can display at one time. The winfgd and winbgd parameters
  4271. are the fgd and bgd colors of the window and unhighlighted
  4272. options. The hfgd and hbgd parameters are the fgd and bgd colors of
  4273. a highlighted option.If the savebgd parameter is non-zero the underlying
  4274. screen image will be saved before drawing the listbox. This value is 0 by
  4275. default. 
  4276.  
  4277.     example:    listbox lb;
  4278.                 lb.init(5,5,5);
  4279.                 
  4280. void force_size(int width,int height)
  4281.     By default a listbox will determine the width
  4282.     and height at which it should be displayed. Use this function to
  4283.     override these default value and force it to be displayed at a
  4284.     chosen size. 
  4285.  
  4286. void set_highlight_position(int index)
  4287.     Moves the highlight to the position specified in index.
  4288.  
  4289. void append_item(char *text)
  4290.     Use this function to add strings to the listbox. Strings can
  4291.     only be added to the end of the list. 
  4292.  
  4293.     example:    listbox lb;
  4294.                 lb.init(5,5,3,15,1,1,7);
  4295.  
  4296.                 lb.append_item("Item Number 1");
  4297.                 lb.append_item("Second Item");
  4298.  
  4299. void show()
  4300.     Displays the listbox on the screen
  4301.  
  4302. void show_options(int index)
  4303.     Used internally to show a particular segment of the list
  4304.  
  4305. void hide()
  4306.     Removes the listbox from the screen.
  4307.  
  4308. void scroll_list_up()
  4309. void scroll_list_down()
  4310.     Used internally to position the list within the listbox
  4311.  
  4312. int tracklist()
  4313.     The main engine of the listbox object. Captures all keyboard
  4314.     and mouse input and adjusts the appearance of the listbox
  4315.     accordingly. The return value is 1 if successful, 0 otherwise.
  4316.  
  4317.     example:    listbox lb;
  4318.                 lb.init(5,5,3);
  4319.  
  4320.                 lb.append_item("Item Number 1");
  4321.                 lb.append_item("Second Item");
  4322.                 
  4323.                 int choice=lb.tracklist();
  4324.  
  4325. int options_displayed
  4326.     The number of options currently displayed
  4327.  
  4328. int options_in_list
  4329.     The number of options currently in the list
  4330.  
  4331. int option_width
  4332.     The width if the strings in the list
  4333.  
  4334. int shown
  4335.     The current visible status
  4336.  
  4337. int nfg
  4338.     The fgd color of an unhighlighted option
  4339.  
  4340. int nbg
  4341.     The bgd color of an unhighlighted option
  4342.  
  4343. int hfg
  4344.     The fgd color of a highlighted option
  4345.  
  4346. int hbg
  4347.     The bgd color of a highlighted option
  4348.  
  4349. int index_at_top
  4350.     The index into the list of the option currently displayed at
  4351.     the top of the list.
  4352.  
  4353. int index at bottom
  4354.     The index into the list of the option currently displayed at
  4355.     the bottom of the list.
  4356.  
  4357. int hit()
  4358.     Returns 1 if the mouse cursor is currently positioned over the
  4359.     listbox, 0 otherwise. 
  4360.  
  4361. int is_current_index()
  4362.     Returns the index into the list of the currently selected option
  4363.  
  4364. char *is_current_string()
  4365.     Returns a pointer to the string of the option that is currently
  4366.     selected 
  4367.  
  4368. int is_selected_index()
  4369.     Returns the index into the list of the selected option
  4370.  
  4371. char *is_selected_string()
  4372.     Returns a pointer to the string of the selected option
  4373.  
  4374. void deactivate()
  4375.     Turns off the highlighting of the selected option
  4376.  
  4377. void reactivate()
  4378.     Turns on the highlighting for the currently selecting option
  4379.  
  4380. int active
  4381.     Indicates the current status
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.                             DIRBOX
  4389.  
  4390.     The dirbox object provides a convenient way to access the
  4391. directory and file structure of a disk. Because of the large
  4392. memory requirements of the dirbox, it should be contained to a very
  4393. small scope so as not to interfere with the other parts of the
  4394. application.
  4395.  
  4396. Members _ PROTECTED
  4397.  
  4398. Bevel *box
  4399.     The frame of the dirbox
  4400.     
  4401. listbox *drive
  4402.     listbox containing the available drives
  4403.     
  4404. listbox *directory
  4405.     listbox containing the available directories         
  4406.  
  4407. Button *OK
  4408.     The OK button
  4409.  
  4410. Button *CANCEL
  4411.     The CANCEL button
  4412.  
  4413. char fullpath[]
  4414.     The current path displayed in the dirbox
  4415.  
  4416. char returnpath[]
  4417.     The path, including the filename and extension that will be
  4418.     returned to the caller 
  4419.  
  4420. Gstring *filename
  4421.     The currently selected filename
  4422.  
  4423. int shown
  4424.     Indicates the current status
  4425.  
  4426. int turn
  4427.     A counter representing the region of the dirbox that currently
  4428.     has the input focus 
  4429.  
  4430. char dirmask[]
  4431.     A mask used to determine which files are listed in the dirbox
  4432.  
  4433. int intnumber
  4434.     The value of the "Abort, Retry, Fail" interrupt
  4435.  
  4436. void interrupt (*)(...)
  4437.     A pointer to the "Abort, Retry, Fail" interrupt
  4438.  
  4439. Members - PUBLIC
  4440.  
  4441. dirbox()
  4442.     The default constructor
  4443.  
  4444. ~dirbox()
  4445.     The default destructor
  4446.  
  4447. void show()
  4448.     Displays the dirbox on the screen
  4449.  
  4450. void hide()
  4451.     Removes the dirbox from the screen
  4452.  
  4453. char *trackdir()
  4454.     The main engine of the dirbox object. Captures all mouse and
  4455.     keyboard input and updates the internal variables accordingly.
  4456.     The return value is a pointer to the currently selected file. 
  4457.  
  4458.     example:    {
  4459.                     dirbox db;
  4460.                     char file[MAXPATH];
  4461.                     strcpy(file,db.trackdir());
  4462.                 }
  4463.  
  4464.     NOTE: The above section of code is enclosed in its own braces
  4465.             to limit the scope of the dirbox object and keep a
  4466.             maximum amount of memory available for the application.
  4467.  
  4468. void print_current_path()
  4469.     Used internally to display the current path
  4470.  
  4471. void change_directory(char *)
  4472.     Used Internally
  4473.  
  4474. void fill_directory_list()
  4475.     Used internally to populate the list of available directories
  4476.  
  4477. void fill_drive_list()
  4478.     Used internally to populate the list of available drives
  4479.  
  4480. void set_mask(char *mask)
  4481.     Use this function to specify a mask for a particular file type.
  4482.     By defaule this mask is "*.*"
  4483.  
  4484. static void interrupt _handler(...)
  4485.     This handler is responsible for printing an error if the disk
  4486.     is not ready in the currently selected drive.
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.                                     MESSAGEBOX
  4496.  
  4497.     The messagebox class is used to provide a way of displaying a message
  4498. to the user and allowing the user to answer questions in a simple Yes/No
  4499. or OK/Cancel manner.
  4500.  
  4501.  
  4502. Members - PROTECTED
  4503.  
  4504. Button *OK,*CANCEL,*YES,*NO
  4505.     Pointers to the various buttons which can appear in the messagebox     
  4506.  
  4507. char bit
  4508.     bitwise indicator of the type of messagebox
  4509.  
  4510. int border_color
  4511.     The border color
  4512.  
  4513. int fill_color
  4514.     The interior color
  4515.  
  4516. int text_color
  4517.     The text color
  4518.  
  4519. int OKbutton,
  4520. int CANCELbutton,
  4521. int YESbutton,
  4522. int NObutton,
  4523.     Indicators of the chosen button
  4524.  
  4525. char *str
  4526.     The text to be displayed on the messagebox
  4527.  
  4528. Members - PUBLIC
  4529.  
  4530. messagebox()
  4531.     The default constructor
  4532.     
  4533. ~messagebox()
  4534.     The default destructor
  4535.     
  4536. int show(char *text,char bitfield)
  4537.     Use this function to display the messagebox and retrieve
  4538.     user input. The *text parameter is the text to be displayed. The
  4539.     bitfield parameter represents the type of messagebox to create, OK and
  4540.     CANCEL, OK, CANCEL, or YES and NO. Use the global #defines in GUI.H to
  4541.     specify this value. Returns an int specifying which option was chosen.
  4542. Compare this value to the #defines in GUI.H 
  4543.  
  4544.     example:    messagebox mb;
  4545.                 if(mb.show("File Error! Continue?",MB_YESNO)==ID_YES)
  4546.                     continue;
  4547.                 else
  4548.                     exit(0);
  4549.  
  4550.  
  4551. void hide();
  4552.     Removes a messagebox from the screen
  4553.  
  4554.  
  4555.     NOTE: A helper function exists which allows the programmer to institue
  4556. a messagebox  without declaring one first. Simply call
  4557.     
  4558.         MessageBox(char *,char)
  4559.  
  4560. from within your code with the same parameters you would supply to
  4561. messagebox::show.
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.                              SCROLLBAR     
  4571.  
  4572.     The scrollbar object is used to visually control the contents
  4573. of a particular screen area, allowing the user to manipulate the
  4574. screen by changing the position of the scrollbar. It is important
  4575. for the programmer to remember that the scrollbar object does not
  4576. manipulate the screen in any way on its own, it merely returns a
  4577. value which must be used by the programmer to make any necessary
  4578. changes in display.
  4579.  
  4580.     
  4581. Members - PROTECTED
  4582.  
  4583. Button *thumbpad
  4584. Button *increase
  4585. Button *decrease
  4586.     Pointers to Button objects which represent the thumbpad and the
  4587.     buttons at the ends of the scrollbar used for changing the
  4588.     scrollbar's value.
  4589.  
  4590. Panel *rect
  4591.     The main body of the scrollbar
  4592.  
  4593. int vertical
  4594.     Represents the orientation of the scrollbar.
  4595.  
  4596. int width
  4597.     The width of the scrollbar
  4598.  
  4599. int height
  4600.     The height of the scrollbar
  4601.  
  4602. int length
  4603.     The total overall length of the scrollbar object
  4604.  
  4605. int small_d
  4606.     The amount that the scrollbar's value will change if one of the
  4607.     end buttons is pressed. 
  4608.  
  4609. int large_d
  4610.     The amount that the scrollbar's value will change if it is
  4611.     clicked between the thumbpad and one of the end buttons. 
  4612.  
  4613. long minimum
  4614.     The minimum value of the scrollbar
  4615.  
  4616. long maximum
  4617.     The maximum value of the scrollbar
  4618.  
  4619. long value
  4620.     The current value of the scrollbar
  4621.  
  4622. int changed
  4623.     Indicates the status of the scrollbar
  4624.  
  4625. int _SCROLLWIDTH
  4626.     The default width os all scrollbars
  4627.  
  4628. Members _ PUBLIC
  4629.  
  4630. void init(int xpos,int ypos,int length,int vert,long min,long max,
  4631.             int scrollwidth) 
  4632.     Call this function to initialize a scrollbar object. The xpos
  4633.     and ypos parameters are the left and top coordinates of the
  4634.     scrollbar. Length represents the number of screen characters
  4635.     long to make the scrollbar. Use the global #defines HORIZONTAL
  4636.     and VERTICAL for the vert parameter, The min and max parameters
  4637.     represent the range of the scrollbar's value. The scrollwidth
  4638.     parameter represents the width of the scrollbar. 
  4639.  
  4640.     example:    scrollbar sb;
  4641.                 sb.init(10,5,100,VERTICAL,0,100,20);
  4642.  
  4643. int get_scrollwidth()
  4644.     Returns the width of the scrollbar
  4645.  
  4646. int button_widths()
  4647.     Returns the widths of the end buttons and the thumbpad combined
  4648.  
  4649. void show()
  4650.     Displays the scrollbar on the screen.
  4651.     
  4652. int thumbpad_hit()
  4653.     Returns 1 if the mouse cursor is currently positioned over
  4654.     the thumbpad, 0 otherwise. 
  4655.  
  4656. int decrease_hit()
  4657.     Returns 1 if the mouse cursor is currently positioned over the
  4658.     top button of a VERTICAL scrollbar or the left button of a
  4659.     HORIZONTAL scrollbar, 0 otherwise.  
  4660.  
  4661. int increase_hit()
  4662.     Returns 1 if the mouse cursor is currently positioned over the
  4663.     bottom button of a VERTICAL scrollbar or the right button of a
  4664.     HORIZONTAL scrollbar, 0 otherwise.  
  4665.  
  4666. int hit()
  4667.     Returns 1 if the mouse cursor is positioned over the scrollbar
  4668.     object, 0 otherwise.
  4669.  
  4670. void track_scrollbar()
  4671.     Captures all mouse input into the scrollbar and adjusts its
  4672.     appearance and value accordingly. 
  4673.  
  4674.     example:    scrollbar sb;
  4675.                 sb.init(10,5,100,VERTICAL,0,100,20);
  4676.  
  4677.                 while(!the_mouse.RBP()) {
  4678.                     if(sb.hit())
  4679.                         sb.track_scrollbar();
  4680.                     }
  4681.  
  4682. long get_value()
  4683.     Returns the current value of the scrollbar.
  4684.  
  4685. int value_changed()
  4686.     Returns 1 if the value of the scrollbar has changed since the
  4687.     last call to get_value(). 
  4688.  
  4689. void set_small_d(int val)
  4690.     Sets the amount to change the value of the scrollbar if the end
  4691.     buttons are clicked. This value is 1 by default. 
  4692.  
  4693. void set_large_d(int val)
  4694.     Sets the amount to change the value of the scrollbar if the
  4695.     users clicks between the thumbpad and one of the end buttons.
  4696.     This value is 10 by default. 
  4697.  
  4698. void set_maximum(long val)
  4699.     Sets the value to be used as the maximum scrollbar value
  4700.  
  4701. void set_minimum(long val)
  4702.     Sets the value to be used as the minimum scrollbar value
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.                                 PCX
  4709.  
  4710.     The PCX class provides the capability to load and display both 16 and
  4711. 256 color .PCX files.   Note that of you display 2 or more .PCX files
  4712. on the scrren at one time, they must all have the same palette. Otherwise
  4713. the palette of the most recently loaded file will corrupt the palette of
  4714. the previously loaded files.
  4715.  
  4716. Members - PUBLIC
  4717.  
  4718. PCX()
  4719.     The default constructor
  4720.     
  4721. ~PCX()
  4722.     The default destructor
  4723.     
  4724. void init(char *file,int xloc,int yloc)
  4725.     Call this function to load the specified file from disk and
  4726.     initialize the upper left corner to xloc,yloc 
  4727.  
  4728. void show(int xpos=0,int ypos=0)
  4729.     Displays the PCX file at the specified coordinates. 0,0 by default
  4730.  
  4731. int is_256_color()
  4732.     Returns 1 if the loaded .PCX file is a 256 color image
  4733.  
  4734.  
  4735.     PCX example:    PCX pcx;
  4736.                     pcx.init("TEST.PCX",0,0);
  4737.                     pcx.show();
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.     This completes the documentation of the GUI portion of the ObjectEase
  4746. libraries.
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.                                 VIDBIOS
  4755.  
  4756.         The remaining functions are all part of the VIDBIOS library.
  4757.  
  4758. void set_default_palette();
  4759.         Sets all palette values to their initial values.
  4760.  
  4761. void blankcolor(int);
  4762.         Sets the palette values of the color specified to 0,0,0. In other
  4763.         words to BLACK.
  4764.  
  4765. void fade1_3();
  4766.         Fades any object or text displayed from color 1, BLUE, to color 3,
  4767.         CYAN.
  4768.  
  4769. void fade3_1();
  4770.         Fades any object or text displayed from color 3, CYAN, to color 1,
  4771.         BLUE.
  4772.  
  4773. void fade1_4();
  4774.         Fades any object or text displayed from color 1, BLUE, to color 4,
  4775.         RED.
  4776.  
  4777. void fade4_1();
  4778.         Fades any object or text displayed from color 4, RED, to color 1,
  4779.         BLUE.
  4780.  
  4781. void fade1_5();
  4782.         Fades any object or text displayed from color 1, BLUE, to color 5,
  4783.         MAGENTA.
  4784.  
  4785. void fade5_1();
  4786.         Fades any object or text displayed from color , MAGENTA, to color
  4787.         1, BLUE.
  4788.  
  4789. void fadein(int color);
  4790.         Fades the specified color from 0,0,0, (BLACK) to its normal
  4791.         palette value.
  4792.  
  4793. void fadeout(int color);
  4794.         Fades the specified color from its normal palette value to 0,0,0
  4795.         (BLACK).
  4796.  
  4797. void rgb(int color,int R,int G,int B);
  4798.         Sets the specified color to the specified values of Red, Green,
  4799.         and Blue. Valid RGB values are from 0 to 63.
  4800.  
  4801. void make_grayscale();
  4802.         Resets the normal palette to its grayscale equivalents.
  4803.  
  4804. void screenbord(int);
  4805.         Makes the screen border the color specified.
  4806.  
  4807. void disable_blink();
  4808.         Disables the ability to make characters blink, however, this
  4809.         allows you to use colors 8 through 15 as background colors in text
  4810.         mode.
  4811.  
  4812. void enable_blink();
  4813.         Restores the ability to make characters blink, however, colors 8
  4814.         through 15 will not be available for use as background colors in
  4815.         the text mode.
  4816.  
  4817. void disable_refresh();
  4818.         Disables the video refresh, effectively blanking the screen.
  4819.  
  4820. void enable_refresh();
  4821.         Enables the video refresh, restoring a screen blanked by a call to
  4822.         disable_refresh().
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.