BUTTON Create/Control Button

BUTTON Properties

The Button control is usually designed to send a signal to the application to perform a specific action when a user clicks the button. The signal typically indicates that the user wants to end a function or initiate a new function.

This control can be created either by using the BUTTON directive or by using the NOMADS Panel Designer to draw a Button Control and apply the desired attributes.

Below is a list of properties used to define and manipulate Button controls. Use the links in the Property column to access the PxPlus Help page for a selected property. The Help page may provide additional details, particularly if the property can be used to define other controls.

For a complete list of all the properties available, see Properties List.

Property

Description

ActiveBackColor$
ActiveBackColour$

Background color when button is pressed. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

ActiveBorderColor$
ActiveBorderColour$

Color(s) of button border when button is pressed. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

Border colors are applied only if a Border$ property is specified for the button.

ActiveTextColor$
ActiveTextColour$

Foreground text color when button is pressed. For information on valid color names and color specifications, see Color Properties.

BackColor$
BackColour$

Background color. For information on valid color names and color specifications, see Color Properties. (Default: "DEFAULT")

BitmapPosition

Defines where in a button the bitmap will be positioned relative the text on a button. It is only applicable if there is both a bitmap and text on the button.

Possible values are:

1

To the left of the button text. (Default)

2

To the right of the button text.

3

Above the button text.

4

Below the button text.

5

Bitmap is centered and scaled to fill the button. Button text, if present, will be centered and overlay the image.

(The Bitmap Centered option was added in PxPlus 2018 Update 1.)

Border$

Controls the type of border that will be used when drawing a button. Possible values and formats are Solid, None, Double, Groove, Ridge, Inset and Outset.

    

If not set, it will have the value of "Default" (or ""), which indicates that the system should use the system default button styling.

BorderColor$
BorderColour$

Controls the color(s) of the border for any button whose border style (see Border$ property) is other than the system default. For information on valid color names and color specifications, see Color Properties.

This property can include either one or two colors separated by a / (slash). If only a single color is provided, then this color is used for all four borders. If two colors are supplied, the first color is used to define the Top/Left borders, while the second color is used to define the Bottom/Right borders.

The value can be set to either a numeric or a string value. If setting a numeric value, the value set is the internal color number for the desired color. If setting a string value, any form of color specification may be used (color name, RGB, HSL, or HTML color code).

BorderWidth

Controls the width of the border (in pixels) for any button whose border style (see Border$ property) is other than the system default. This property can only contain a numeric integer.

BringToTop

This property, when set to any value, will cause the control to be moved to the top of the display order. Once at the top of the display order, the control will appear visually on top of any other control on the window. (Default: Not Applicable - Always returns 0)

Col

Screen position (column) of control.

Cols

Width of control in column units.

CtlName$

Control type ("BUTTON"). See BUTTON directive.

Cursor

Controls the type of cursor to display whenever the mouse moves over the specified control. Possible values are:

 

0 = Arrow

 7 = Rabbit in Hat

 

1 = Wait (Hourglass)

 8 = Happy Face

 

2 = I-Beam

 9 = Sad Face

 

3 = Movement Arrows

10 = Resize Vertical Up/Down Arrow

 

4 = Sizing Arrow

11 = Resize Horizontal Left/Right Arrow

 

5 = Hand

12 = Not Allowed (Diagonal line across circle)

 

6 = Hand in Crossed Circle ("No" hand)

 -1 = Default Cursor (Default)

DisableBackColor$
DisableBackColour$

Background color when button is disabled. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

DisableBorderColor$
DisableBorderColour$

Button border color when button is disabled. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

Border colors are applied only if a Border$ property is specified for the button.

DisableTextColor$
DisableTextColour$

Foreground text color when button is disabled. For information on valid color names and color specifications, see Color Properties.

Enabled

Enabled indicator: 1 = True; 0 = False (Default: 1)

Eom$

Last change terminator.

Focus

Focus indicator: 1 = Control has focus (Default: 0)

FocusBackColor$
FocusBackColour$

Background color when the control has focus. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

FocusBorderColor$
FocusBorderColour$

Color(s) of button border when button has focus. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

Border colors are applied only if a Border$ property is specified for the button.

FocusTextColor$
FocusTextColour$

Foreground text color when the control has focus. For information on valid color names and color specifications, see Color Properties.

Font$

This property is used to reference the font for a control. It will contain (or can be set to) a string containing three comma-separated fields of the font name, size and attributes. See 'FONT' mnemonic.

Example:

To set the font to Arial, 1.5 times normal size, and Bold, the format would be xxx'Font$="Arial,1.5,B".

