home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windoware
/
WINDOWARE_1_6.iso
/
source
/
winobj
/
winobj.doc
< prev
next >
Wrap
Text File
|
1991-01-14
|
40KB
|
1,131 lines
Object Windows
The C++ Window Class System
Version 1.0
January 10, 1991
by Lake View Software
Copyright (c) 1991 All Rights Reserved
Reference Manual
****************************************************************************
Features of Object Windows
****************************************************************************
- Powerful windowing system. Allows as many window objects as
memory permits. Windows objects can be stacked, tiled, moved,
resized, and changed in many other ways. There is a whole
assortment of various input and output messages to interact
with windows. All window are active and can be written to
at any time.
- All windows can be virtual. This allows you to create
windows larger than the screen. Data entry screens automatically
pan around the virtual window as the user moves the cursor.
panning can also be software controlled.
- Multi-field formatted data entry. You can create data entry
forms that consist of one or more input fields. You have full
control over user input and can tie validation functions into
each input field.
- Moving bar menus. You can easily create pop-up, pull-down, and
Lotus-style menus, as well as any other custom menu that you can
define.
- Scrollable pick menus. Allow you to pick one item from a list
of items.
- Several video output methods. These include direct screen
writing, direct screen writing with CGA snow reduction, and
video BIOS writing.
- Keyboard management routines. Allows you to tie keystrokes to
functions, and specify a function to be called while waiting
for a keypress.
- Soon to come will be a fully interactive screen painter. This
will allow for simple creation of windowed screen data entry.
****************************************************************************
Registration Information
****************************************************************************
Window Objects is distributed as User-Supported software. You are free
to copy and distribute this software freely, however, if you find it of
use to you, you are encouraged to register your copy. Registering your
copy of the software helps the author continue to provide professional-
quality software at very reasonable prices.
The Basic Registration is $35.00 and includes the remaining memory
models: Small, Compact, Medium, Large, and Huge. Royalty-free use of
library functions, unlimited technical support, and low-cost upgrades.
The fully interactive screen painter will is an added bonus.
The Full Registration is $50.00 and includes all memory models plus
full library source. The library is completely written in C++ using
Borland's Turbo C++ v1.0. All window classes use the same low-level
C functions. This allows easy porting to other operating systems.
This will also include source to the interactive screen painter.
All materials are shipped on 5.25-inch or 3.5-inch floppy diskettes.
Please specify when ordering.
Non-U.S. orders need to include $5.00 extra to cover additional shipping
and handling charges. Checks and money orders must be drawn on a U.S.
bank. Please send all payments payable in U.S. Dollars to:.
******************************************
* Lake View Software *
* 4321 Harborough Rd. *
* Columbus, OH 43220 *
******************************************
All major upgrades will be available for only $15.00.
Please report any errors (BUGS) or suggestions
to Lake View Software at:
GEnie: J.CAPUTO1
CompuServe: 74270,1140
****************************************************************************
Files
****************************************************************************
WINOBJ_S.LIB = WinObj library. You must link to this file to
use any of the windows object messages. The demo
is distributed with the Small model library only.
WINOBJ.HPP = WinObj class definitions. Must be #included in
your program to link with winobj.lib. This will
also include win.h.
WINMENU.HPP = WinMenu class definitions. Must be #included in
any program using the menuing system. This header
file will include winobj.hpp with it.
WINPICK.HPP = WinPick class definitions. Will include winobj.hpp
with it.
WIN.H = Defines low level .C functions used by WinObj.lib.
Also defines various window function options and
key strokes. This is automatically included with
winobj.hpp
DEMO.EXE = A demo program written using Object Windows.
DEMO.CPP = Demo program using the WinObj library.
DEMO.MAK = Make file for demo.cpp.
To build demo.exe:
MAKE -fDEMO
SCR.EXE = An interactive screen painter. This program can
greatly aid in designing screen. When finished
you can produce the base source code for your
applications. The screen painter was written
using Object Windows. Registered users will
receive complete C++ source to SCR.EXE. SCR
was written using the Object Windows Library.
SCR.DOC = Interactive Screen Painter documentation.
SCRDEMO.SCR = A demo screen for use with the Screen Painter.
*****************************************************************************
Declaring a Window Object
*****************************************************************************
WinObj <Object> (int v_h=0,int v_w=0)
v_h = Virtual height of the window. Default is 0
If declared as the default (0) then the virtual
height will be set to the height of the window
when it is opened.
v_w = Virtual width of the window. Default is 0
If declared as the default (0) then the virtual
width will be set to the width of the window
when it is opened.
The virtual height and width can be changed any time the window
is not opened, using the set_virtual message.
EXAMPLE:
WinObj window_a;
main()
{
WinObj window_b ( 100, 100);
~ ~ ~ ~
~ ~ ~
~ ~ ~
}
****************************************************************************
WinObj Messages
****************************************************************************
center
Centers a string in the virtual window, using the current attribute.
USAGE: int center (int y, char *str);
RETURNS: W_OK,W_NOTOPEN
========================================
change_border
Changes the border style for the window object. Optionally changes the
border color.
USAGE: void change_border (int type, int color = -1);
Required arguments.
type = new border type. Use any of the types below.
W_SPACES
W_DOUBLE W_SINGLE
W_DOUSIN W_SOLID
Optional arguments.
color = new border attribute. Default is -1 which
will leave border color unchanged.
EXAMPLE:
main()
{
WinObj a;
a.open (12,12,20,50);
~~~
a.change_border ( W_DOUSIN, _BLUE|WHITE);
~~
~
a.close();
}
=======================================
close
Close the window object. A window object can be opened and closed
as often as you like through its life. A window will automatically be
closed when it leaves the scope of your application.
USAGE: void close();
EXAMPLE:
main()
{
WinObj a;
a.open (12,12,20,50);
~~~
~~
~
a.close();
a.open (10,10,15,35,W_SPACES,_BLUE|GREEN);
a.close();
}
=======================================
clr_eol
Clears the window to the end of the current line.
The cursor position is not changed.
USAGE: void clr_eol();
=======================================
clr_win
Clears the window with the current attribute.
USAGE: void clr_win();
EXAMPLE:
main()
{
WinObj a;
a.open (1,1,12,40);
a.bprintf("This is a test string.");
a.set_attr(_BLUE|WHITE);
a.clr_win();
a.close();
}
=======================================
del_line
Deletes a line in the window object. All text below the line
is pulled up and a blank line is inserted at the end. The cursor
position will not be changed.
USAGE: void del_line (int y);
y = row to be deleted.
=======================================
gotoxy
Move the cursor inside the window.
USAGE: void gotoxy (int y=0, int x=0);
Optional arguments.
y = New y location. default to origin.
x = New x location. default to origin.
EXAMPLE:
main()
{
WinObj a;
a.open (12,12,20,50);
~~~
a.gotoxy(5,5);
~
a.close();
}
=======================================
hide
Hides the window object. Non of the window contents will be changed.
USAGE: void hide ();
=======================================
ins_line
Insert a line in the window object. All text from the line down is
pushed down. The last line will be pushed out of the window. A blank
line will be inserted. The cursor position will not change.
USAGE: void ins_line(int y);
y = row number to be inserted.
=======================================
move
Moves a window on the screen. The window contents are left in tact.
The window does not have to be active to move. It will slide under
other windows if needed.
USAGE: int move (int start_y,int start_x);
start = new start coordinates for the upper left of the window
object.
RETURNS: W_OK, or W_ERROR if your coordinates cause the window to
move off the screen.
=======================================
open
Opens a window object on the screen.
USAGE: int open (int sr,int sc,int er,int ec,
int btype=W_DOUBLE,int wattr=_BLACK|LGREY,
int battr=_BLACK|LGREY)
RETURNS: 0 if successful.
Required arguments.
sr = Start row for the window.
sc = Start column for the window.
er = End row for the window.
ec = End column for the window.
Optional arguments.
btype = Border type. default is W_DOUBLE.
W_NOBORDER W_SPACES
W_DOUBLE W_SINGLE
W_DOUSIN W_SOLID
wattr = Window attribute. default is _BLACK|LGREY.
battr = Border attribute. default is _BLACK|LGREY.
EXAMPLE:
main()
{
WinObj a;
a.open (12,12,20,50);
~~~
~~
~
}
=======================================
pan
Adjust the virtual window by delta number of characters. The
window automatically adjusts it pan location when you move the
cursor. This keeps the cursor always in the window. You can
use pan to adjust it manually if you need.
USAGE: int pan (int delta_y, int delta_x);
delta = the change in the x and/or y coordinate.
RETURNS: W_OK, W_NOTOPEN
SEE: set_pan()
=======================================
printf && bprintf
Display a formatted string in the window at the current cursor position.
bprintf will print to the window buffer and will not be displayed until
a refresh is called. These functions work very much like the printf
function in C. Both have an optional xy coordinate.
USAGE: void printf (char *,...);
void bprintf (char *,...);
void bprintf ( int y, int x, char *,...);
void printf ( int y, int x, char *,...);
EXAMPLE:
main()
{
WinObj a;
int i = 2;
a.open (12,12,20,50);
a.gotoxy(5,5);
a.bprintf("( 2 + 2 = %d )",i+2);
a.gotoxy();
a.bprintf("This is the window origin.");
a.update();
~
a.close();
}
=======================================
set_active
Brings a window to the surface. This will also unhide a function.
Set_active is called each time you input a keystroke from a window.
USAGE: void set_active();
=======================================
set_attr
Sets a new default attribute for the window object.
USAGE: int set_attr (int new_attr);
RETURNS: previous attribute.
Required arguments.
new_attr = New attribute for window. Can be any legal color
Mono screens will be remapped to use only black on
white or white on black.
EXAMPLE:
main()
{
WinObj a;
a.open (12,12,20,50);
~~~
a.new_attr (_RED|YELLOW); // All characters from this point will
// be displayed as yellow on red.
~~~
~~
~
a.close();
}
=======================================
set_attr
changes the attribute for a region in a window.
USAGE: void set_attr (int new_attr,int y,int x,int cnt=1);
new_attr = new attribute for the region.
y,x = start y,x coordinates.
cnt = number of characters to change. default is 1.
=======================================
set_fill
Set the window fill character. Default is spaces.
USAGE: void set_fill (char ch);
=======================================
set_virtual
Changes the virtual height and width of a window. This
can only be done when the window is closed.
USAGE: int set_virtual (int vh, int vw);
vh = new virtual height.
vw = new virtual width.
Setting the vh and/or vw to zero causes them to be automatically set
when open is called.
RETURNS: W_OK or W_OPENED
=======================================
size
Set a new size for the displayed window object. The virtual height
and width are left unchanged. This means you can not make a window
larger than its virtual sizes.
USAGE: int size (int new_height,int new_width);
RETURNS: W_OK, or W_ERROR if your new size is less than 1.
=======================================
title
Add, change or remove a window title. The window title will have the
same attribute as the window border.
USAGE: void title(char *str,int position=W_CENTER);
Required arguments.
str = Title string to display. If NULL then the window
title will be removed.
Optional arguments.
position = Position of the title. default is Center.
W_CENTER W_LEFT W_RIGHT
EXAMPLE:
main()
{
WinObj a;
a.open (12,12,20,50);
a.title ("[ Window 1 ]", W_LEFT);
~~~
~
a.close();
}
=======================================
unhide
Unhide a hidden window object.
USAGE: void unhide ();
=======================================
update
Update the window object. This will display all buffered output.
The window does not have to be the active window to be updated.
USAGE: void update();
EXAMPLE:
see printf
*****************************************************************************
Window Input Routines
*****************************************************************************
get_key
Get a key from the keyboard at the current window location. A refresh
will be automatically called if needed.
USAGE: int get_key (int echo=W_NOECHO);
Optional arguments.
echo = Determine weather or not to echo the keystroke to the
window. default = no echo.
W_ECHO W_NOECHO
Returns.
Ascii and key scan code from win.h.
key & 0x00ff = Ascii character returned
key >>8 = Scan code.
EXAMPLE:
main()
{
WinObj a;
a.open (1,1,12,40);
a.bprintf("This is a test string.");
a.bprintf(2,0,"Press Escape to exit.");
while (a.get_key() != ESC);
a.close();
}
=======================================
get
Get a variable from a screen window. Will display each get with the
current get_attr attribute.
USAGE: int get (int y,int x,long int i, int len=5);
int get (int y,int x, double d, int len=10, int dec=2);
int get (int y,int x, char *str, char *picture=NULL);
int get (int y,int x, char *str, char style);
Valid Picture characters.
x = Allow any character.
X = Allow any character. Letters will be converted to
upper case.
a = Allow letters and spaces only.
A = Allow letters and spaces only. Letters will be
converted to upper case.
9 = Allow numbers and spaces only.
Any other characters in a picture clause will be forced into
the output string. ie ( , - and even spaces.
Valid Style characters
L convert field to 'L'owercase.
U convert field to 'U'ppercase.
F convert 'F'irst character to uppercase.
D MM/DD/YY date field.
S 999-99-9999 Social Security number field
P (999) 999-9999 phone number.
Z 99999-9999 zip code.
Warning:
If a NO picture is used the len of the string (str) will be used
and any characters will be allowed. This is the default. Be
sure you have a NULL terminated string.
The length of the picture clause will override the len of the
string.
If a style is used be sure the char * has enough space to
accomidate the style type.
EXAMPLES:
char state[] = " ";
long i=0;
double d;
char phone[16]="";
char name[16]="", ss[12]="";
get (10,10,state,'U'); // state forced to upper case.
get (12,10,i,3); // get a 3 digit integer
get (13,10,d); // get a 2 decimal double, 10 chars. long
get (15,10,name,"Xxxxxxxxxxxxxx"); get a 15 char. name with the
first character forced to upper
get (20,10,phone,"(999) 999-9999"); get a phone number using a
picture statement.
get (21,10,ss,'S'); // get a ss # using a style.
RETURNS:
W_OK if successful.
W_ERROR if invalid x,y.
W_NOTOPEN if window not opened.
=======================================
valid
Assign a valid function to the previous get.
USAGE: int valid (int (*func)(void *));
func() will be called each time the user attempts to leave the
get field. read will not let the user leave the current get until
your valid function returns a non zero value. The read function
will let the user exit the read with a press of ESC regardless if
the valid function returns true.
The valid function will be called with a pointer to the current
get object. This can be a long, double or string pointer.
RETURNS:
0 if successful.
-1 if no previous get.
=======================================
clear_gets
Clear all gets for a window. This allows you to use the get
system to display the data but not read it from the screen.
USAGE: void clear_gets()
=======================================
read
Read all gets from the window object.
USAGE: int read();
RETURNS:
Key pressed to exit read. User can exit with an Enter on
the last field, Escape, or PgDn.
****************************************************************************
Information Functions
****************************************************************************
do_youown
Ask a window object if it owns a coordinate on the screen. If it
does then return the character and attribute of that coordinate.
Owning a coordinate means the window is the most active in that
spot on the screen. It is posible for a window to use a spot on
the screen but not be the current owner. A hidden window owns
NO spots on the screen.
USAGE: int do_youown (int y,int x, char &ch, char &attr);
y,x physical screen coordinates.
ch will return with the character if owned.
attr will return with the attribute if owned
RETURNS: 0 if not owned
1 if the window owns the coordinate.
SEE: who_owns()
========================================
get_pan
get the current virtual starting point for the displayed window.
USAGE: int get_pan(int &y, int &x) // return current pan coord
When called, get_pan will set y,x to the current start location
for the virtual window.
RETURNS: W_OK or W_NOTOPEN.
========================================
get_scr
get the current screen location of the window
USAGE: int get_scr (int &sr,int &sc,int &er,int &ec);
When called, get_scr will set sr,sc,er,ec to the current
window location on the screen.
RETURNS: W_OK or W_NOTOPEN
========================================
is_open
report windows open status.
USAGE: int is_open();
RETURNS: true if open, 0 if not.
========================================
max_x
get maximum x coordinate for window.
USAGE: int max_x();
RETURNS:
max x coordinate or W_NOTOPEN if window is not opened.
========================================
max_y
get maximum y coordinate for window.
USAGE: int max_y();
RETURNS:
max y coordinate or W_NOTOPEN if window is not opened.
========================================
ret_char
retrieve a character from a window objext.
USAGE: int ret_attr(int y,int x);
RETURNS: The ascii value of the character at the given window
coordinates.
=======================================
ret_attr
retrieve an attribute from a window object.
USAGE: int ret_attr (int y,int x);
RETURNS: The attribute value of the character at the given window
coordinates.
========================================
wherexy
get the current cursor location for the window.
USAGE: int wherexy(int &y,int &x);
When called, wherexy will set y,x to the current cursor coordinates
RETURNS: W_OK or W_NOTOPEN.
========================================
who_owns
Return a pointer to the window object which owns a coordinate on the
screen.
USAGE: WinObj *who_owns (int y,int x,char &ch,char &attr);
y,x physical screen coordinates.
ch will return with the character if owned by anyone.
attr will return with the attribute if owned by anyone.
RETURNS: A pointer to the window object who owns the spot
on the screen.
0 if not owned.
****************************************************************************
Menu Objects
****************************************************************************
WinMenu <Object>
Menu objects are derived from WinObj objects. This means the
window messages are also available to the menu objects, with a few
additions to aid in the constructions of menus.
There are three necessary steps to creating a menu.
1.) Open the menu as you would any other window. This gives
it a location and color on the screen.
2.) Declare your menu selections. (prompt)
3.) Read the menu. This returns the user selection.
EXAMPLE:
main()
{
WinMenu m;
m.open (4,23,16,53,W_SOLID,_BLUE|WHITE,_BLUE|DGREY);
m.title ("[ Demo Menu ]");
m.prompt (1,4,1,"Data entry");
m.prompt (3,4,2,"Moving windows");
m.prompt (5,4,3,"Random windows");
m.prompt (7,4,4,"Menu demo");
m.prompt (9,4,0,"Quit");
int choice = m.read(1);
switch (choice) {
case 1:
~~~~~~
break;
case 2:
~~~~~~
break;
~~~~~~
}
}
****************************************************************************
Menu Messages
****************************************************************************
prompt
declares a menu selection. The selection will not be displayed in
the window until you call read.
USAGE: int prompt(int y,int x,int return_val,char *str,char *message=NULL);
y = The start row in the menu window.
x = The start column in the menu window.
return_val = The value you wish this selection to return.
str = The prompt string.
message = The message to display in the optional message box
when this prompt is pointed to.
RETURNS: W_NOMEM if out of memory
W_NOTOPEN if the menu has not been opened.
W_OK
==========================================
read
Read the user selection from the menu window.
The user can use the arrow keys to move from one selection to the next,
then press Enter to make the selection. The user can also press the
first letter of the menu selection. The read function will also unhide
a previously hidden menu object.
USAGE: int read (int start_pos);
start_pos = the first selection to point to. The read function
will attempt to match start_pos with one of the
return_vals used in the prompt function. It will
then point to this selection first.
RETURNS: W_ERROR if no prompts were activated.
W_ESCAPE if escape was used to exit.
Otherwise it returns the return_val of the user selected
prompt.
==================================================
reset
This resets a menu object and closes it so you can use it again for
a different type of menu.
USAGE: void reset();
==================================================
set_barattr
This sets the attribute for the menu selection bar. The default
is _LGREY|BLACK.
USAGE: int set_barattr(int attr);
RETURNS: the previous attribute.
==================================================
message_line
This sets the screen line to display a menu message. The menu read
message will open a 1 line window using this entire screen line. Your
declared messages will be displayed in this window as the user moves
the menu bar.
USAGE: int message_line (int new_line_no);
new_line_no = the line number to use. if this is less than 0
no message line will be used. The menu object
default is -1;
RETURNS: the previous line number.
EXAMPLE:
main() // A lotus style menu.
{
WinMenu m;
m.open (1,0,1,79,W_NOBORDER,_BLUE|WHITE);
m.message_line(2);
m.prompt (0, 1,1,"Worksheet","Global, Column, Status, Delete");
m.prompt (0,12,2,"Range","Format, Label, Erase, Name, Justify,
Prot");
m.prompt (0,19,3,"Copy","Copy a cell or range of cells");
m.prompt (0,25,4,"Move","Move a cell or range of cells");
m.prompt (0,31,5,"File","Retrieve, Save, Combine, Xtract...");
m.prompt (0,37,6,"Print","Print a worksheet to a printer or file");
m.prompt (0,44,0,"Quit","Quit the menu demo");
int choice=1;
while (choice != 0) {
choice = m.read(choice);
switch (choice) {
case 1:
menu_demo2();
break;
case 2:
break;
}
}
}
===============================================
message_attr
Changes the attribute for the message line. The default is
_BLACK|WHITE.
USAGE: int message_attr(int new_attr);
RETURNS: the previous attribute.
****************************************************************************
Pick-List Object
****************************************************************************
WinPick <Object>
Pick-List objects ar derived from WinObj objects. This means the window
messages are also available to the pick-list objects, with a few
additions to aid in the construction of pick-lists.
There are three necessary steps to creating a pick-list.
1.) Open the pick-list window the same as you would open
any other window. This gives it a location and color
on the screen.
2.) Assign a char * array to the list object.
3.) Read the pick list. This returns the user selection.
EXAMPLE:
char *list[] = { "January","February",
"March","April",
"May","June",
"July","August",
"September","October",
"November","December", 0 };
void main()
{
WinPick pl;
pl.open (6,41,11,53,W_DOUSIN,_BLUE|WHITE,_BLUE|BLACK);
pl.prompt (list);
int choice = pl.read();
WinObj w;
w.open (6,23,11,53,W_DOUSIN,_BLUE|WHITE,_BLUE|BLACK);
w.printf (1,1,"You picked %s.",list[choice]);
w.set_attr(_BLUE|LGREY);
w.printf (3,1,"Press any key to continue.");
w.get_key();
}
****************************************************************************
Pick-List Messages
****************************************************************************
prompt
assigns an array of characters pointers to the list object. This can be
any size list of character strings. The last element of the list must
be a NULL pointer, or you must provide a count of items to pick from.
USAGE: void prompt(char *list[],int count=-1);
list = a pointer to the list of strings.
count = the number of elements to pick from. (Optional)
if you omit this parameter the WinPick object will
search for a NULL to determine the end of the list.
=======================================
read
Gets the users choice from the pick list.
USAGE: int read();
RETURNS: the element number of the users selection.
W_ERROR if the list window is not opened.
W_ESCAPE if list is exited with an escape
=========================================
set_barattr
Sets the attribute for the pick-list bar. The default is
_LGREY|BLACK
USAGE: int set_barattr (int new_attr);
RETURNS: the previous attribute.
****************************************************************************
Low Level Functions
****************************************************************************
----------------------------Screen functions-------------------------------
Win_init
Start the low level screen system. This is called automatically by
the first window function used. This function will clear the screen
the first time it is called.
USAGE: void Win_init (int mode);
mode: W_MONO = Force mono attributes only.
W_BIOS = Force bios screen writes.
W_DEFAULT = Auto detect the system configuration.
W_SNOW = Force CGA snow checking.
Any of these modes can be combined by oring.
example: Win_init (W_BIOS | W_MONO);
========================================
Win_clr
Clear a section of the screen with an attribute.
No testing is done on screen coordinates.
USAGE: void Win_clr(int sr,int sc, int er, int ec,int color);
===========================================
Win_dispch
Display a character on the screen.
No coordinate testing is done.
USAGE: void Win_dispch (int y, int x, int color, char ch);
============================================
Win_dispst
Display a NULL terminated string on the screen.
USAGE: void Win_dispst ( int y,int x,int color,char *str,int max );
max = max number of characters to display.
============================================
Win_gotoxy
Move the cursor on the screen.
USAGE: void Win_gotoxy (int y, int x);
============================================
Win_hidecur
Hide the screen cursor.
USAGE: void Win_hidecur();
============================================
Win_showcur
Unhide the screen cursor.
USAGE: void Win_showcur();
============================================
Win_beep
Beep the speeker.
USAGE: void Win_beep();
============================================
Win_mono
Turn black & white color remaping on or off.
USAGE: void Win_mono (int on_off);
Call with W_ON or W_OFF
============================================
Win_snow
Turn snow checking on or off.
USAGE: void Win_snow(int on_off);
Call with W_ON or W_OFF
============================================
Win_bios
Turn bios writes on or off.
USAGE: void Win_bios (int on_off);
Call with W_ON or W_OFF
---------------------------Key Functions------------------------------------
Win_getkey
Get a key stroke from the keyboard.
USAGE: int Win_getkey();
RETURNS: scan code + ascii value of key pressed.
Scan code = key >> 8
ascii value = key & 0x00ff
============================================
Win_keystuf
Stuf a keystroke in the internal buffer.
USAGE: int Win_keystuf (int key);
key = Scan code + ascii value of key to stuff.
Key strokes are stacked not queued. If you wish to display
a string you must insert the keystrokes in reverse.
Example:
char *str = "Keyboard stuf routine";
int i = strlen(str);
while (i)
Win_keystuf(str[--i]);
RETURNS: W_OK or W_ERROR if the buffers is full
Buffer is 40 keystrokes.
============================================
Win_lastkey
Return the last key gotten by Win_getkey
USAGE: int Win_lastkey ();
RETURNS: scan code + ascii value of key gotten.
============================================
Win_setonkey
Assign a function to a hot key. You may use as may hot keys
as you like. You can turn off a hot key by assigning the
key to NULL.
USAGE: void Win_setonkey (int key,void (* func)(void));
key = scan code/ascii code combination of hot key.
Many of the keys are defined in WIN.H
func = pointer to the hot key function. If NULL then
hot key will be deactivated.
=============================================
Win_setbkloop
Assign a function to execute while waiting for a keypress. You
can only have one function assigned at a time. To turn off this
process assign NULL.
USAGE: void Win_setbkloop (void (* func)(void));
--------------------------------String Functions---------------------------
str_clear
Clears a string to a given number of spaces
USAGE: char *str_clear (char *str, int len);
str = String to be cleared.
len = New length of string.
RETURNS: a pointer to str
====================================
str_setsz
Sets the size of a char string.
USAGE: char *str_setsz (char *str, int len);
str = String to be truncated or padded.
len = New length of string.
RETURNS: pointer to str.
=========================================
strfill
Return a string filled with a character.
USAGE: char *strfill (char ch,int count);
ch = character to use.
cnt = length of return string. MAX of 149.
RETURNS: pointer to a static string buffer or NULL if invalid length.
==========================================
strtrim
Trims trailing spaces from a string.
USAGE: char *strtrim (char *str);
RETURNS: pointer to the string which was trimmed.
===========================================
is_in
Test a string for a given character.
USAGE: int is_in (char ch,char *str);
RETURNS: 0 if ch is not in str.
1 if ch is in str.