@...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 <
ActionProcedureName> | <bBlock> ]
[ WIDTH <
nWidth> HEIGHT <nHeight> ]
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ FLAT ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <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 <
ActionProcedureName> | <bBlock>
[ FONT <
cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <
cToolTipText> ]
[ FLAT ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <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 <
ActionProcedureName> | <bBlock> ]
[ WIDTH <
nWidth> HEIGHT <nHeight> ]
[ TOOLTIP <
cToolTipText> ]
[ FLAT ]
[ TRANSPARENT]
[ NOXPSTYLE ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <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 <
ActionProcedureName> | <bBlock> ]
[ TOOLTIP <
cToolTipText> ]
[ FLAT ]
[ TRANSPARENT]
[ NOXPSTYLE ]
[ ON GOTFOCUS <
OnGotFocusProcedur> | <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 <
ActionProcedureName> | <bBlock>
[ FONTNAME <
cFontname>
[ FONTSIZE <
nFontsize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ FONTCOLOR <
aFontcolorRGBArray> ]
[ ONGOTFOCUS <
OnGotFocusProcedur> | <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, nHeigth
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.
Caption
A text expressions for the Button.
cFontname, nFontsize
A reference to the Font and size .
OnGotFocusProcedure
An action to be performed when Button is focused.
OnLostFocusProcedure
An action to be performed when Button is lost focused.
AnctionProcedure
An action to be performed when Button is clicking.


PROPERTIES:

·   Enabled
Set / Gets enabled state of a button control
·   Visible
Set / Gets visible a button control.
·   Row
Set / Gets row position of a button control.
·   Col
Set / Gets column position of a button control.
·   Width
Set / Gets width of a button control.
·   Height
Set / Gets height of a button control.
·   Caption
Set / Gets caption of a button control.
·   Action
Set / Gets action of a button control..
·   FontName
Set / Gets button control's font name.
·   FontSize
Set / Gets button control's font size.
·   FontBold
Set / Gets button control's font bold property
·   FontItalic
Set / Gets button control's font italic property
Set / Gets button control's font underline property
Set / Gets button control's font strikeout property
·   ToolTip
Set / Gets button control's tooltip text.
·   Picture
Set / Gets image name of a button control.
·   Icon
Set / Gets icon name of a button control.
·   Cargo
Set / Gets user property 'Cargo' for button control
·   Name (R)
Retrieves the name of a button control.
·   Parent (D)
Set the name as character identifier of the parent window.
·   HelpId (D)
Set the numeric help topic identifier of the control.
·   Flat (D)
Specifies that the button is two-dimensional
·   NoTabStop (D)
Sets whether an element behavior can't receive focus and participate in the tabbing sequence
·   Transparent (D)
 

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

EVENTS:

·   OnGotFocus
An action to be performed when getting the focus
An action to be performed when losing the focus.
·   OnClick
Action to be performed when generic clicking of the control

METHODS:

·   Show
Shows a button control
·   Hide
Hides a button control
·   SetFocus
Gives the focus to a button control
·   Release
Releases a button control from memory
·   SaveAs
Save a button control as BitMap file.

Note:
Transparence in picture buttons requires 256 or less color depth bitmaps.
PICTURE and ICON clause can not 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)

EXAMPLE:

See demos in :
\samples\basic\button_1
\samples\basic\button_2
\samples\basic\button_3
\samples\basic\MAINDEMO_(SYNTAX_I) to _(SYNTAX_IV)