Height

Height of control in pixels.

HoverBackColor$
HoverBackColour$

Background color when mouse is over a button. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

HoverBorderColor$
HoverBorderColour$

Color(s) of button border when mouse is over a button. Two colors can be specified for buttons by using the / (slash) as a separator (i.e. RGB:100 100 100/Light Blue). For information on valid color names and color specifications, see Color Properties.

Border colors are applied only if a Border$ property is specified for the button.

HoverColor$
HoverColour$

Hover color. The button is highlighted when the mouse moves over its location. For information on valid color names and color specifications, see Color Properties. (Default: "DEFAULT")

HoverTextColor$
HoverTextColour$

Foreground text color when mouse is over a button. For information on valid color names and color specifications, see Color Properties.

hWnd

Windows handle for control.

ImageCount

Number of images contained in a bitmap button: 1 to 4. (Default: 0)

Key$

Hot key to jump to control.

Left

Left margin for control in pixels.

Line

Screen position of control.

Lines

Height of control in number of lines.

LookAndFeel

Defines how a control will look. Possible values are:

2

Old Windows 3.1 2D look.

3

Windows 95/98 3D look.

4

Windows XP/Vista/Windows 7 look.

MaxValue

Maximum value that the control will return. For a button (sizer) control, this property can be set to the highest location (line or column) that the control will allow itself to be dragged.

MenuCtl

This property reports/sets the CTL value to generate when an object is selected on a right-click of the mouse.

MinValue

Minimum value that the control will return. For a button (sizer) control, this property can be set to the lowest location (line or column) that the control will allow itself to be dragged.

Moveable

Controls whether a button can be dragged/moved to a new position. (Default: 0)

If set to 1, the button can be dragged/moved. This movement will not be saved. If set to 0 (Default), the button location is fixed.

Its initial value is determined by the presence of the "M" option. See BUTTON OPT= Settings in the BUTTON Create directive.

(The Moveable property was added in PxPlus 2018 Update 1.)

Msg$

Message line text for the control.

ObjectID

User object method. (Default: 0 - No object specified)

The 'ObjectID property allows applications to intercept property values and add methods to controls. When set to a valid Object ID by the application, you can add methods and add/override property logic for any control in the system. When set in the system, it allows the application to logically request methods against the control that, in turn, will be performed by the related Object ID. It will also first check the object for any property requests and, if the property is defined in the object, set or get that property instead of the controls.

To allow the specified object to get true access to the control, while executing within the object identified by the 'ObjectID property, the system will direct any property requests directly to the control.

Note:
When a control is deleted from the system, any object identified by an 'ObjectID property will be automatically dropped.

OnFocusCtl

On Focus CTL event. 0 is returned if no On Focus CTL value is set up for the control.

OnTipCtl

This property controls the CTL event that will be fired prior to the system displaying the Tip for any control. If the value of this property is non-zero, the system will use its value of a CTL event to fire and will defer the display of the tip until the application changes the value in 'Tip$. If the value in 'Tip$ is not changed, no tip will be displayed.

Setting this to zero (Default) disables the event from being sent and the current 'Tip$ will be displayed.

Parent

Parent window handle.

SignalOnly

Signal only - do not get focus: 0 = Off; 1 = On. (Default: 0)

This property can also be read, returning 1 or 0 to indicate if the control is to signal only and not get focus.

Text$

Text of item or label.

TextColor$
TextColour$

Foreground text color. For information on valid color names and color specifications, see Color Properties. (Default: "DEFAULT")

Tip$

Tip message for control.

Top

Top of control in pixels.

Underline

Underline button text.

Value$

Current item value.

Visible

Control visible flag: 1 = Yes; 0 = No (Default: 1)

Width

Width of control in pixels.

_PropList$

Controls the list of properties to be returned in '_PropValues$. Each value is separated by the value in '_PropSep$.

This property can be used to speed up the processing of multiple property accesses but reducing the number of interactions with the control. See Multi-Property Access.

_PropSep$

Controls the separator used between each of the values of the properties returned in '_PropValues$ as defined by '_PropList$.

This property can be used to speed up the processing of multiple property accesses but reducing the number of interactions with the control. See Multi-Property Access.

_PropValues$

Accesses the values of the properties defined in '_PropList$. Each value is separated by the value in '_PropSep$.

This property can be used to speed up the processing of multiple property accesses but reducing the number of interactions with the control. See Multi-Property Access.

See Also

Color Properties
'COLOUR' & '_COLOUR' Mnemonic
Using Property Names
Compound Properties