Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXToggleButton Class Reference

#include <FXToggleButton.h>

Inheritance diagram for FX::FXToggleButton:

FX::FXLabel FX::FXFrame FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject List of all members.

Public Methods

 FXToggleButton (FXComposite *p, const FXString &text1, const FXString &text2, FXIcon *icon1=NULL, FXIcon *icon2=NULL, FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=TOGGLEBUTTON_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD)
 Construct toggle button with two text labels, and two icons, one for each state.

virtual void create ()
 Create server-side resources.

virtual void detach ()
 Detach server-side resources.

virtual FXbool canFocus () const
 Returns true because a toggle button can receive focus.

virtual FXint getDefaultWidth ()
 Get default width.

virtual FXint getDefaultHeight ()
 Get default height.

void setAltText (const FXString &text)
 Change alternate text shown when toggled.

const FXStringgetAltText () const
 Return alternate text.

void setAltIcon (FXIcon *ic)
 Change alternate icon shown when toggled.

FXIcongetAltIcon () const
 Return alternate icon.

void setState (FXbool s=TRUE)
 Change toggled state.

FXbool getState () const
 return toggled state

void setAltHelpText (const FXString &text)
 Change alternate help text shown when toggled.

const FXStringgetAltHelpText () const
 Return alternate help text.

void setAltTipText (const FXString &text)
 Change alternate tip text shown when toggled.

const FXStringgetAltTipText () const
 Return alternate tip text.

void setToggleStyle (FXuint style)
 Set the toggle button style flags.

FXuint getToggleStyle () const
 Get the toggle button style flags.

virtual void save (FXStream &store) const
 Save toggle button to a stream.

virtual void load (FXStream &store)
 Load toggle button from a stream.

virtual ~FXToggleButton ()
 Destructor.


Detailed Description

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. When pressed, the button widget sends a SEL_COMMAND to its target, with the message data set to the current state of the toggle button, of the type FXbool.

See also: