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

  1. ----------------------------------------------------------------
  2. ANNOUN                                       display
  3. ----------------------------------------------------------------
  4.  
  5. arguments:
  6.  
  7. void announ(int position);
  8.  
  9. Description:
  10.  
  11. Places the announciators to the left or right of the
  12. screen. 
  13.  
  14. The position argument may be: AN_LEFT or AN_RIGHT.
  15.  
  16. ex:  
  17.  
  18. announ(AN_LEFT); /* places announciators left */
  19.  
  20.  
  21.  
  22.  
  23. ----------------------------------------------------------------
  24. BOTLIN                                       display
  25. ----------------------------------------------------------------
  26.  
  27. arguments:
  28.  
  29. void botlin(char far *labels);
  30.  
  31. Description:
  32.  
  33. Places the 'key-labels' on the last (bottom) line of
  34. the screen. The string must have the following format:
  35.  
  36. ex:
  37.  
  38. char botmes[]={
  39. " Help   Find    Next   Last   "
  40. " All    Edit    Add    Quit   "
  41. " PgUp   PgDn  "};
  42.  
  43. botlin(botmes);
  44.  
  45.  
  46. ----------------------------------------------------------------
  47. CLOSE_MENU                                   menus
  48. ----------------------------------------------------------------
  49.  
  50. arguments:
  51.  
  52. void close_menu(void);
  53.  
  54. Description:
  55.  
  56. Closes active menu and restores the screen contents
  57. behind it. See open_menu for details;
  58.  
  59. ex:
  60.  
  61. close_menu();  /* closes active menu */
  62.  
  63.  
  64. ----------------------------------------------------------------
  65. CLOSE_WIN                                    windows
  66. ----------------------------------------------------------------
  67.  
  68. arguments:
  69.  
  70. void close_win(int winid);
  71.  
  72. Description:
  73.  
  74. Closes an active window. The winid argument must be the
  75. window id number of the active window. The number must
  76. be between [1-8]. Eight windows maximum can be opened
  77. at the same time. 
  78.  
  79. ex:
  80.  
  81. close_win(2);  /* close window #2 */
  82.  
  83. See the open_win function.
  84.  
  85.  
  86. ----------------------------------------------------------------
  87. ERRWIN                                       windows
  88. ----------------------------------------------------------------
  89.  
  90. arguments:
  91.  
  92. void errwin(char far *message);
  93.  
  94. Description:
  95.  
  96. Displays an error window with the message pointed by
  97. the message argument, and waits for a key press to
  98. close the window and resume program execution. It
  99. also beeps one when the message is displayed. The
  100. screen contents will be restored automatically when the
  101. window will be closed.
  102.  
  103. ex:
  104.  
  105. errwin("This is an error!");
  106.  
  107.  
  108. ----------------------------------------------------------------
  109. GETIMG                                       low level graphics
  110. ----------------------------------------------------------------
  111.  
  112. arguments:
  113.  
  114. getimg(int from_horiz,int from_vert,int to_horiz,int to_vert,char far *buffer);
  115.  
  116. Description:
  117.  
  118. Saves an image square to the memory.
  119.  
  120. The top left corner of the image is pointed by
  121. the from_horiz and from_vert arguments. The bottom
  122. right corner is pointed by the to_horiz and to_vert
  123. arguments. The buffer argument is a pointer pointing
  124. to a block of memory where the image will be saved.
  125.  
  126.  
  127.  
  128. ----------------------------------------------------------------
  129. IS100                                        system
  130. ----------------------------------------------------------------
  131.  
  132. arguments:
  133.  
  134. void is100(void);
  135.  
  136. Description:
  137.  
  138. Checks if the computer is an HP100LX. If it is NOT
  139. an HP100LX it will display a 'This program runs only
  140. on the HP100LX palmtop' and then quit the program.
  141.  
  142.  
  143. ----------------------------------------------------------------
  144. LINE                                         hi-level graphics
  145. ----------------------------------------------------------------
  146.  
  147. arguments:
  148.  
  149. void line(int from_horiz,int from_vert,int to_horiz,int to_vert);
  150.  
  151. Description:
  152.  
  153. Draws a line on the graphics screen.
  154.  
  155. The beginning of the line is specified by the 
  156. from_horiz and from_vert arguments, and the end of the
  157. line by the to_horiz and to_vert arguments.
  158.  
  159. ex:
  160.  
  161. line(10,20,100,110); 
  162.  
  163.  
  164. ----------------------------------------------------------------
  165. NAVIGATE                                     menu
  166. ----------------------------------------------------------------
  167.  
  168. arguments:
  169.  
  170. int navigate(int menum);
  171.  
  172. Description:
  173.  
  174. This function takes control over the menu navigation
  175. environment. The menum argument specifies the number of
  176. menus to process (available).
  177.  
  178. Returns:
  179.  
  180. 0x00 : Menu is not active (closed).
  181. 0xff : Menu is in navigation process.
  182.  
  183. 0x01-fe : returned selected menu# and option# within the
  184.           active menu.
  185.  
  186. Here's how the returned value is coded:
  187.  
  188. ex: 0x23
  189.       ||____ option #3
  190.       |_____ menu #2
  191.  
  192.  
  193.  
  194. ----------------------------------------------------------------
  195. OPEN_MBAR                                    menus
  196. ----------------------------------------------------------------
  197.  
  198. arguments:
  199.  
  200. void open_mbar(void);
  201.  
  202. Description:
  203.  
  204. Opens the menu bar. The mbtext argument points to the
  205. menu bar text. Here's the string format.Note the space
  206. at the end of the string:
  207.  
  208. ex:
  209.  
  210. char mbarmes[]="File  Edit  Search  Quit  Help ";
  211.  
  212. open_mbar();    /* open menu bar */
  213.  
  214. close_mbar();          /* closes menu bar */
  215.  
  216. See also close_mbar function.
  217.  
  218.  
  219. ----------------------------------------------------------------
  220. OPEN_MENU                                    menus
  221. ----------------------------------------------------------------
  222.  
  223. arguments:
  224.  
  225. int open_menu(int menuid);
  226.  
  227. Description:
  228.  
  229. Opens a menu. Menu options have to be defined previously
  230. with the MENUITEMS variable. The menuid argument is
  231. the menu I.D. of  the menu that you want to open. You
  232. can define up to 8 menus [1-8], with 10 items per 
  233. menu [1-10]. Only one menu can be opened at one time.
  234. You must select the menu before opening it with the
  235. sel_menu function. The function returns the number of
  236. items in the opened menu.
  237.  
  238. ex:
  239.  
  240. /* 1st define menu items */
  241.  
  242. MENUITEMS ={
  243.  
  244. /* menu1 */ {"Load   F2","Save  F10"},
  245. /* menu2 */ {"Edit   F3","Insert F4","Delete F5"},
  246. /* menu3 */ {"Quit   F8"},
  247. /* menu4 */ {"Help   F1","About"}};
  248.  
  249. int items;
  250.  
  251. sel_menu(2);  /* select menu #2 */
  252. items=open_menu(2); /* Opens menu #2 */ 
  253. close_menu(); /* Closes active menu */
  254. sel_menu(2);  /* Unselect menu #2 */
  255.  
  256.  
  257. ----------------------------------------------------------------
  258. OPEN_WIN                                     windows
  259. ----------------------------------------------------------------
  260.  
  261. arguments:
  262.  
  263. See description.
  264.  
  265. Description:
  266.  
  267. Creates a pop-up window. Contents of the screen are
  268. automatically saved.
  269.  
  270. Arguments:
  271.  
  272. void open_win(int winid,int from_horiz,int from_vert,int
  273. to_horiz,int to_vert,char far *message);
  274.  
  275. The winid argument is the window id number. The value
  276. must be between [1-8]. Eight windows maximum can be
  277. opened at the same time. Every window must have its
  278. unique id number. 
  279.  
  280. The from_horiz,from_vert arguments specify the top 
  281. left corner coordinates of the window, the to_horiz
  282. and to_vert arguments specify the bottom right corner
  283. coordinates.
  284.  
  285. The message argument points to the window title. If this
  286. value is set to zero (0) there will be no title on the
  287. window.
  288.  
  289. ex:
  290.  
  291. /* Create window #1  with title */
  292. open_win(1,10,100,20,150,"This has a title");
  293.  
  294. /* Create window #2 with no title */
  295. open_win(2,200,50,300,100,0);
  296.  
  297. close_win(2);  /* close window #2 */
  298. close_win(1);  /* close window #1 */
  299.  
  300.  
  301.  
  302. ----------------------------------------------------------------
  303. PUTIMG                                       low level graphics
  304. ----------------------------------------------------------------
  305.  
  306. arguments:
  307.  
  308. void putimg(int horiz,int vert,int rule,char far *buffer);
  309.  
  310. Description:
  311.  
  312. Puts the image that was previously saved by the 'getimg'
  313. function, to the position horiz,vert of the screen.
  314. The rule argument is the graphics replacement rule
  315. (see setrul function for details). The buffer argument
  316. is a pointer that points to the buffer that has the saved
  317. image. This function is used by the window creation
  318. functions.
  319.  
  320.  
  321. ----------------------------------------------------------------
  322. RECTAN                                       hi-level graphics
  323. ----------------------------------------------------------------
  324.  
  325. arguments:
  326.  
  327. void rectan(int from_horiz,int from_vert,int to_horiz,int to_vert,int fill);
  328.  
  329. Description:
  330.  
  331. Draws a rectangle on the screen. The first corner is
  332. pointed by the from_horiz and from_vert arguments, the
  333. other corner by the to_horiz and to_vert arguments.
  334. The fill argument may be one of the following:
  335.  
  336.  OUTLINE_FILL  for no fill (only outline)
  337.  SOLID_FILL    for a solid fill 
  338.  PATTERN_FILL  for a pattern fill
  339.  
  340. ex:
  341.  
  342. rectan(15,30,50,80,SOLID_FILL); 
  343.  
  344. /* draws a solid filled rectangle */
  345.  
  346.  
  347. ----------------------------------------------------------------
  348. REVBLK                                       hi-level graphics
  349. ----------------------------------------------------------------
  350.  
  351. arguments:
  352.  
  353. void revblk(int from_horiz,int from_vert,int to_horiz,int to_vert);
  354.  
  355. Description:
  356.  
  357. Reverses an image block from the: from_horiz,from_vert
  358. coordinates, to the: to_horiz,to_vert coordinates. All
  359. pixels in the defined area are reversed.
  360.  
  361.  
  362. ----------------------------------------------------------------
  363. SEL_ITEM                                     menu
  364. ----------------------------------------------------------------
  365.  
  366. arguments:
  367.  
  368. void sel_item(int itemno);
  369.  
  370. Description:
  371.  
  372. Selects (marks/unmarks) the item number specified by
  373. itemno in the active menu. The menu must be opened
  374. with the open_menu function prior on using the 
  375. sel_itm function.
  376.  
  377. ex:
  378.  
  379. items=open_menu(2);  /* opens menu # */
  380. sel_item(3);         /* selects item #3 in menu */
  381.      .
  382.      .
  383. sel_item(3);         /* unmarks item #3 in menu */
  384.  
  385.  
  386. ----------------------------------------------------------------
  387. SEL_MENU                                     menus
  388. ----------------------------------------------------------------
  389.  
  390. arguments:
  391.  
  392. void sel_menu(int mnitem);
  393.  
  394. Description:
  395.  
  396. Selects (marks/unmarks) the menu item specified by
  397. the mnitem argument, in the menu bar.
  398.  
  399.  
  400. You must use the open_mbar function to open the menu bar
  401. before using the sel_menu function.
  402.  
  403. ex:
  404.  
  405. char mbarmes[]="File  Edit  Search  Quit  Help ";
  406.  
  407.     open_mbar();    /* open menu bar */
  408.     sel_menu(2);   /* mark the EDIT option */
  409.       . 
  410.       .
  411.       .
  412.     sel_menu(2);   /* unmark the EDIT option */
  413.     sel_menu(3);   /* mark the SEARCH option */
  414.  
  415.  
  416.  
  417. ----------------------------------------------------------------
  418. SETCOL                                       low level graphics
  419. ----------------------------------------------------------------
  420.  
  421. arguments:
  422.  
  423. setcol(int color);
  424.  
  425. Description:
  426.  
  427. Sets the pen color. The color argument can be:
  428.  
  429.  BLACK_COLOR  for black (pixels on).
  430.  WHITE_COLOR  for white (pixels off).
  431.  
  432. ex:
  433.  
  434. setcol(BLACK_COLOR); /* sets pen to black */
  435.  
  436.  
  437. ----------------------------------------------------------------
  438. SETFON                                       low level graphics
  439. ----------------------------------------------------------------
  440.  
  441. arguments:
  442.  
  443. void setfon(int size);
  444.  
  445. Description:
  446.  
  447. Sets the text font (size) for the text to be displayed.
  448. The size argument can be: 
  449.  
  450.  SMALL_FONT  for small text size (80x25)
  451.  MEDIUM_FONT for medium text size (64x18)
  452.  LARGE_FONT for large text size (40x16)
  453.  
  454. ex:
  455.  
  456. setfon(MEDIUM_SIZE);  /* set to medium size */
  457.  
  458.  
  459.  
  460. ----------------------------------------------------------------
  461. SETGRA                                       low level graphics
  462. ----------------------------------------------------------------
  463.  
  464. arguments:
  465.  
  466. void setgra(void);
  467.  
  468. Description:
  469.  
  470. Sets the HP100LX in 640x200 BW graphics mode.
  471.  
  472.  
  473. ----------------------------------------------------------------
  474. SETLIN                                       low level graphics
  475. ----------------------------------------------------------------
  476.  
  477. arguments:
  478.  
  479. void setlin(unsigned int line_type);
  480.  
  481. Description:
  482.  
  483. Sets the graphics line type. The line_type argument
  484. may be an integer value between [0-65535].
  485.  
  486. ex:
  487.  
  488. setlin(0x5555); /* set dotted line */
  489.  
  490.  
  491. ----------------------------------------------------------------
  492. SETMDA                                       low level graphics
  493. ----------------------------------------------------------------
  494.  
  495. arguments:
  496.  
  497. void setmda(void);
  498.  
  499. Description:
  500.  
  501. Sets the HP100LX back to text 80x25 (CGA) mode.
  502.  
  503.  
  504. ----------------------------------------------------------------
  505. SETMSK                                       low level graphics
  506. ----------------------------------------------------------------
  507.  
  508. arguments:
  509.  
  510. void setmsk(char far *fill_mask);
  511.  
  512. Description:
  513.  
  514. Sets the fill mask. The fill pattern may be used to
  515. create filled boxes.
  516.  
  517. ex:
  518.  
  519. char fmask[]=
  520. {'\x55','\xaa','\x55','\xaa','\x55','\xaa','\x55','\xaa',
  521. '\x0'};
  522.  
  523. setmsk(fmask); /* set dotted fill pattern */
  524.  
  525.  
  526.  
  527. ----------------------------------------------------------------
  528. SETPOS                                       low level graphics
  529. ----------------------------------------------------------------
  530.  
  531. arguments:
  532.  
  533. void setpos(int horiz,int vert);
  534.  
  535. Description:
  536.  
  537. Sets the current pen position to the horiz,vert
  538. coordinates. The horiz argument must be between [0-639]
  539. and the vert argument between [0-199].
  540.  
  541. ex:
  542.  
  543. setpos(10,20); /* sets the pen position to x=10,y=20 */
  544.  
  545.  
  546. ----------------------------------------------------------------
  547. SETRUL                                       low level graphics
  548. ----------------------------------------------------------------
  549.  
  550. arguments:
  551.  
  552. void setrul(int rule);
  553.  
  554. Description:
  555.  
  556. Sets the graphics rule. The rule argument may be one
  557. of the following:
  558.  
  559.  FORCE_RULE   force pixel on screen 
  560.  AND_RULE     pixel AND screen -> screen 
  561.  OR_RULE      pixel OR screen -> screen
  562.  XOR_RULE     pixel XOR screen -> screen
  563.  INVFOR_RULE  pixel NOT FORCE screen -> screen
  564.  INVAND_RULE  pixel NOT AND screen -> screen
  565.  INVOR_RULE   pixel NOT OR screen -> screen
  566.  INVXOR_RULE  pixel NOT XOR screen -> screen
  567.  TXT_RULE     force text on screen
  568.  
  569. ex:
  570.  
  571. setrul(FORCE_RULE); /* sets the forced rule */
  572.  
  573.  
  574. ----------------------------------------------------------------
  575. TERMINATE                                    system
  576. ----------------------------------------------------------------
  577.  
  578. arguments:
  579.  
  580. void terminate(void);
  581.  
  582. Description:
  583.  
  584. Restores text screen mode, places announciators to the
  585. right of the screen, and terminates program.
  586.  
  587.  
  588. ----------------------------------------------------------------
  589. TOPLIN                                       display
  590. ----------------------------------------------------------------
  591.  
  592. arguments:
  593.  
  594. void toplin(char far *string);
  595.  
  596. Description:
  597.  
  598. Places the string argument on the first (top) line
  599. of the display in reverse video.
  600.  
  601. ex:
  602.  
  603. toplin("This is the status line");
  604.  
  605.  
  606.  
  607.  
  608. ----------------------------------------------------------------
  609. WINDOW                                       windows
  610. ----------------------------------------------------------------
  611.  
  612. arguments:
  613.  
  614. See description.
  615.  
  616. Description:
  617.  
  618. Displays a window. Unlike the open_win function, this
  619. function doesn't save the screen contents when creating
  620. the window.
  621.  
  622. Arguments:
  623.  
  624. void window(int from_horiz,int from_vert,int to_horiz,int
  625. to_vert,char far *message);
  626.  
  627. See open_win for more details. This function is used by
  628. the open_win function for creating virtual windows.
  629.  
  630.  
  631. ----------------------------------------------------------------
  632. WRTEXT                                       low level graphics
  633. ----------------------------------------------------------------
  634.  
  635. arguments:
  636.  
  637. void wrtext(int horiz,int vert,char far *string);
  638.  
  639. Description:
  640.  
  641. Writes a string into the graphics screen at the
  642. horiz,vert coordinates. 
  643.  
  644. ex:
  645.  
  646. wrtext(100,150,"This is a string.");
  647.  
  648. /* This writes 'This is a string' at x=100, y=150
  649.    position. Use the setfon function to set the size
  650.    of the characters. */
  651.  
  652.  
  653.  
  654.  
  655.