📄 window.doc
字号:
None
DESCRIPTION:
This function enables (turns on) display of the cursor on the IBM
PC video display. The cursor is shown as a single flashing line, at
the bottom of the character window.
EXAMPLES:
wcursor_line(); /* Re-enable the cursor */
exit(0); /* And terminate */
WCURSOR_OFF WCURSOR_OFF
PROTOTYPE:
wcursor_off()
ARGUMENTS:
None
RETURN VALUE:
None
DESCRIPTION:
This function inhibits (turns off) display of the cursor on the
IBM PC video display. This affects the cursor display only, screen
output will continue to be displayed at the correct cursor position.
EXAMPLES:
wclscr(); /* Clear screen */
wcursor_off(); /* Inhibit cursor */
wmenu(10, 10, 0x6007, main_menu, &index); /* Present main menu */
WFORM WFORM
PROTOTYPE:
register wform(int x, int y, int attrs, char *prompts[],
char *strings, ...)
ARGUMENTS:
x - Absolute COLUMN of upper left corner of form window
y - Absolute ROW of upper left corner of form window
attrs - Attributes for form window (See WOPEN)
prompts - Prompt string for form entries
strings - Destination string to receive form data
... - Additional arguments may be required
RETURN VALUE:
None
DESCRIPTION:
The "wform" function opens a window, which contains a "form"
consisting of prompts and data areas. Each data area is shown beside
its corresponding prompt, and may be edited using the keys supported
by WGETS. the UP and DOWN ARROW keys may be used to move the editing
cursor between the various fields in the input form.*
The "attrs" argument contains the open attributes (see WOPEN) for
the menu window, and may be used to control the color, border,
clearing, etc.
The "prompts" argument is an array of pointers to strings, which
define the prompts and input fields in the form. The first two
characters of each string define the 'X' and 'Y' coordinates within
the window of the prompt string. The third character contains the
length of the destination string, and the remainder of the string
contains the text prompt. The destination string is positioned in the
window directly following the prompt string. This list of prompts
must end with a NULL (0) element.
The first (0) element of "prompts" does not actually point to an
input definition, but contains the X and Y sizes for the window to be
opened (High byte = X, Low byte = Y).
Following the "prompts" argument, there must be one destination
"string" argument for each prompt defined. The strings must be long
enough to contain the number of characters specified in the third
byte of the coresponding "prompt" string.
Only the lower seven bits of the field length are used (length =
1-127), the high bit indicates that the field is to contain numbers
only. In this case, the corresponding argument is NOT a pointer to a
string, but must be a pointer to an "int" variable.
The form is exited by pressing the ESCAPE key.
EXAMPLES:
/* Sample input form */
char *form[] = {
50<<8|6, /* Place in 50 by 6 window */
"\x01\x00\x20Software :",
"\x01\x01\x20Author :",
"\x01\x02\x20Directory :",
"\x01\x03\x20Filename :",
0 };
/* Data areas for input form */
char software[0x21] = "MICRO-C",
author[0x21] = "Dave Dunfield",
direct[0x21] = "C:\\MC",
filename[0x21] = "MC*.*";
/* Simple main program to display the form */
main()
{
wform(15, 9, 0xE007, form, software, author, direct, filename);
}
WGETC WGETC
W_GETC W_GETC
PROTOTYPE:
int wgetc()
int w_getc(char *window)
ARGUMENTS:
window - Pointer to WCB for an open window
RETURN VALUE:
0-127 - ASCII value of key pressed
< 0 - Special function key as defined in "window.h"
DESCRIPTION:
The "wgetc" function waits until a key is pressed on the system
console, and returns its value. The cursor is updated to be placed at
the current cursor position in the active window.
The "w_getc" function waits until a key is pressed on the system
console, and returns its value. The cursor is updated to be placed at
the current cursor position in the specified window.
Note that due to the buffering of the IBM-PC keyboard, every
keypress will be reported, even if the WGETC or W_GETC function is
called after a key is pressed and released.
EXAMPLES:
switch(wgetc()) { /* Handle input keys
. . .
}
WGETS WGETS
PROTOTYPE:
int wgets(int x, int y, char *string, int length)
ARGUMENTS:
x - COLUMN position for input
y - ROW position for input
string - Destination string
length - Length of string (High bit set = Numbers only)
RETURN VALUE:
Character causing exit
DESCRIPTION:
The "wgets" function positions the cursor at the specified X and Y
coordinates, and displays the contents of "string" (in a field of
"length" characters), and waits for input, which may be used to edit
the string.
Any normal ASCII characters which are input will be entered into
the string, The following function keys are recognized:
LEFT ARROW - Position cursor one space to the left
RIGHT ARROW - Position cursor one space to the right
BACKSPACE - Backup cursor & delete previous character
DELETE - Delete character under cursor
INSERT - Toggle between INSERT/OVERWRITE
HOME - Position cursor at start of string
END - Position cursor at end of scring
PAGE UP - Clear entire field
PAGE DOWN - Clear from cursor to end of field
Any other special function keys will cause "wgets" to terminate,
and return the value of the offending key. (See "window.h" for key
definitions).
When INSERT mode is enabled, all entered text will be inserted
into the string, with the remainder of the string shifting to the
right. This mode is indicated by a flashing BLOCK cursor.
When OVERWRITE mode is enabled, all entered text will overwrite
the existing string. This mode is indicated by a flashing LINE
cursor.
EXAMPLES:
wgets(2, 5, name, 25);
WGOTOXY WGOTOXY
W_GOTOXY W_GOTOXY
PROTOTYPE:
wgotoxy(int x, int y)
w_gotoxy(int x, int y, char *window)
ARGUMENTS:
x - New COLUMN
y - New ROW
window - Pointer to WCB for an open window
RETURN VALUE:
None
DESCRIPTION:
The "wgotoxy" function positions the cursor within the active
window. Any further display output to that window will occur at the
new ROW and COLUMN positions.
The "w_gotoxy" function positions the cursor within the specified
window. Any further display output to that window will occur at the
new ROW and COLUMN positions.
EXAMPLES:
for(i=0; i<10; ++i) { /* Draw a diagonal line of 'X's */
wgotoxy(i, i);
wputc('X'); }
WMENU WMENU
PROTOTYPE:
wmenu(int x, int y, int attrs, char *names[], int &index)
ARGUMENTS:
x - Absolute COLUMN of top left corner of menu window
y - Absolute ROW of top left corner of menu window
attrs - Attributes for menu window (see WOPEN)
names - Array to menu selection text (last entry = 0)
index - Address of message selection index variable
RETURN VALUE:
0 - Selection was made and ENTER pressed.
!0 - Menu was aborted via ESCAPE key.
DESCRIPTION:
The "wmenu" function opens a window containing a list of menu
items at the specified ROW and COLUMN address. The user may use the
UP, DOWN, HOME and END keys to select an entry by moving the INVERSE
VIDEO selection cursor. Pressing an alpha-numeric key will position
the selection bar to the first entry which begins with that
character.
When the desired selection is under the cursor, the selection is
made by pressing the ENTER key.
At any time the menu selection may be canceled by pressing the
ESCAPE key.
The "attrs" argument contains the open attributes (see WOPEN) for
the menu window, and may be used to control the color, border,
clearing, etc.
The "names" argument must be a pointer to an array of character
strings which are the selections to display. This array MUST end with
a NULL (0) element to indicate the end of the list.
The "index" argument is the address of an "int" variable which
contains the position of the selection cursor. It controls where the
selection cursor will appear when the function is first invoked (0 =
first entry), and also is assigned the position of the selection
cursor when the selection is made.
Once a selection is made, the first character of that selection
will be hilighted in reverse video.
EXAMPLES:
char *names[] = { "One", "Two", "Three", "Four", "Five", 0 };
. . .
index = 0;
if(wmenu(10, 10, 0xE007, names, &index))
return; /* Aborted, exit to higher level */
switch(index) { /* Handle selection */
. . .
}
WOPEN WOPEN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -