Using IlvButton
The class IlvButton defines a rectangular area that the user can click. IlvButton is a subclass of IlvMessageLabel around which it adds a relief rectangle.
A Button
The label that appears inside a button can have various alignment settings and can be localized. For details about these properties, see Using IlvMessageLabel.
This section covers the following topics:
Displaying a Bitmap in a Button
A button can display a bitmap. Four kinds of bitmaps can be displayed: sensitive, nonsensitive, selected, and highlighted.
Sensitive bitmaps are described in Associating a Bitmap with a Message Label.
A selected bitmap is displayed when the button is clicked. To set a selected bitmap, use setSelectedBitmap.
A highlighted bitmap is displayed when the mouse is over the button. To set a highlighted bitmap, use setHighlightedBitmap.
Displaying the Button Frame
You can use the
Button with Frame Hidden (Left) and with Frame Displayed (Right)
Associating a Mnemonic with a Button
A button label can be associated with a mnemonic letter. When you press the key corresponding to the mnemonic letter, the activate member function is called. If the button does not have the keyboard focus, you must press the modifier key (Alt on PCs and Meta on UNIX) with the letter.
See Associating a Mnemonic with a Gadget Label.
Event Handling and Callbacks
When the user clicks a button or presses the mnemonic letter associated with it, or presses the Enter key or the space bar, the activate member function is called. This virtual member function calls the Main callback of the button.
See Handling Events and Associating a Callback with a Gadget.