home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / HP95_100 / P_GRAMG / HPCLIB / HPCLIB.DOC < prev    next >
Encoding:
Text File  |  1994-09-07  |  7.3 KB  |  209 lines

  1. ----------------------------------------------------------------
  2.  HP100LX WINDOWS ENVIRONMENT C-LIBRARY. vr2.1      Sept. 5,1994.
  3. ----------------------------------------------------------------
  4.  
  5.  
  6.  This is a small C library for creating HP100LX applications
  7. with menus & windows which have the same look as the built-in
  8. ones. The reason I wrote this library is to be able to create
  9. regular (.COM / .EXE) programs that have the same environment
  10. as the built-in programs.
  11.  
  12.  
  13. What's new:   FULLY AUTOMATIC MENU ENVIRONMENT.
  14. -----------
  15.  
  16. This version has a powerfull function that takes complete
  17. control over the menu environment. This function, navigate()
  18. takes care of the complete menu system. The way it works, is
  19. you must call it periodically, and it will check if the menu
  20. or alt key is pressed. If it's not it returns a 0 (null). If
  21. the menu is pressed it will open the menu bar and wait for
  22. further control from the user. At the mean time it returns
  23. (0xff) to notify the rest of the program that the menu is
  24. activated. If a selection is made (pressing enter in an option
  25. of the menu) it will return the menu# and option# of that menu
  26. and close the active menu & menubar. So the only thing you
  27. must specify in your program is the text that goes into the
  28. menus. The rest is done automatically, even the sizing and
  29. position of the menus.
  30.  
  31. See DEMO.C for more details on how to use this automatic environment.
  32. While running DEMO.COM press MENU to navigate through the menus
  33. and ENTER to select an option inside a menu.
  34.  
  35.  There are 10 files in this .ZIP package:
  36.  
  37.  HPCLIB.C      File ready to be compiled for creating a stand
  38.                alone library. Can not be included in a program.
  39.  
  40.  HPCLIB.MIX    Power C pre-compiled library. *See note.
  41.  
  42.  HPCLIB.H      Header file to be included in your programs.
  43.  
  44.  HPWENV.C      Source file that can be included in your programs
  45.                if you don't create a library with HPCLIB.C
  46.  
  47.  HPCLIB.DOC    This 'read.me' file.
  48.  
  49.  HPCLIB.GDB    All the functions of the HPGRAPH library are
  50.                listed with examples in .GDB (HP100LX database)
  51.                format for reference.
  52.  
  53.  FUNCTION.DOC  Same as HPGRAPH.GDB but in ASCII format.
  54.  
  55.  DEMO.C        Demo C-source file demonstrating the use of
  56.                the functions. NOTE: If you create a stand
  57.                alone library with the file HPCLIB.C, remove
  58.                the #include "hpwenv.c" line #45 from the
  59.                demo.c file.
  60.  
  61.  DEMO.EXE      The compiled, executable interactive demo
  62.                file that you must run to see what the
  63.                library can do for you.
  64.  
  65.  DEMO2.EXE     This is another demo showing you how to
  66.                control the menu environment manually.
  67.  
  68. * Note:
  69.  
  70.   For those interested, here's the compiler I used to create
  71.  and compile the included programs with the HP100LX:
  72.  
  73.           --------------------------
  74.            The Power C compiler, by:
  75.           --------------------------
  76.             MIX SOFTWARE INC.
  77.             1132 Commerce dr.
  78.             Richardson, TX 75081
  79.             U.S.A.
  80.             Cost= $29.95 book incl.
  81.             Phone: (214)783-6001
  82.  
  83.       
  84.  The HPGRAPH.GDB file is a reference database of the HPGRAPH
  85. functions in GDB database format.
  86.  
  87.  The FUNCTION.DOC file is an ASCII reference of the HPGRAPH
  88. functions, and was created by the HP100LX smart-clip function.
  89. All the information about the functions is included in this
  90. file in alphabetical order.
  91.  
  92.  
  93. Using the functions:
  94. --------------------
  95.  
  96.  Creating a windows environment for your programs with this
  97. library is very easy. The only thing you have to define is
  98. the text that goes into the menus and the menu bar, and the
  99. rest is done automatically: Positioning & sizing of the menus,
  100. selection in the menubar and menus, saving screen contents
  101. and restoring them when closing menus & windows, etc...
  102.  
  103.  
  104. Here's a brief description:
  105.  
  106.  
  107. 1) To define the menus, all you have to do is write it in the
  108.    following syntax:
  109.  
  110. MENUITEMS ={
  111.  
  112. /* menu1 */ {"Load   F2","Save  F10"},
  113. /* menu2 */ {"Edit   F3","Insert F4","Delete F5"},
  114. /* menu3 */ {"Quit   F8"},
  115. /* menu4 */ {"Help   F1","About"}};
  116.  
  117. In this example, we have 4 menus. Up to 8 menus may be defined,
  118. with 10 options maximum per menu. Menu2 here, has 3 options.
  119.  
  120.  
  121.                         *******
  122.  
  123.  
  124. 2) To define a menubar, use the following syntax:
  125.  
  126. MENUBARMSG ="File  Edit  Search  Quit  Help ";
  127.  
  128.  
  129. The rest is done automatically. By using the navigate()
  130. function, the menu navigation takes care by itself. The
  131. navigate() function will return to you the following codes:
  132.  
  133. 0x00: menu not active.
  134. 0xff: menu in navigation process by the user.
  135.  
  136. 0x01-ef0: coded menu# and option# within the menu. The most
  137.           significant bits (4-7) is the menu#, the least
  138.           Significant bits (0-3) is the option#.
  139.  
  140.  
  141.   By studying the demo.c file, you will be able to create a
  142. window & menu environment template in minutes for any of
  143. your programs. Creating windows is also very easy. Up to
  144. 8 windows can be opened at the same time, which is more than
  145. enough, considering that the built-in applications of the
  146. HP100LX don't open more than 3 windows at the same time.
  147. See DEMO.C for more details.
  148.  
  149.  
  150. About the library
  151. -----------------
  152.  
  153.  Most of the above files were written on a 2MB HP100LX. Some
  154. of the newer functions are written on a HP200LX.
  155.  
  156.  I could have included the .OBJ object code of the library,
  157. but the compiler I'm usnig compiles object files to
  158. .MIX which isn't compatible with Microsoft's .OBJ format.
  159. So I just included the .MIX object file.
  160.  
  161.  I had many complains about the way my compiler handles the
  162. ASM function. For the moment I haven't found another way
  163. to replace this function with something else. The reason
  164. I HAD to use this function is for only ONE routine that
  165. needed to pass arguments to the BP register. The INT86 and
  166. INT86X functions DO NOT support the BP register. If someone
  167. is able to find another way of writing that part of the
  168. code so it can be more standard, PLEASE let me know. It's
  169. too bad that many people can't use the library because of that.
  170. You may also find other functions that your compiler won't
  171. support in the exact same manner as the Power C compiler.
  172. In the future I might convert this library to a Microsoft
  173. or Borland compatible library.
  174.  
  175.  
  176.                          -----
  177.  
  178.  
  179.  Future uploads will include Entry screens, and other functions.
  180. If you need any other information you can reach me at the HPHAND
  181. forum of CompuServe. I try to LOG on daily.
  182.  
  183.  
  184.   My name: Harry Konstas
  185.   CIS I.D. 72540,620
  186.  
  187.  
  188.   Have fun!
  189.  
  190.  
  191. ________________________________________________________________
  192. Special Notes:
  193.  
  194.  
  195. 1) If your C compiler doesn't have the FP_SEG & FP_OFF macros
  196.    defined, add the following to your program:
  197.  
  198.         #define FP_SEG(farptr) (*((unsigned *)&(farptr) + 1))
  199.         #define FP_OFF(farptr) (*((unsigned *)&(farptr)))
  200.  
  201. 2) Ofcourse, I can not be held responsible for any possible
  202.    dataloss by the use of this library. I've taken care so
  203.    there are no bugs in the code, but nothing's perfect. I
  204.    wrote this library for my own use and I'm happy to share
  205.    it with others. All the files that came in this ZIP
  206.    package are freeware and not to be sold to anyone. Please
  207.    distribute them free of charge.
  208.  
  209.