Button label

label = “text”

The label to appear on the button. The label appears centralised on the button.

The label determines the default button size, as the button is created the minimum width necessary to contain the label (and, in the case of checkbox and radio buttons, the checkbox).

Normally the border of a button is drawn immediately around the label, with no spaces. The label text may however be used to force spacing, because leading and trailing spaces enclosed in the label string are respected. This technique can be used to make a set of linked buttons, or a vertical column of buttons, all the same default size regardless of the length of their label. The width clause may also be used to fix the size of a button. The best method, however, is to use the Layout->Make Same Size menu option in the Sculptor program designer.

A character in the button label which is preceded by an ampersand ( & ) is the hotkey for that button. The ampersand is not displayed on the screen. The hotkey is given a distinct appearance when the label is displayed, such as a different colour, reverse or underline. When the hotkey is pressed, the button is immediately brought into focus and pressed.

On multi buttons, the label is by default displayed to the right of the checkbox data. The style flag WS_LJT can be used to place the label to the left.

EXAMPLES:

label = "&Cancel"
label = "Find by &Name"
label = "OK"

label_font = “text”

Font for the label. See Fonts.

Default: The window font.

label_bgc = rgb_value
label_fgc = rgb_value

Background and foreground colours for the label. See Colours.

Default: For a button group or ungrouped button, the defaults are the parent window’s label colour values. For a grouped button, the defaults are the group label colours.

EXAMPLES:

label_bgc = RGB_BISQUE
label_fgc = RGB_PLUM

label_pen = integer

Pen for the label. Any suitable pen from the button palette may be used. See Pens. From Sculptor 5 onwards, with the introduction of Colour clauses, it is recommended that the label_bgc and label_fgc clauses are used in preference to label_pen.

Default: The default label pen. In a Sculptor palette this is PEN_BUTTON_LABEL (29) for push buttons and PEN_MULTI_LABEL (31) for checkbox and radio buttons.

EXAMPLE:

label_pen = PEN_TEXTBOX_LABEL

See example


RELATED TOPICS

Buttons