Class Fox::FXToggleButton
In: FXToggleButton.rb
Parent: FXLabel

The toggle button provides a two-state button, which toggles between the on and the off state each time it is pressed. For each state, the toggle button has a unique icon and text label.

Attributes

altText:alternate text, shown when toggled [String]
altIcon:alternate icon, shown when toggled [FXIcon]
state:toggled state [true or false]
altHelpText:alternate status line help text, shown when toggled [String]
altTipText:alternate tool tip message, shown when toggled [String]
toggleStyle:toggle button style [Integer]

Events

The following messages are sent by FXToggleButton to its target:

SEL_COMMAND:sent when the toggle button is pressed.
SEL_KEYPRESS:sent when a key goes down; the message data is an FXEvent instance.
SEL_KEYRELEASE:sent when a key goes up; the message data is an FXEvent instance.
SEL_LEFTBUTTONPRESS:sent when the left mouse button goes down; the message data is an FXEvent instance.
SEL_LEFTBUTTONRELEASE:sent when the left mouse button goes up; the message data is an FXEvent instance.

Toggle button flags

TOGGLEBUTTON_AUTOGRAY:Automatically gray out when not updated
TOGGLEBUTTON_AUTOHIDE:Automatically hide toggle button when not updated
TOGGLEBUTTON_TOOLBAR:Toolbar style toggle button [flat look]
TOGGLEBUTTON_NORMAL:FRAME_RAISED|FRAME_THICK|JUSTIFY_NORMAL|ICON_BEFORE_TEXT
Methods
new   
Attributes
altHelpText  [RW] 
altIcon  [RW] 
altText  [RW] 
altTipText  [RW] 
state  [RW] 
toggleStyle  [RW] 
Public Class methods
new(p, text1, text2, icon1=nil, icon2=nil, tgt=nil, sel=0, opts=TOGGLEBUTTON_NORMAL, x=0, y=0, w=0, h=0, pl=DEFAULT_PAD, pr=DEFAULT_PAD, pt=DEFAULT_PAD, pb=DEFAULT_PAD) {|theToggleButton| ...}

Construct toggle button with two text labels, and two icons, one for each state