A bitmap button is a control that contains a bitmap. It may be placed on a dialog box or panel, or indeed almost any other window.
A bitmap button can be supplied with a single bitmap, and Widgets will draw all button states using this bitmap. If the application needs more control, additional bitmaps for the selected state, unpressed focused state, hover state and and greyed-out disabled state may be supplied.
BU_AUTODRAW |
Ifthis is specified, the button will be drawn automatically using the label bitmap only, providinga 3D-look border. If this style is not specified, the button will be drawn without borders and using allprovided bitmaps. WIN32 only. |
BU_LEFT |
Left-justifies the bitmap label. WIN32 only. |
BU_TOP |
Aligns the bitmap label to the top of the button. WIN32 only. |
BU_RIGHT |
Right-justifies the bitmap label. WIN32 only. |
BU_BOTTOM |
Aligns the bitmap label to the bottom of the button. WIN32 only. |
Note that BU_EXACTFIT supported by
Button is not used by this class as bitmap buttons
don’t have any minimal standard size by default.
See also window styles overview.
| evt_button(id) { | event | ... } | Process a EVT_COMMAND_BUTTON_CLICKED event,when the button is clicked. |
The bitmap parameter is normally the only bitmap you need to provide, and Widgets will draw the button correctly in its different states. If you want more control, call any of the functions BitmapButton#set_bitmap_selected, BitmapButton#set_bitmap_focus, BitmapButton#set_bitmap_hover, BitmapButton#set_bitmap_disabled.
Note that the bitmap passed is smaller than the actual button created.
BitmapButton#create, Validator
Boolean create(Window parent, Integer id, Bitmap bitmap,
Point pos,
Size size = DEFAULT_SIZE,
Integer style = 0,
Validator validator,
String name = "button")
Button creation function for two-step creation. For more details, see BitmapButton.new.
Bitmap get_bitmap_disabled()
Returns the bitmap for the disabled state.
BitmapButton#set_bitmap_disabled
Bitmap get_bitmap_focus()
Returns the bitmap for the focused state.
Bitmap get_bitmap_hover()
Returns the bitmap for the focused state.
Bitmap get_bitmap_label()
Returns the label bitmap (the one passed to the constructor).
Bitmap get_bitmap_selected()
Returns the bitmap for the selected state.
BitmapButton#set_bitmap_selected
set_bitmap_disabled(Bitmap bitmap)
Sets the bitmap for the disabled button appearance.
BitmapButton#get_bitmap_disabled, BitmapButton#set_bitmap_label, BitmapButton#set_bitmap_selected, BitmapButton#set_bitmap_focus
set_bitmap_focus(Bitmap bitmap)
Sets the bitmap for the button appearance when it has the keyboard focus.
BitmapButton#get_bitmap_focus, BitmapButton#set_bitmap_label, BitmapButton#set_bitmap_selected, BitmapButton#set_bitmap_disabled
set_bitmap_focus(Bitmap bitmap)
Sets the bitmap for the button appearance when it has the keyboard focus.
BitmapButton#get_bitmap_focus, BitmapButton#set_bitmap_label, BitmapButton#set_bitmap_selected, BitmapButton#set_bitmap_disabled
set_bitmap_label(Bitmap bitmap)
Sets the bitmap label for the button.
This is the bitmap used for the unselected state, and for all other states if no other bitmaps are provided.
set_bitmap_selected(Bitmap bitmap)
Sets the bitmap for the selected (depressed) button appearance.
BitmapButton#get_bitmap_selected, BitmapButton#set_bitmap_label, BitmapButton#set_bitmap_focus, BitmapButton#set_bitmap_disabled
[This page automatically generated from the Textile source at Wed Sep 09 02:21:02 +0100 2009]