@...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:

·   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)
Specifies whether the background of a Button object should be transparent

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

EVENTS:

·   OnGotFocus
Action to be performed when getting the focus
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
·   Redraw
Redraw a 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 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:

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

and sample in Chapters:
Pushing Actions (Standard Buttons)
Being More Graphical (Picture Buttons)