home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / HP95_100 / P_GRAMG / HPCLIB / HPCLIB.GDB (.txt) < prev    next >
Encoding:
HP Phone/Database/Note  |  1994-09-07  |  13.0 KB  |  315 lines

  1. HPGRAPH Library REF.
  2. vr2.0 by H.K. 07/94
  3. Function
  4. function type
  5. Arguments
  6. Descr.
  7. 9All Database Items
  8. Checks if the computer is an HP100LX. If it is NOT
  9. an HP100LX it will display a 'This program runs only
  10. on the HP100LX palmtop' and then quit the program.
  11. IS100
  12. system
  13. void is100(void);
  14. Places the string argument on the first (top) line
  15. of the display in reverse video.
  16. toplin("This is the status line");
  17. TOPLIN
  18. display
  19. void toplin(char far *string);
  20. Places the announciators to the left or right of the
  21. screen. 
  22. The position argument may be: AN_LEFT or AN_RIGHT.
  23. ex:  
  24. announ(AN_LEFT); /* places announciators left */
  25. ANNOUN
  26. display
  27. void announ(int position);
  28. Sets the HP100LX in 640x200 BW graphics mode.
  29. SETGRA
  30. low level graphics
  31. void setgra(void);
  32. Places the 'key-labels' on the last (bottom) line of
  33. the screen. The string must have the following format:
  34. char botmes[]={
  35. " Help   Find    Next   Last   "
  36. " All    Edit    Add    Quit   "
  37. " PgUp   PgDn  "};
  38. botlin(botmes);
  39. BOTLIN
  40. display
  41. void botlin(char far *labels);
  42. Sets the HP100LX back to text 80x25 (CGA) mode.
  43. SETMDA
  44. low level graphics
  45. void setmda(void);
  46. Sets the text font (size) for the text to be displayed.
  47. The size argument can be: 
  48.  SMALL_FONT  for small text size (80x25)
  49.  MEDIUM_FONT for medium text size (64x18)
  50.  LARGE_FONT for large text size (40x16)
  51. setfon(MEDIUM_SIZE);  /* set to medium size */
  52. SETFON
  53. low level graphics
  54. void setfon(int size);
  55. Sets the current pen position to the horiz,vert coordinates. The horiz argument must be between [0-639]
  56. and the vert argument between [0-199].
  57. setpos(10,20); /* sets the pen position to x=10,y=20 */
  58. SETPOS
  59. low level graphics
  60. void setpos(int horiz,int vert);
  61. Sets the pen color. The color argument can be:
  62.  BLACK_COLOR  for black (pixels on).
  63.  WHITE_COLOR  for white (pixels off).
  64. setcol(BLACK_COLOR); /* sets pen to black */
  65. SETCOL
  66. low level graphics
  67. setcol(int color);
  68. Sets the graphics rule. The rule argument may be one
  69. of the following:
  70.  FORCE_RULE   force pixel on screen 
  71.  AND_RULE     pixel AND screen -> screen 
  72.  OR_RULE      pixel OR screen -> screen
  73.  XOR_RULE     pixel XOR screen -> screen
  74.  INVFOR_RULE  pixel NOT FORCE screen -> screen
  75.  INVAND_RULE  pixel NOT AND screen -> screen
  76.  INVOR_RULE   pixel NOT OR screen -> screen
  77.  INVXOR_RULE  pixel NOT XOR screen -> screen
  78.  TXT_RULE     force text on screen
  79. setrul(FORCE_RULE); /* sets the forced rule */
  80. SETRUL
  81. low level graphics
  82. void setrul(int rule);
  83. Sets the graphics line type. The line_type argument
  84. may be an integer value between [0-65535].
  85. setlin(0x5555); /* set dotted line */
  86. SETLIN
  87. low level graphics
  88. void setlin(unsigned int line_type);
  89. Sets the fill mask. The fill pattern may be used to
  90. create filled boxes.
  91. char fmask[]=
  92. {'\x55','\xaa','\x55','\xaa','\x55','\xaa','\x55','\xaa', '\x0'};
  93. setmsk(fmask); /* set dotted fill pattern */
  94. SETMSK
  95. low level graphics
  96. void setmsk(char far *fill_mask);
  97. Puts the image that was previously saved by the 'getimg'
  98. function, to the position horiz,vert of the screen.
  99. The rule argument is the graphics replacement rule
  100. (see setrul function for details). The buffer argument
  101. is a pointer that points to the buffer that has the saved
  102. image. This function is used by the window creation
  103. functions.
  104. PUTIMG
  105. low level graphics
  106. void putimg(int horiz,int vert,int rule,char far *buffer);
  107. Saves an image square to the memory.
  108. The top left corner of the image is pointed by
  109. the from_horiz and from_vert arguments. The bottom
  110. right corner is pointed by the to_horiz and to_vert
  111. arguments. The buffer argument is a pointer pointing
  112. to a block of memory where the image will be saved.
  113. GETIMG
  114. low level graphics
  115. getimg(int from_horiz,int from_vert,int to_horiz,int to_vert,char far *buffer);
  116. Writes a string into the graphics screen at the
  117. horiz,vert coordinates. 
  118. wrtext(100,150,"This is a string.");
  119. /* This writes 'This is a string' at x=100, y=150
  120.    position. Use the setfon function to set the size
  121.    of the characters. */
  122. WRTEXT
  123. low level graphics
  124. void wrtext(int horiz,int vert,char far *string);
  125. Draws a rectangle on the screen. The first corner is
  126. pointed by the from_horiz and from_vert arguments, the
  127. other corner by the to_horiz and to_vert arguments.
  128. The fill argument may be one of the following:
  129.  OUTLINE_FILL  for no fill (only outline)
  130.  SOLID_FILL    for a solid fill 
  131.  PATTERN_FILL  for a pattern fill
  132. rectan(15,30,50,80,SOLID_FILL); 
  133. /* draws a solid filled rectangle */
  134. RECTAN
  135. hi-level graphics
  136. void rectan(int from_horiz,int from_vert,int to_horiz,int to_vert,int fill);
  137. Reverses an image block from the: from_horiz,from_vert
  138. coordinates, to the: to_horiz,to_vert coordinates. All
  139. pixels in the defined area are reversed.
  140. REVBLK
  141. hi-level graphics
  142. void revblk(int from_horiz,int from_vert,int to_horiz,int to_vert);
  143. Displays an error window with the message pointed by
  144. the message argument, and waits for a key press to
  145. close the window and resume program execution. It
  146. also beeps one when the message is displayed. The
  147. screen contents will be restored automatically when the
  148. window will be closed.
  149. errwin("This is an error!");
  150. ERRWIN
  151. windows
  152. void errwin(char far *message);
  153. Creates a pop-up window. Contents of the screen are
  154. automatically saved.
  155. Arguments:
  156. void open_win(int winid,int from_horiz,int from_vert,int to_horiz,int to_vert,char far *message);
  157. The winid argument is the window id number. The value
  158. must be between [1-8]. Eight windows maximum can be
  159. opened at the same time. Every window must have its
  160. unique id number. 
  161. The from_horiz,from_vert arguments specify the top 
  162. left corner coordinates of the window, the to_horiz
  163. and to_vert arguments specify the bottom right corner
  164. coordinates.
  165. The message argument points to the window title. If this
  166. value is set to zero (0) there will be no title on the
  167. window.
  168. /* Create window #1  with title */
  169. open_win(1,10,100,20,150,"This has a title");
  170. /* Create window #2 with no title */
  171. open_win(2,200,50,300,100,0);
  172. close_win(2);  /* close window #2 */
  173. close_win(1);  /* close window #1 */
  174. OPEN_WIN
  175. windows
  176. See description.
  177. Draws a line on the graphics screen.
  178. The beginning of the line is specified by the 
  179. from_horiz and from_vert arguments, and the end of the line by the to_horiz and to_vert arguments.
  180. line(10,20,100,110); 
  181. hi-level graphics
  182. void line(int from_horiz,int from_vert,int to_horiz,int to_vert);
  183. Closes an active window. The winid argument must be the
  184. window id number of the active window. The number must
  185. be between [1-8]. Eight windows maximum can be opened
  186. at the same time. 
  187. close_win(2);  /* close window #2 */
  188. See the open_win function.
  189. CLOSE_WIN
  190. windows
  191. void close_win(int winid);
  192. Displays a window. Unlike the open_win function, this
  193. function doesn't save the screen contents when creating
  194. the window.
  195. Arguments:
  196. void window(int from_horiz,int from_vert,int to_horiz,int to_vert,char far *message);
  197. See open_win for more details. This function is used by
  198. the open_win function for creating virtual windows.
  199. WINDOW
  200. windows
  201. See description.
  202. 9system
  203.  Subset
  204. system
  205. (functiontype#"system")
  206. 9low level graphics
  207. low level graphics
  208. (functiontype#"low level graphics")
  209. 9hi-level graphics
  210. hi-level graphics
  211. (functiontype#"hi-level graphics")
  212. 9display
  213. Subset
  214. display
  215. (functiontype#"display")
  216. 9menus
  217. d Subset
  218. menus
  219. (functiontype#"menus")
  220. 9windows
  221. Subset
  222. windows
  223. (functiontype#"windows")
  224. Selects (marks/unmarks) the menu item specified by
  225. the mnitem argument, in the menu bar.
  226. You must use the open_mbar function to open the menu bar
  227. before using the sel_menu function.
  228. char mbarmes[]="File  Edit  Search  Quit  Help ";
  229.     open_mbar();    /* open menu bar */
  230.     sel_menu(2);   /* mark the EDIT option */
  231.       . 
  232.       .
  233.       .
  234.     sel_menu(2);   /* unmark the EDIT option */
  235.     sel_menu(3);   /* mark the SEARCH option */
  236. SEL_MENU
  237. menus
  238. void sel_menu(int mnitem);
  239. Closes active menu and restores the screen contents
  240. behind it. See open_menu for details;
  241. close_menu();  /* closes active menu */
  242. CLOSE_MENU
  243. menus
  244. void close_menu(void);
  245. Opens the menu bar. The mbtext argument points to the
  246. menu bar text. Here's the string format.Note the space
  247. at the end of the string:
  248. char mbarmes[]="File  Edit  Search  Quit  Help ";
  249. open_mbar();    /* open menu bar */
  250. close_mbar();          /* closes menu bar */
  251. See also close_mbar function.
  252. OPEN_MBAR
  253. menus
  254. void open_mbar(void);
  255. Opens a menu. Menu options have to be defined previously
  256. with the MENUITEMS variable. The menuid argument is
  257. the menu I.D. of  the menu that you want to open. You
  258. can define up to 8 menus [1-8], with 10 items per 
  259. menu [1-10]. Only one menu can be opened at one time.
  260. You must select the menu before opening it with the
  261. sel_menu function. The function returns the number of
  262. items in the opened menu.
  263. /* 1st define menu items */
  264. MENUITEMS ={
  265. /* menu1 */ {"Load   F2","Save  F10"},
  266. /* menu2 */ {"Edit   F3","Insert F4","Delete F5"},
  267. /* menu3 */ {"Quit   F8"},
  268. /* menu4 */ {"Help   F1","About"}};
  269. int items;
  270. sel_menu(2);  /* select menu #2 */
  271. items=open_menu(2); /* Opens menu #2 */ 
  272. close_menu(); /* Closes active menu */
  273. sel_menu(2);  /* Unselect menu #2 */
  274. OPEN_MENU
  275. menus
  276. int open_menu(int menuid);
  277. Selects (marks/unmarks) the item number specified by
  278. itemno in the active menu. The menu must be opened
  279. with the open_menu function prior on using the 
  280. sel_itm function.
  281. items=open_menu(2);  /* opens menu # */
  282. sel_item(3);         /* selects item #3 in menu */
  283.      .
  284.      .
  285. sel_item(3);         /* unmarks item #3 in menu */
  286. SEL_ITEM
  287. void sel_item(int itemno);
  288. ed Smart Clip
  289. ----------------------------------------------------------------
  290. ----------------------------------------------------------------
  291. arguments:
  292. Description:
  293. All Fields
  294. Function: 
  295. function type: 
  296. Arguments: 
  297. Descr.: 
  298. DataCard
  299. Restores text screen mode, places announciators to the
  300. right of the screen, and terminates program.
  301. TERMINATE
  302. system
  303. void terminate(void);
  304. This function takes control over the menu navigation environment. The menum argument specifies the number of menus to process (available).
  305. Returns:
  306. 0x00 : Menu is not active (closed).
  307. 0xff : Menu is in navigation process.
  308. 0x01-fe : returned selected menu# and option# within the            active menu.
  309. Here's how the returned value is coded:
  310. ex: 0x23
  311.       ||____ option #3
  312.       |_____ menu #2
  313. NAVIGATE
  314. int navigate(int menum);
  315.