@...GETBOX
DEFINE GETBOX 
Creates a getbox control.
  

Windows implementation of Harbour`s GET Class

SYNTAX

Standard Window:

@ <nRow> ,<nCol> GETBOX <ControlName>
[ ID <
nId> ]
[ OF | PARENT | DIALOG <
ParentWindowName> ]
[ HEIGHT <
nHeight> ]
[ WIDTH <
nWidth> ]
[ FIELD <
FieldName> ]
[ VALUE <
nValue> ]
[ ACTION | ONCLICK | ON CLICK <
ActionProcedureName> | <bBlock>
[ ACTION2 <
Action2ProcedureName> | <bBlock>
[ IMAGE <
cBitmapName> | <acBitmapName>]
[ BUTTONWIDTH <
nButtonWidth> ]
[ PICTURE <
cPicture> ] //** format function and template string
[ VALID <
valid> | RANGE <min>,<max>] // VALID - postvalidation function or codeblock which must return logical value
// RANGE - allowed range of values

[ VALIDMESSAGE <
cValidMessage> ]
[ MESSAGE <cMessage> ]
// text to display on STATUSBAR Item(1) when getbox have focus

[ WHEN <
when> ] // prevalidation function or codeblock (if return .f. GetBox is readonly
[ READONLY ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ PASSWORD ]
[ TOOLTIP <
cToolTipText>|<acToolTipText> ]
[ BACKCOLOR <
aBackColor> ] // * or <aBackColor,aReadOnlyBackColor,aAciveBackColor>
[ FONTCOLOR <aFontColor> ] // * or <aFontColor,aReadOnlyFontColor,aActiveFontColor>
[ ON CHANGE <uChange> ] ;
[ ON GOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ON LOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ RIGHTALIGN ]
[ INVISIBLE ]
[ NOTABSTOP ]
[ HELPID <
nHelpId> ]

Alternate Syntax:

DEFINE GETBOX <ControlName>

[ ID <nId> ]
[ PARENT <
ParentWindowName> ]
COL <
nCol>
ROW <
nRow>
[ HEIGHT <
nHeight> ]
[ WIDTH <
nWidth> ]
[ FIELD <
FieldName> ]
[ VALUE <
nValue> ]
[ ACTION  <
ActionProcedureName> | <bBlock>
[ ACTION2 <
Action2ProcedureName> | <bBlock>
[ IMAGE <
cBitmapName> | <acBitmapName>]
[ BUTTONWIDTH <
nButtonWidth> ]
[ PICTURE <
cPicture> ]
[ VALID <
valid> ]
[ VALIDMESSAGE <
cValidMessage> ]
[ MESSAGE <cMessage> ]
[ WHEN <
when> ]
[ READONLY < .T. | .F.> ]
[ FONTNAME <
cFontname>
[ FONTSIZE <
nFontsize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ PASSWORD < .T. | .F.> ]
[ TOOLTIP <
cToolTipText>|<acToolTipText> ]
[ BACKCOLOR <
aBackColor> ]
[ FONTCOLOR <
aFontColor> ]
[ ONCHANGE <
uChange> ] ;
[ ONGOTFOCUS <
OnGotFocusProcedur> | <bBlock> ]
[ ONLOSTFOCUS <
OnLostFocusProcedure> | <bBlock> ]
[ RIGHTALIGN < .T. | .F.> ]
[ INVISIBLE < .T. | .F.> ]
[ NOTABSTOP < .T. | .F.> ]
[ HELPID <
nHelpId> ]

END GETBOX

** GETBOX supported PICTURE Format Functions

Function
Type
Action
A
C
Allows only alphabetic characters
B
N
Displays numbers left-justified.
C
N
Displays CR after positive numbers.
D
D,N
Displays dates in SET DATE format.
K
All
Deletes default text if first key is not a cursor key.
X
N
Displays DB after negative numbers.
Z
N
Displays zero as blanks.
(
N
Displays negative numbers in parentheses with leading spaces.
)
N
Displays negative numbers in parentheses without leading spaces.
!
C
Converts alphabetic character to uppercase.
 
 

!>> unsupported Format Functions from Harbour Get class :
R
C
Nontemplate characters are inserted in the display
but not saved in the variable.
S<n>
C
Allows horizontal scrolling within a GET. <n> is
E
D,N
Displays dates with day and month inverted
independent of the current DATE SETting, numerics
with comma and period reverse (European style).
an integer that specifies the width of the region.

** GETBOX supported PICTURE Template Symbols

Template
Action
A
Allows only alphabetic characters
N
Allows only alphabetic and numeric characters
X
Allows any character
9
Allows digits for any data type including sign for numerics
#
Allows digits, signs and spaces for C,N type
L
Allows only T, F, Y or N
Y
Allows only Y or N
!
Converts an alphabetic character to uppercase
$
Displays a dollar sign in place of a leading space in a numeric
*
Displays an asterisk in place of a leading space in a numeric
.
Displays a decimal point
,
Displays a comma

FontColor and BackColor property can be defined as RGB array or array of RGBArrays
for Enable ,ReadOnly and Focused (active) stage.
ReadOnly stage preserve defined FontColor and BackColor
VALID and RANGE clauses are checked when control lost focus
User can not leave control if defined validation function (or codeblock) return false
or entered value is out of defined range.
WHEN clause is checked when control become focus . If defined here function or codeblock
used as WHEN param return false, control status is changed to readonly (noneditable).

Navigation Keys inside GETBOX:
RETURN (ENTER),
TAB, ARROW_DOWN
move focus to the next active control
ARROW_UP
move focus to the previous active control
ESC
return original (initial) control value if initial value was changed or move focus to the next active control if initial value remains unchanged
ARROW_LEFT,
ARROW_RIGHT
move caret left/right
HOME,END
move caret to first and last editable position inside control
INS
change insertmode ON/OFF (as far change caret shape)
CTRL+"A"
select all editable contents
CTRL+ARROW_UP,
CTRL+ARROW_DOWN
increment/decrement N,D type contents (+/-1 or +/-1 day)
or change value of logical content to opposite value (Y/N)

Getbox support also all typical clipboard operations (CUT (Ctrl+X),COPY (Ctrl+C),PASTE (Ctrl+V))

PROPERTIES:

·   Value
Set / Gets GetBox value.
Note: Getbox always return unformated value which achive initial valuetype.  Programmer must take a care to not set new control value with different valuetype otherwise error will be generated
·   Enabled
Set / Gets enabled state of a GetBox control
·   Visible          
Set / Gets visible a GetBox control.
·   Row
Set / Gets row position of a GetBox control.
·   Col   
Set / Gets column position of a GetBox control.
·   Width
Set / Gets width of a GetBox control.
·   Height
Set / Gets height of a GetBox control.
·   Action
Set / Gets action of a GetBox control.
·   FontName
Set / Gets GetBox control's font name.
·   FontSize
Set / Gets GetBox control's font size.
·   FontBold
Set / Gets GetBox control's font bold property
·   FontItalic
Set / Gets GetBox control's font italic property
Set / Gets GetBox control's font underline property
Set / Gets GetBox control's font strikeout property
·   FontColor
Set / Gets the foreground color for text within the GetBox
·   BackColor
Set / Gets the background color for text within the GetBox
·   ToolTip
Set / Gets GetBox control's tooltip text.
·   Picture
Set / Gets the image name of a GetBox control.
·   Cargo
Set / Gets user property 'Cargo' for GetBox control
·   Name (R)
Retrieves the name of a GetBox control.
·   DisplayValue (R)
Gets value -  formated characters string from GetBox
·   Parent (D)
Set the name as character identifier of the control.
·   Parent (D)
Set the name as character identifier of the parent window.
·   HelpId (D)
Set the numeric help topic identifier of the control.
·   Field (D)
Set the Field data of active database.
·   ReadOnly
Set / Gets GetBox control's readonly property
·   RightAlign (D)
Right-aligns text in a GetBox control.
·   NoTabStop (D)
Sets whether an element behavior can't receive focus and participate in the tabbing sequence

D: Available at control definition only
R: Read-Only

EVENTS:

·   OnGotFocus
An action to be performed when getting the focus
·   OnChange
An action to be performed when generic changing of the control
An action to be performed when losing the focus.
·   OnClick
Action to be performed when generic clicking of the button of control
·   Action2
Action to be performed when generic clicking of the 2th button of control

METHODS:

·   Show
Shows a GetBox control
·   Hide
Hides a GetBox control
·   SetFocus
Gives the focus to a GetBox control
·   Release
Releases a GetBox control from memory
·   Refresh
Reread data from database`s field defined in FIELD clause.
(!)This method can be used only if FIELD clause is set.
·   Save
Save data for Control GetBox
·   SaveAs
Save a GetBox control as BitMap file.

EXAMPLE:

See demo in :
\Samples\Basic\GetBox