@...BUTTONEX
DEFINE BUTTONEX
Creates a ButtonEx control.
  

A ButtonEx control can be used as replacement for standard buttons. The ButtonEx control called OwnerDrawButtons implementation with support for XP Style.

SYNTAX

Standard Window:

@ <nRow>,<nCol> BUTTONEX <ButtonName>
[ OF | PARENT <
ParentWindowName> ]
[ CAPTION <
cCaption>]
[ WIDTH <
nWidth> HEIGHT <nHeight> ]
[ PICTURE <
cBitmapName>] | [ ICON <cIconName>]
[ ACTION | ONCLICK | ON CLICK <
ActionProcedureName> | <bBlock>
[ FONT <
cFontName> ]
[ SIZE <
nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ FONTCOLOR <
aFontcolorRGBArray> ]
[ BACKCOLOR <
aBackcolorRGBArray> ]
[ VERTICAL ]
[ LEFTTEXT ]
[ UPPERTEXT ]
[ ADJUST ]
[ TOOLTIP <
cTooltip>]
[ NOHOTLIGHT ]
[ FLAT ]
[ NOTRANSPARENT ]
[ NOXPSTYLE ]
[ ON GOTFOCUS <
OnGotfocusProcedure | bBlock> ]
[ ON LOSTFOCUS
OnLostProcedure | bBlock> ]
[ NOTABSTOP ]
[ HELPID <
nHelpId>]
[ INVISIBLE ]
[ DEFAULT ]

Alternate Syntax:

DEFINE BUTTONEX <ButtonName>

[ ID <nId> ]
[ PARENT <
ParentWindowName> ]
COL <
nCol>
ROW <
nRow>
WIDTH <
nWidth>
HEIGHT <
nHeight>
[ CAPTION <
cCaption>]
[ ACTION <
ActionProcedureName> | <bBlock>
[ FONTNAME <
cFontname>
[ FONTSIZE <
nFontsize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ FONTCOLOR <
aFontcolorRGBArray> ]
[ VERTICAL < .T. | .F.> ]
[ LEFTTEXT < .T. | .F.> ]
[ UPPERTEXT < .T. | .F.> ]
[ ADJUST < .T. | .F.> ]
[ TOOLTIP <
cTooltip>]
[ BACKCOLOR <
aBackcolorRGBArray> ]
[ NOHOTLIGHT < .T. | .F.> ]
[ FLAT < .T. | .F.> ]
[ NOTRANSPARENT < .T. | .F.> ]
[ NOXPSTYLE < .T. | .F.> ]
[ ONGOTFOCUS <
OnGotfocusProcedure | bBlock> ]
[ ONLOSTFOCUS
OnLostProcedure | bBlock> ]
[ NOTABSTOP < .T. | .F.> ]
[ HELPID <
nHelpId>]
[ INVISIBLE < .T. | .F.> ]
[ DEFAULT < .T. | .F.> ]

END BUTTONEX 

DESCRIPTION:

nRow, nCol
Position in the area of ??the window in pixels.
nWidth, nHeigth
The desired size of the ButtonEx Control in pixels.
nId
The ID identifier this Control in Dialog Window
ButtonName
A reference to the ButtonEx Control
ParentWindowName
A reference to the Parent Window.
Caption
A text expressions for the ButtonEx.
cFontname, nFontsize
A reference to the Font name and size .
OnGotFocusProcedure
An action to be performed when ButtonEx is focused.
OnLostFocusProcedure
An action to be performed when ButtonEx is lost focused.
NOTRANSPARENT
Property for picture ButtonEx with bitmap (default - set to false)
VERTICAL
Clause is used to set Picture/Text aspect on button (default - set false)
LEFTTEXT
Clause is for horizontal aspect only (text is placed on the left side of picture) (default - set to false)
UPPERTEXT
For vertical aspect only (text is placed over picture) (default - set to false)
NOHOTLIGHT
Button with mouse over is not "hot-tracked" (default - set to false)
NOXPSTYLE
Preserve standard button look even on styled Windows XP
PICTURE / ICON
Clause can not be used together. Once created , image button must use .Picture (bitmaps) or .Icon (icons) property regarding to his definition.
(Bitmap Mask used for display on disabled button is created 'in-fly' by button draw procedure)


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
·   FontColor
Set / Gets the foreground color for text within the button
·   BackColor
Set / Gets the background color for text within the button
·   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 / Gets the numeric help topic identifier of the control.
·   Lefttext (D)
 
·   Uppertext (D)
 
·   Flat (D)
 
·   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.

Notes:
NOTRANSPARENT is property for picture ButtonEx with bitmap (default NOTRANSPARENT is set to false)

VERTICAL clause is used to set Picture/Text aspect on button (default VERTICAL is set false)

LEFTTEXT clause is for horizontal aspect only (text is placed on the left side of picture) (default LEFTTEXT is set to false)

UPPERTEXT is for vertical aspect only (text is placed over picture) (default UPPERTEXT is set to false)

NOHOTLIGHT - button with mouse over is not "hot-tracked" (default NOHOTLIGHT is set to false)

NOXPSTYLE - preserve standard button look even on styled Windows XP

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.

(Bitmap Mask used for display on disabled button is created 'in-fly' by button draw procedure)

EXAMPLE:

See demos in :
\Samples\Basic\ButtonEx