@...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> ]
[ IMAGESIZE <nImageWIdth>, <nImageHeight>]
| [ IMAGEWIDTH <nImakeWidth> IMAGEHEIGHT <nImageHeught> ]
[ ACTION | ONCLICK | ON CLICK <OnActionProcedure> | <bBlock> ]
[ FONT <cFontName> ]
[ SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ FONTCOLOR <anFontColor> ]
[ BACKCOLOR <anBackColor> ]
[ VERTICAL ]
[ LEFTTEXT ]
[ UPPERTEXT ]
[ ADJUST ]
[ TOOLTIP <cToolTipText> ]
[ NOHOTLIGHT ]
[ FLAT ]
[ GRADIENTFILL <aGradInfo> [ HORIZONTAL ] ]
[ NOTRANSPARENT ]
[ NOXPSTYLE ]
[ ON GOTFOCUS | ON MOUSEHOVER <OnGotFocusProcedure> | bBlock> ]
[ ON LOSTFOCUS | ON MOUSELEAVE <OnLostFocusProcedure> | bBlock> ]
[ HANDCURSOR ]
[ NOTABSTOP ]
[ HELPID <nHelpId> ]
[ INVISIBLE ]
[ DEFAULT ]
[ ON INIT <bInit> ]
Alternate Syntax:
DEFINE BUTTONEX <ButtonName>
[ ID <nId> ]
[ PARENT <ParentWindowName> ]
COL <nCol>
ROW <nRow>
WIDTH <nWidth>
HEIGHT <nHeight>
[ CAPTION <cCaption>]
[ ACTION <OnActionProcedure> | <bBlock> ]
[ IMAGESIZE <nImageWIdth>, <nImageHeight>]
| [ IMAGEWIDTH <nImakeWidth> IMAGEHEIGHT <nImageHeight> ]
[ FONTNAME <cFontName> ]
[ FONTSIZE <nFontSize> ]
[ FONTBOLD < .T. | .F.> ]
[ FONTITALIC < .T. | .F.> ]
[ FONTUNDERLINE < .T. | .F.> ]
[ FONTSTRIKEOUT < .T. | .F.> ]
[ FONTCOLOR <anFontColor> ]
[ VERTICAL < .T. | .F.> ]
[ LEFTTEXT < .T. | .F.> ]
[ UPPERTEXT < .T. | .F.> ]
[ ADJUST < .T. | .F.> ]
[ TOOLTIP <cToolTipText>]
[ BACKCOLOR <anBackColor> ]
[ NOHOTLIGHT < .T. | .F.> ]
[ FLAT < .T. | .F.> ]
[ GRADIENTFILL <aGradInfo> [ HORIZONTAL < .T. | .F.>
] ]
[ NOTRANSPARENT < .T. | .F.> ]
[ NOXPSTYLE < .T. | .F.> ]
[ ONGOTFOCUS <OnGotfocusProcedure> | bBlock> ]
[ ONLOSTFOCUS OnLostFocusProcedure> | bBlock> ]
[ HANDCURSOR < .T. | .F.> ]
[ NOTABSTOP < .T. | .F.> ]
[ HELPID <nHelpId>]
[ INVISIBLE < .T. | .F.> ]
[ DEFAULT < .T. | .F.> ]
[ ONINIT <bInit> ]
END BUTTONEX
DESCRIPTION:
nRow, nCol
|
Position in the area of ??the window in pixels.
|
nWidth, nHeight
|
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.
|
nImageWIdth
|
Image width (for non bitmap)
|
nImageHeight
|
Image width (for non bitmap)
|
cFontName, nFontSize
|
A reference to the Font name and size .
|
OnActionProcecure
|
Action to be performed when
ButtonEX is Clicked
|
OnGotFocusProcedure
|
Action to be performed when ButtonEx is Focused.
|
OnLostFocusProcedure
|
Action to be performed when ButtonEx is Lost Focused.
|
anBackColor
|
A reference to the Control Background color
|
anFontColor
|
A reference to the Control Font color
|
cToolTipText
|
Specifies the Text for the ToolTip
|
|
|
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) |
DEFAULT
|
?
|
INVISIBLE
|
The visibility property specifies whether or not a control is visible
|
ADJUST
|
?
|
NOTABSTOP
|
Stop the control to receive focus and participate in the tabbing
sequence
|
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 the foreground color for text within the button
| |
Set / Gets the background color for text within the button
| |
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 image height of a button control.
| |
Set / Gets image width 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 / Gets the numeric help topic identifier of the control.
| |
·
Lefttext (D)
|
|
| |
Set 'Flat' Style For Button control
| |
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.
|
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 cannot 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)
The ButtonEx control supports JPG, GIF, TIF and PNG images now.
You can set/get this property at runtime:
Form.ButtonEx.Picture := 'ok.png'
cImage := GetProperty( Form, Control, 'Picture' )
Added a new optional clause IMAGESIZE <w>, <h> to the ButtonEx control.
This property is available at control's definition for NOT Bitmap only.
The alternative syntax is IMAGEWIDTH <w> and IMAGEHEIGHT <h>.
GRADIENTFILL <aGradient> clause where aGradient can contain any number of
gradients and should be specified in the following way:
{ { nPart, nClrStart, nClrEnd }, { nPart, nClrStart, nClrEnd }, ... }
nPart is to be specified as 0.25, 0.5, etc. and should aggregate to 1.
The gradient may be specified as Horizontal or Vertical (default value).
Note:The colored ButtonEx control supports also a simplest form of the GRADIENTFILL <aGradient> clause, and should be specified in the following way:
{ { nClrStart, nClrEnd }, { nClrStart, nClrEnd } }
EXAMPLE: