|
button - push, default or cancel button handle appearance - visual style: 0: native (initial) 1: primary 2: secondary 3: subtle 4: danger alignment (optional) - where the text and icon sit: 0: centred (default) 1: left 2: right |
|
Chooses a push button's visual style. Windows keyboard handling, focus, access keys and accessibility are retained, and the button's CreateButton style, bounds and events are unchanged. Every button starts with native appearance. Primary is blue, secondary has a light face and border, subtle has a quiet face until hovered or pressed, and danger is red - use clear action labels as well as colour. Hover, pressed, disabled, default and focus states are drawn. Windows high contrast automatically uses native painting. Nonzero appearances require a push, default or cancel button (CreateButton styles 1, 4 or 5). Check boxes and radio buttons only accept appearance 0. Invalid appearances cause a runtime error. The alignment moves the text, with its icon, to one side inside the padding, which suits a full-width button such as a collapsible section heading. Every appearance, including native, follows it. Styled buttons start with 16 logical pixels of horizontal padding and 8 vertical pixels per side. Use the preferred-size commands to fit the text: button=CreateButton("Choose colour...",20,20,1,1,window) SetButtonAppearance button,1 SetGadgetShape button,20,20,ButtonPreferredWidth(button),ButtonPreferredHeight(button) See the complete 10_Modern_Control_Showcase.bb sample. See also: SetButtonPadding, ButtonPreferredWidth, ButtonPreferredHeight, CreateButton. |