Dec 242017
 
Library for building applications for the HP100LX/200LX.
File HPCLIB.ZIP from The Programmer’s Corner in
Category Science and Education
Library for building applications for the HP100LX/200LX.
File Name File Size Zip Size Zip Type
DEMO.C 5961 1965 deflated
DEMO.EXE 17728 10210 deflated
DEMO2.C 3844 1250 deflated
DEMO2.EXE 17024 9929 deflated
FUNCTION.DOC 16128 3671 deflated
HPCLIB.C 20122 4074 deflated
HPCLIB.DOC 7458 2996 deflated
HPCLIB.GDB 13348 4992 deflated
HPCLIB.H 2495 791 deflated
HPCLIB.MIX 11677 3321 deflated
HPWENV.C 19916 4001 deflated

Download File HPCLIB.ZIP Here

Contents of the FUNCTION.DOC file


----------------------------------------------------------------
ANNOUN display
----------------------------------------------------------------

arguments:

void announ(int position);

Description:

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 */




----------------------------------------------------------------
BOTLIN display
----------------------------------------------------------------

arguments:

void botlin(char far *labels);

Description:

Places the 'key-labels' on the last (bottom) line of
the screen. The string must have the following format:

ex:

char botmes[]={
" Help Find Next Last "
" All Edit Add Quit "
" PgUp PgDn "};

botlin(botmes);


----------------------------------------------------------------
CLOSE_MENU menus
----------------------------------------------------------------

arguments:

void close_menu(void);

Description:

Closes active menu and restores the screen contents
behind it. See open_menu for details;

ex:

close_menu(); /* closes active menu */


----------------------------------------------------------------
CLOSE_WIN windows
----------------------------------------------------------------

arguments:

void close_win(int winid);

Description:

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.

ex:

close_win(2); /* close window #2 */

See the open_win function.


----------------------------------------------------------------
ERRWIN windows
----------------------------------------------------------------

arguments:

void errwin(char far *message);

Description:

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.

ex:

errwin("This is an error!");


----------------------------------------------------------------
GETIMG low level graphics
----------------------------------------------------------------

arguments:

getimg(int from_horiz,int from_vert,int to_horiz,int to_vert,char far *buffer);

Description:

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.



----------------------------------------------------------------
IS100 system
----------------------------------------------------------------

arguments:

void is100(void);

Description:

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.


----------------------------------------------------------------
LINE hi-level graphics
----------------------------------------------------------------

arguments:

void line(int from_horiz,int from_vert,int to_horiz,int to_vert);

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.

ex:

line(10,20,100,110);


----------------------------------------------------------------
NAVIGATE menu
----------------------------------------------------------------

arguments:

int navigate(int menum);

Description:

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



----------------------------------------------------------------
OPEN_MBAR menus
----------------------------------------------------------------

arguments:

void open_mbar(void);

Description:

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:

ex:

char mbarmes[]="File Edit Search Quit Help ";

open_mbar(); /* open menu bar */

close_mbar(); /* closes menu bar */

See also close_mbar function.


----------------------------------------------------------------
OPEN_MENU menus
----------------------------------------------------------------

arguments:

int open_menu(int menuid);

Description:

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.

ex:

/* 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_WIN windows
----------------------------------------------------------------

arguments:

See description.

Description:

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.

ex:

/* 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 */



----------------------------------------------------------------
PUTIMG low level graphics
----------------------------------------------------------------

arguments:

void putimg(int horiz,int vert,int rule,char far *buffer);

Description:

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.


----------------------------------------------------------------
RECTAN hi-level graphics
----------------------------------------------------------------

arguments:

void rectan(int from_horiz,int from_vert,int to_horiz,int to_vert,int fill);

Description:

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

ex:

rectan(15,30,50,80,SOLID_FILL);

/* draws a solid filled rectangle */


----------------------------------------------------------------
REVBLK hi-level graphics
----------------------------------------------------------------

arguments:

void revblk(int from_horiz,int from_vert,int to_horiz,int to_vert);

Description:

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.


----------------------------------------------------------------
SEL_ITEM menu
----------------------------------------------------------------

arguments:

void sel_item(int itemno);

Description:

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.

ex:

items=open_menu(2); /* opens menu # */
sel_item(3); /* selects item #3 in menu */
.
.
sel_item(3); /* unmarks item #3 in menu */


----------------------------------------------------------------
SEL_MENU menus
----------------------------------------------------------------

arguments:

void sel_menu(int mnitem);

Description:

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.

ex:

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 */



----------------------------------------------------------------
SETCOL low level graphics
----------------------------------------------------------------

arguments:

setcol(int color);

Description:

Sets the pen color. The color argument can be:

BLACK_COLOR for black (pixels on).
WHITE_COLOR for white (pixels off).

ex:

setcol(BLACK_COLOR); /* sets pen to black */


----------------------------------------------------------------
SETFON low level graphics
----------------------------------------------------------------

arguments:

void setfon(int size);

Description:

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)

ex:

setfon(MEDIUM_SIZE); /* set to medium size */



----------------------------------------------------------------
SETGRA low level graphics
----------------------------------------------------------------

arguments:

void setgra(void);

Description:

Sets the HP100LX in 640x200 BW graphics mode.


----------------------------------------------------------------
SETLIN low level graphics
----------------------------------------------------------------

arguments:

void setlin(unsigned int line_type);

Description:

Sets the graphics line type. The line_type argument
may be an integer value between [0-65535].

ex:

setlin(0x5555); /* set dotted line */


----------------------------------------------------------------
SETMDA low level graphics
----------------------------------------------------------------

arguments:

void setmda(void);

Description:

Sets the HP100LX back to text 80x25 (CGA) mode.


----------------------------------------------------------------
SETMSK low level graphics
----------------------------------------------------------------

arguments:

void setmsk(char far *fill_mask);

Description:

Sets the fill mask. The fill pattern may be used to
create filled boxes.

ex:

char fmask[]=
{'\x55','\xaa','\x55','\xaa','\x55','\xaa','\x55','\xaa',
'\x0'};

setmsk(fmask); /* set dotted fill pattern */



----------------------------------------------------------------
SETPOS low level graphics
----------------------------------------------------------------

arguments:

void setpos(int horiz,int vert);

Description:

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].

ex:

setpos(10,20); /* sets the pen position to x=10,y=20 */


----------------------------------------------------------------
SETRUL low level graphics
----------------------------------------------------------------

arguments:

void setrul(int rule);

Description:

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

ex:

setrul(FORCE_RULE); /* sets the forced rule */


----------------------------------------------------------------
TERMINATE system
----------------------------------------------------------------

arguments:

void terminate(void);

Description:

Restores text screen mode, places announciators to the
right of the screen, and terminates program.


----------------------------------------------------------------
TOPLIN display
----------------------------------------------------------------

arguments:

void toplin(char far *string);

Description:

Places the string argument on the first (top) line
of the display in reverse video.

ex:

toplin("This is the status line");




----------------------------------------------------------------
WINDOW windows
----------------------------------------------------------------

arguments:

See description.

Description:

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.


----------------------------------------------------------------
WRTEXT low level graphics
----------------------------------------------------------------

arguments:

void wrtext(int horiz,int vert,char far *string);

Description:

Writes a string into the graphics screen at the
horiz,vert coordinates.

ex:

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. */






 December 24, 2017  Add comments

Leave a Reply