@...BUTTON DEFINE BUTTON Creates a Button control
|
A Button is a control the user can click to provide input to an application.
SYNTAX (TEXT BUTTON)
Standard Window:
@ <nRow> ,<nCol> BUTTON <ControlName>
[ ID <nId> ]
[ OF | PARENT | DIALOG <ParentWindowName> ]
CAPTION <cCaption>
[ ACTION | ONCLICK | ON CLICK <OnActionProcedure> | <bBlock> ]
[ WIDTH <nWidth> HEIGHT <nHeight> ]
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ FLAT ]
[ ON GOTFOCUS <OnGotFocusProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ INVISIBLE ]
[ MULTILINE ]
[ DEFAULT ]
Dialog Window:
REDEFINE BUTTON <ControlName>
ID <nId>
[ OF | PARENT | DIALOG <ParentWindowName> ]
CAPTION <cCaption>
ACTION | ONCLICK | ON CLICK <OnActionProcedure> | <bBlock>
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <cToolTipText> ]
[ FLAT ]
[ ON GOTFOCUS <OnGotFocusProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ HOTKEY <cKey> ]
[ INVISIBLE ]
[ MULTILINE ]
[ DEFAULT ]
SYNTAX (PICTURE BUTTON)
Standard Window:
@ <nRow> ,<nCol> BUTTON <ButtonName>
[ ID <nId> ]
[ OF | PARENT | DIALOG <ParentWindowName> ]
[ PICTURE <cPictureName> | <{cPictureName, cMaskName}> ] | [ ICON <icon>
[ EXTRACT <nIconIndex> ] ]
[ ACTION | ONCLICK | ON CLICK <OnActionProcedure> | <bBlock> ]
[ WIDTH <nWidth> HEIGHT <nHeight> ]
[ TOOLTIP <cToolTipText> ]
[ FLAT ]
[ TRANSPARENT ]
[ NOXPSTYLE ]
[ ON GOTFOCUS <OnGotFocusProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ INVISIBLE ]
[ DEFAULT ]
Dialog Window:
REDEFINE BUTTON <ButtonName>
ID <nId>
[ OF | PARENT | DIALOG <ParentWindowName> ]
[ PICTURE <cPictureName> | <{cPictureName,cMaskName}> ] | [ ICON <icon>
[ EXTRACT <nIconIndex> ] ]
[ ACTION | ONCLICK | ON CLICK <OnActionProcedure> | <bBlock> ]
[ TOOLTIP <cToolTipText> ]
[ FLAT ]
[ TRANSPARENT]
[ NOXPSTYLE ]
[ ON GOTFOCUS <OnGotFocusProcedure> | <bBlock> ]
[ ON LOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ INVISIBLE ]
[ DEFAULT ]
Alternate Syntax:
DEFINE BUTTON <ButtonName>
[ ID <nId> ]
[ PARENT <ParentWindowName> ]
COL <nCol>
ROW <nRow>
WIDTH <nWidth>
HEIGHT <nHeight>
[ CAPTION <cCaption>]
| [ PICTURE <cPictureName> | <{cPictureName,cMaskName}> ]
| [ ICON <icon> ]
[ ACTION <OnActionProcedure> | <bBlock> ]
[ FONTNAME <cFontName> ]
[ FONTSIZE <nFontSize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ FONTCOLOR <anFontColory> ]
[ ONGOTFOCUS <OnGotFocusProcedure> | <bBlock> ]
[ ONLOSTFOCUS <OnLostFocusProcedure> | <bBlock> ]
[ HELPID <nHelpId> ]
[ FLAT < .T. | .F.> ]
[ NOTABSTOP < .T. | .F.> ]
[ TRANSPARENT < .T. | .F.> ]
END BUTTON
DESCRIPTION:
nRow, nCol
|
Position in the area of ??the window in pixels.
|
nWidth, nHeight
|
The desired size of the Button Control in pixels.
|
nId
|
The ID identifier this Control in Dialog Window
|
ButtonName
|
A reference to the Button Control
|
ParentWindowName
|
A reference to the Parent Window.
|
cCaption
|
A text expressions for the Button.
|
cFontName
|
Specifies the Font Name
|
nFontSize
|
Specifies the Font Size
|
cToolTipText
|
Specifies the Text for the ToolTip
|
OnGotFocusProcedure
|
Action to be performed when Button Got focused.
|
OnLostFocusProcedure
|
Action to be performed when Button Lost focused.
|
OnActionProcedure
|
Action to be performed when Button is Clicked
|
|
|
FLAT
|
Make the button two-dimensional
|
NOTABSTOP
|
Stop the control to receive focus and participate in the tabbing
sequence
|
INVISIBLE
|
The visibility property specifies whether or not a control is visible
|
MULTILINE
|
specifies we want to display multiple line in the Button control
|
DEFAULT
|
?
|
TRANSPARENT
|
Specifies that the background of a control should be transparent
|
NOXPSTYLE
|
Specifies not to use XP style button
|
PROPERTIES:
Set / Gets enabled state of a button control
| |
Set / Gets visible a button control.
| |
Set / Gets row position of a button control.
| |
Set / Gets column position of a button control.
| |
Set / Gets width of a button control.
| |
Set / Gets height of a button control.
| |
Set / Gets caption of a button control.
| |
Set / Gets action of a button control..
| |
Set / Gets button control's font name.
| |
Set / Gets button control's font size.
| |
Set / Gets button control's font bold property
| |
Set / Gets button control's font italic property
| |
Set / Gets button control's font underline property
| |
Set / Gets button control's font strikeout property
| |
Set / Gets button control's Tooltip text.
| |
Set / Gets image name of a button control.
| |
Set / Gets icon name of a button control.
| |
Set / Gets user property 'Cargo' for button control
| |
Retrieves the name of a button control.
| |
Set the name as character identifier of the parent window.
| |
Set the numeric help topic identifier of the control.
| |
Specifies that the button is two-dimensional
| |
Sets whether an element behavior can't receive focus and
participate in the tabbing sequence
| |
Specifies whether the background of a Button object should be
transparent
|
D: Available at control definition only
R: Read-Only
EVENTS:
Action to be performed when getting the focus
| |
Action to be performed when losing the focus.
| |
Action to be performed when generic clicking of the control
|
METHODS:
Shows a button control
| |
Hides a button control
| |
Redraw a Control
| |
Gives the focus to a button control
| |
Releases a button control from memory
| |
Save a button control as BitMap file.
|
Note:
Transparence in picture buttons requires 256 or less color depth bitmaps.
PICTURE and ICON clause cannot be used together.
Once created , image button must use .Picture (bitmaps) or .Icon (icons) property
regarding to his definition.
Params for PICTURE can be either Bitmap or array {Bitmap,Mask} - Bitmap Mask is
used for display on disabled button
HINTS. As mask use 2-colors bitmaps only (white/black)
MULTILINE: Make sure that the height of the Button is able to fit all these lines to be displayed.
EXAMPLE: