home *** CD-ROM | disk | FTP | other *** search
HP Phone/Database/Note | 1994-09-07 | 13.0 KB | 315 lines |
- HPGRAPH Library REF.
- vr2.0 by H.K. 07/94
- Function
- function type
- Arguments
- Descr.
- 9All Database Items
- Checks if the computer is an HP100LX. If it is NOT
- an HP100LX it will display a 'This program runs only
- on the HP100LX palmtop' and then quit the program.
- IS100
- system
- void is100(void);
- Places the string argument on the first (top) line
- of the display in reverse video.
- toplin("This is the status line");
- TOPLIN
- display
- void toplin(char far *string);
- Places the announciators to the left or right of the
- screen.
- The position argument may be: AN_LEFT or AN_RIGHT.
- ex:
- announ(AN_LEFT); /* places announciators left */
- ANNOUN
- display
- void announ(int position);
- Sets the HP100LX in 640x200 BW graphics mode.
- SETGRA
- low level graphics
- void setgra(void);
- Places the 'key-labels' on the last (bottom) line of
- the screen. The string must have the following format:
- char botmes[]={
- " Help Find Next Last "
- " All Edit Add Quit "
- " PgUp PgDn "};
- botlin(botmes);
- BOTLIN
- display
- void botlin(char far *labels);
- Sets the HP100LX back to text 80x25 (CGA) mode.
- SETMDA
- low level graphics
- void setmda(void);
- Sets the text font (size) for the text to be displayed.
- The size argument can be:
- SMALL_FONT for small text size (80x25)
- MEDIUM_FONT for medium text size (64x18)
- LARGE_FONT for large text size (40x16)
- setfon(MEDIUM_SIZE); /* set to medium size */
- SETFON
- low level graphics
- void setfon(int size);
- Sets the current pen position to the horiz,vert coordinates. The horiz argument must be between [0-639]
- and the vert argument between [0-199].
- setpos(10,20); /* sets the pen position to x=10,y=20 */
- SETPOS
- low level graphics
- void setpos(int horiz,int vert);
- Sets the pen color. The color argument can be:
- BLACK_COLOR for black (pixels on).
- WHITE_COLOR for white (pixels off).
- setcol(BLACK_COLOR); /* sets pen to black */
- SETCOL
- low level graphics
- setcol(int color);
- Sets the graphics rule. The rule argument may be one
- of the following:
- FORCE_RULE force pixel on screen
- AND_RULE pixel AND screen -> screen
- OR_RULE pixel OR screen -> screen
- XOR_RULE pixel XOR screen -> screen
- INVFOR_RULE pixel NOT FORCE screen -> screen
- INVAND_RULE pixel NOT AND screen -> screen
- INVOR_RULE pixel NOT OR screen -> screen
- INVXOR_RULE pixel NOT XOR screen -> screen
- TXT_RULE force text on screen
- setrul(FORCE_RULE); /* sets the forced rule */
- SETRUL
- low level graphics
- void setrul(int rule);
- Sets the graphics line type. The line_type argument
- may be an integer value between [0-65535].
- setlin(0x5555); /* set dotted line */
- SETLIN
- low level graphics
- void setlin(unsigned int line_type);
- Sets the fill mask. The fill pattern may be used to
- create filled boxes.
- char fmask[]=
- {'\x55','\xaa','\x55','\xaa','\x55','\xaa','\x55','\xaa', '\x0'};
- setmsk(fmask); /* set dotted fill pattern */
- SETMSK
- low level graphics
- void setmsk(char far *fill_mask);
- Puts the image that was previously saved by the 'getimg'
- function, to the position horiz,vert of the screen.
- The rule argument is the graphics replacement rule
- (see setrul function for details). The buffer argument
- is a pointer that points to the buffer that has the saved
- image. This function is used by the window creation
- functions.
- PUTIMG
- low level graphics
- void putimg(int horiz,int vert,int rule,char far *buffer);
- Saves an image square to the memory.
- The top left corner of the image is pointed by
- the from_horiz and from_vert arguments. The bottom
- right corner is pointed by the to_horiz and to_vert
- arguments. The buffer argument is a pointer pointing
- to a block of memory where the image will be saved.
- GETIMG
- low level graphics
- getimg(int from_horiz,int from_vert,int to_horiz,int to_vert,char far *buffer);
- Writes a string into the graphics screen at the
- horiz,vert coordinates.
- wrtext(100,150,"This is a string.");
- /* This writes 'This is a string' at x=100, y=150
- position. Use the setfon function to set the size
- of the characters. */
- WRTEXT
- low level graphics
- void wrtext(int horiz,int vert,char far *string);
- Draws a rectangle on the screen. The first corner is
- pointed by the from_horiz and from_vert arguments, the
- other corner by the to_horiz and to_vert arguments.
- The fill argument may be one of the following:
- OUTLINE_FILL for no fill (only outline)
- SOLID_FILL for a solid fill
- PATTERN_FILL for a pattern fill
- rectan(15,30,50,80,SOLID_FILL);
- /* draws a solid filled rectangle */
- RECTAN
- hi-level graphics
- void rectan(int from_horiz,int from_vert,int to_horiz,int to_vert,int fill);
- Reverses an image block from the: from_horiz,from_vert
- coordinates, to the: to_horiz,to_vert coordinates. All
- pixels in the defined area are reversed.
- REVBLK
- hi-level graphics
- void revblk(int from_horiz,int from_vert,int to_horiz,int to_vert);
- Displays an error window with the message pointed by
- the message argument, and waits for a key press to
- close the window and resume program execution. It
- also beeps one when the message is displayed. The
- screen contents will be restored automatically when the
- window will be closed.
- errwin("This is an error!");
- ERRWIN
- windows
- void errwin(char far *message);
- Creates a pop-up window. Contents of the screen are
- automatically saved.
- Arguments:
- void open_win(int winid,int from_horiz,int from_vert,int to_horiz,int to_vert,char far *message);
- The winid argument is the window id number. The value
- must be between [1-8]. Eight windows maximum can be
- opened at the same time. Every window must have its
- unique id number.
- The from_horiz,from_vert arguments specify the top
- left corner coordinates of the window, the to_horiz
- and to_vert arguments specify the bottom right corner
- coordinates.
- The message argument points to the window title. If this
- value is set to zero (0) there will be no title on the
- window.
- /* Create window #1 with title */
- open_win(1,10,100,20,150,"This has a title");
- /* Create window #2 with no title */
- open_win(2,200,50,300,100,0);
- close_win(2); /* close window #2 */
- close_win(1); /* close window #1 */
- OPEN_WIN
- windows
- See description.
- Draws a line on the graphics screen.
- The beginning of the line is specified by the
- from_horiz and from_vert arguments, and the end of the line by the to_horiz and to_vert arguments.
- line(10,20,100,110);
- hi-level graphics
- void line(int from_horiz,int from_vert,int to_horiz,int to_vert);
- Closes an active window. The winid argument must be the
- window id number of the active window. The number must
- be between [1-8]. Eight windows maximum can be opened
- at the same time.
- close_win(2); /* close window #2 */
- See the open_win function.
- CLOSE_WIN
- windows
- void close_win(int winid);
- Displays a window. Unlike the open_win function, this
- function doesn't save the screen contents when creating
- the window.
- Arguments:
- void window(int from_horiz,int from_vert,int to_horiz,int to_vert,char far *message);
- See open_win for more details. This function is used by
- the open_win function for creating virtual windows.
- WINDOW
- windows
- See description.
- 9system
- Subset
- system
- (functiontype#"system")
- 9low level graphics
- low level graphics
- (functiontype#"low level graphics")
- 9hi-level graphics
- hi-level graphics
- (functiontype#"hi-level graphics")
- 9display
- Subset
- display
- (functiontype#"display")
- 9menus
- d Subset
- menus
- (functiontype#"menus")
- 9windows
- Subset
- windows
- (functiontype#"windows")
- Selects (marks/unmarks) the menu item specified by
- the mnitem argument, in the menu bar.
- You must use the open_mbar function to open the menu bar
- before using the sel_menu function.
- char mbarmes[]="File Edit Search Quit Help ";
- open_mbar(); /* open menu bar */
- sel_menu(2); /* mark the EDIT option */
- .
- .
- .
- sel_menu(2); /* unmark the EDIT option */
- sel_menu(3); /* mark the SEARCH option */
- SEL_MENU
- menus
- void sel_menu(int mnitem);
- Closes active menu and restores the screen contents
- behind it. See open_menu for details;
- close_menu(); /* closes active menu */
- CLOSE_MENU
- menus
- void close_menu(void);
- Opens the menu bar. The mbtext argument points to the
- menu bar text. Here's the string format.Note the space
- at the end of the string:
- char mbarmes[]="File Edit Search Quit Help ";
- open_mbar(); /* open menu bar */
- close_mbar(); /* closes menu bar */
- See also close_mbar function.
- OPEN_MBAR
- menus
- void open_mbar(void);
- Opens a menu. Menu options have to be defined previously
- with the MENUITEMS variable. The menuid argument is
- the menu I.D. of the menu that you want to open. You
- can define up to 8 menus [1-8], with 10 items per
- menu [1-10]. Only one menu can be opened at one time.
- You must select the menu before opening it with the
- sel_menu function. The function returns the number of
- items in the opened menu.
- /* 1st define menu items */
- MENUITEMS ={
- /* menu1 */ {"Load F2","Save F10"},
- /* menu2 */ {"Edit F3","Insert F4","Delete F5"},
- /* menu3 */ {"Quit F8"},
- /* menu4 */ {"Help F1","About"}};
- int items;
- sel_menu(2); /* select menu #2 */
- items=open_menu(2); /* Opens menu #2 */
- close_menu(); /* Closes active menu */
- sel_menu(2); /* Unselect menu #2 */
- OPEN_MENU
- menus
- int open_menu(int menuid);
- Selects (marks/unmarks) the item number specified by
- itemno in the active menu. The menu must be opened
- with the open_menu function prior on using the
- sel_itm function.
- items=open_menu(2); /* opens menu # */
- sel_item(3); /* selects item #3 in menu */
- .
- .
- sel_item(3); /* unmarks item #3 in menu */
- SEL_ITEM
- void sel_item(int itemno);
- ed Smart Clip
- ----------------------------------------------------------------
- ----------------------------------------------------------------
- arguments:
- Description:
- All Fields
- Function:
- function type:
- Arguments:
- Descr.:
- DataCard
- Restores text screen mode, places announciators to the
- right of the screen, and terminates program.
- TERMINATE
- system
- void terminate(void);
- This function takes control over the menu navigation environment. The menum argument specifies the number of menus to process (available).
- Returns:
- 0x00 : Menu is not active (closed).
- 0xff : Menu is in navigation process.
- 0x01-fe : returned selected menu# and option# within the active menu.
- Here's how the returned value is coded:
- ex: 0x23
- ||____ option #3
- |_____ menu #2
- NAVIGATE
- int navigate(int menum);
-