📄 boss.man
字号:
changing the "rb" to "r" in the fopen statement. The best way
to determine if you have built a properly functioning GENINDEX
program is to run your newly created GENINDEX program against
"INTELC.HLP" to create a new "INTELC.NDX". Then rebuild the
BOSSDEMO program and test to see if the Intellicom Quick Help
popup is functioning properly. If it is, you are all set. If
you receive a "Sorry - No info on... " message, then you will
need to edit GENINDEX to make the "rb"/"r" change.
This help system has nothing in common with the way in which
the data entry help and error messages get displayed.
Help files always have a filename extension of "HLP". Index
files always have a filename extension of "NDX".
Page: 17
The Window BOSS
Help System Basics - continued.
Here is a sample program that uses INTELC.HLP.
#include "windows.h"
main()
{
WINDOWPTR w1; /* window handle */
int batrib; /* border atrib */
int watrib; /* window atrib */
wn_init();
batrib = BLUE<<4 | WHITE;
watrib = WHITE<<4 | BLACK;
w1 = wn_open(0,0,0,25,10,watrib,batrib);
if(!w1) exit(1);
wn_hlinit(0,0,78,23,(BLUE<<4|WHITE),(BLUE<<4|WHITE),"intelc");
wn_printf(w1, "Press any key\n"); v_getch();
wn_help("%ksend%");
wn_printf(w1, "Press any key\n"); v_getch();
wn_help("%ksend1%");
wn_printf(w1, "Press any key\n"); v_getch();
wn_help("%krecv%");
wn_printf(w1, "Press any key\n"); v_getch();
wn_help("%krecv1%");
wn_printf(w1, "Press any key\n"); v_getch();
wn_help("%checksum xmit1%");
wn_printf(w1, "Press any key\n"); v_getch();
wn_close(w1);
wn_exit();
exit(0);
}
/* End */
Page: 18
The Window BOSS
4.6. Mouse Basics
The Window BOSS includes a collection of routines that provide
the building blocks for developing applications that incorporate
Mouse support. As a programmer you will need following:
. The mouse and its associated hardware
. The mouse driver software
. C and/or Assembly level functions to communicate with the
mouse
The first two are provided by the mouse manufacturer and must be
installed as outlined in the manufacturer's literature. The last
item is provided as part of The Window BOSS. The Window BOSS's
mouse functions adhere to the de facto Microsoft standard.
However, all of the routines have been extensively tested with
both Microsoft and Logitech mice.
Mouse Communication
The only practical method of communicating with the mouse is
through the mouse device driver, which is accessible via software
interrupt 33H. This interrupt is not used by DOS and is claimed
by the mouse device driver at its invocation. Information is
exchanged between the mouse device driver and calling software
via the standard 8086/88 registers. As a Window BOSS user you
will be pleased to know that the burden of having to deal with
the mouse at this level has be replaced by a collection of "C"
level routines that handle all of the aforementioned setup,
software interrupts and register loading/unloading!!
Mouse Usage
Once the mouse has been initialized (reset), you can show it,
hide it, move it, ask it where it is, check to see if its buttons
have been pressed or released, make it emulate a light pen, put a
cage around it (set its region), define its shape and associated
attribute, or ask it how many buttons it has!
Mouse Functions
The standard Microsoft mouse supports 16 functions. Logitech's
are the same, although some are tweaked a tad to handle the 3rd
button. The Window BOSS provides an easy to use interface to the
low level mouse functions and several higher level functions to
ease your applications level programming.
Page: 19
The Window BOSS
Mouse Basics - continued.
Mouse Functions - continued.
The following table summarizes the 16 Microsoft Mouse Functions:
Function Description Window BOSS Function
0 Initialize mouse mo_reset()
1 Show mouse mo_show()
2 Hide mouse cursor mo_hide()
3 Get position & status mo_pos()
4 Set mouse position mo_move()
5 Get button press info mo_pbinfo()
6 Get button release info mo_rbinfo()
7 Set min/max columns mo_clim()
8 Set min/max rows mo_rlim()
9 * Define graphics pointer mo_sgcursor()
10 Define text pointer mo_scursor()
11 Read motion counters mo_motion()
12 * Define event handler mo_task()
13 Light pen emulation on mo_lpon()
14 Light pen emulation off mo_lpoff()
15 * Set motion pixel ratio mo_ratio()
In addition to the above low level interface routines, the
following application's level functions have been implemented to
ease the mouse's natural display adapter sensitivity. Without
these routines, mouse applications would have to deal with the
mouse in a 640x200-pixel plane - even in text mode!
mo_rcpos() Return current mouse position (row, col)
mo_locate() Locate mouse (row, col)
mo_press() Get button pressed info (button, location..)
mo_release() Get button released info ( " " " " " " " " )
mo_region() Set mouse hot area (row, col, width, height)
mo_setptr() Set mouse pointer (style, attributes)
mo_wait() Wait for mouse to settle (de bouncing logic)
mo_nbut() Return # of buttons on mouse
Most mouse applications will use and generally only need to use:
mo_reset(), mo_show(), mo_hide(), and most or all of the
application level functions.
The low level functions are provided for those who prefer to deal
with the mouse on its 640 x 200 pixel plane.
All of the above supported functions are documented in the
FUNCTION CALL SYNOPSIS section of this manual.
* Interfaces to these functions are provided, but are not
supported, by Star Guidance.
Page: 20
The Window BOSS
Mouse Basics - continued.
Mouse Programming Example (Basic)
#include "windows.h" /* ALWAYS */
main()
{
MOUSEPTR m1; /* my mouse ptr */
int mstat, mclik, mrow, mcol; /* mouse stuff */
int i; /* scratch */
v_cls(NORMAL); /* clear the screen */
v_locate(0,0,0); /* locate the cursor */
m1 = mo_reset(); /* init mouse */
if(m1) { /* mouse exists */
printf("Mouse exists with %d buttons.\n", mo_nbutt(m1));
mo_setptr(m1, 0x1E, NORMAL); /* set mouse pointer style */
mo_reigon(m1, 0, 0, 80, 25); /* set mouse "window" */
mo_show(m1); /* show the critter */
v_locate(0,5,0);
printf("Roll test... move mouse, click left or right to end.\n");
do { /* rolling test */
mo_rcpos(m1, &mstat, &mrow, &mcol);
v_locate(0,6,0);
printf("Mouse @ %03d,%03d", mrow, mcol);
} while (!mstat);
v_cls(NORMAL); /* clear screen */
v_locate(0,0,0); /* home cursor */
mo_hide(m1); /* hide mouse */
m1 = mo_reset(); /* reset mouse */
exit(0); /* finito */
}
else {
printf("NO MICE HERE!!\n"); /* tell of woe... */
exit(0); /* exit */
}
}
/* End */
Page: 21
The Window BOSS
4.7. Important Concepts
The preceding programming examples serve as the foundation for
some fundamental, but very important, concepts.
4.7.1. WINDOWS.H
The Window BOSS requires the file "windows.h" to be included in
any source code files that are going to reference any of the
windowing, data entry, or form control functions. Take the time
to peruse this file as it contains all of the constants and
structures used by both The Window BOSS and Data Clerk.
Also, please note that WINDOWS.H includes other standard compiler
header files.
4.7.2. Window Handles
All windowing functions (any function beginning with "wn_")
either explicitly require an associated window pointer to work,
or assume one already is, or will be, created.
4.7.3. Mouse Handles
All mouse functions (any function beginning with "mo_")
either explicitly require an associated mouse pointer to work,
or assume one already is, or will be, created.
4.7.4. Window Origin
Windows have an origin relative to the upper left hand corner of
the screen which is row 0, and column 0.
4.7.5. Text and Data Field Origins
Text and data fields have an origin relative to the upper left
hand corner of the window, which is always row 0, column 0.
4.7.6. Attributes
Attributes (foreground/background colors) must be specified for
windows, borders, and data entry fields. Prompts for data entry
fields always have the same attributes as the window. The fields
themselves can have, but do not require, a different attribute
set.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -