boolean AddButton(short nColumn, short nRow, BSTR pszAction, BSTR pszText, long lBtnMode)
Function AddButton(nColumn As Integer, nRow As Integer, pszAction As String, pszText As String, lBtnMode As Long) As Boolean
Add a button to the local current pad.
Return value
true
Parameters
nColumn
Column coordinate (zero based) in the array.
nRow
Row coordinate (zero based) in the array.
pszAction
Data sent if the button is clicked.
The data follows a "three digit" format :
Type | Format | Sample |
---|---|---|
Numeric | Three numeric digits (0-9) | "027" means escape Key or data "065" means "A" Key or data |
Hex | "/" and two hex digits (0-F) | "/1B" means escape Key or data "/41" means "A" Key or data |
Literal | ".." and one printable character | "..A" means "A" Key or data |
Names | "_" and a two letter keyword | "_F1" means Windows Virtual key VK_F1
(70h) ... "_F9" means Windows Virtual key VK_F9 (78h) "_F0" means Windows Virtual key VK_F10 (79h) "_CR" means Windows Virtual key Return (0Dh) "_CL" means Windows Virtual key Escape (1Bh) "_UP" means Windows Virtual key up arrow (26h) "_DN" means Windows Virtual key down arrow (28h) "_LE" means Windows Virtual key left arrow (25h) "_RI" means Windows Virtual key right arrow (27h) |
The action string will contain one or more characters.
The action will be processed as a key (by the keyboard routine) or as data
directly returned to the user application (following the lBtnMode flags).
pszText
Text displayed to the user, inside the button area. Make sure the text fits in the button area.
lBtnMode
Behavior of the button. One or more (adding) of the following
constants :
Family | Constant | Meaning |
---|---|---|
Appearance | WBTN__DBLH | Double height button Takes two boxes : The box indicated by the coordinates and the box below. If combined with WL_DDBLW takes 4 boxes. |
WBTN__DBLW | Double width button. Takes two boxes : The box indicated by the coordinates and the right box. If combined with WL_DDBLH takes 4 boxes. |
|
Data Type | If a Data type is defined, the data are not processed by the keyboard routine, and the data is returned "as is". The LastInputType is set to the following values: | |
WBTN_CMDTYPE | WLCOMMANDTYPE (as function keys) | |
WBTN_KEYTYPE | WLKEYTYPE (as alphanumeric keys) | |
WBTN_SCANTYPE | WLSCANTYPE (as barcode scanner) | |
WBTN_COMTYPE | WLCOMTYPE (as serial COMx: data) |
The action data are normally processed as a "Windows Virtual Key" (VK)
by the keyboard routine.
If a Data Type is declared, the data is not processed by the keyboard routine
and is sent "as is" directly to the host application.
wsRfButton.AddButton 0, 0, "013", "ENTER", 0
Works like the ENTER key. In an input function validates keyed data.
Returns WLKEYTYPE and the prior keyed data.
wsRfButton.AddButton 0, 0, "013", "ENTER", WBTN_CMDTYPE
Works like a function key. In an input function aborts any keyed data.
Returns WLCOMMANDTYPE and 13 in data.
wsRfButton.AddButton 0, 0, "_F0", "F10", 0
Works like F10 key. Returns WLCOMMANDTYPE and "10" in data
(processed by keyboard routine).
wsRfButton.AddButton 0, 0, "10", "F10", WBTN_CMDTYPE
Works like F10 key. Returns WLCOMMANDTYPE and "10" in data
(returned by button).
Remarks
You need to add buttons to the pad, and store the pad in
the client.
Example
' 2 Columns, 1 row (2 buttons in the pad tops), 1 pixel border
wsRfButton.PadCreate 2, 1, 1
wsRfButton.AddButton 0, 0, "013", "ENTER", 0
wsRfButton.AddButton 1, 0, "027", "CLR", 0
wsRfButton.PadStore "EntClr"