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

FX::FXToggleButton Class Reference

The toggle button provides a two-state button, which toggles between the on and the off state each time it is pressed. More...

#include <FXToggleButton.h>

Inheritance diagram for FX::FXToggleButton:

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

Public Member Functions

 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)
virtual void create ()
virtual void detach ()
virtual bool canFocus () const
virtual FXint getDefaultWidth ()
virtual FXint getDefaultHeight ()
void setAltText (const FXString &text)
FXString getAltText () const
void setAltIcon (FXIcon *ic)
FXIcongetAltIcon () const
void setState (FXbool s=TRUE, FXbool notify=FALSE)
FXbool getState () const
void setAltHelpText (const FXString &text)
FXString getAltHelpText () const
void setAltTipText (const FXString &text)
FXString getAltTipText () const
void setToggleStyle (FXuint style)
FXuint getToggleStyle () const
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXToggleButton ()

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:


Constructor & Destructor Documentation

FX::FXToggleButton::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 FX::FXToggleButton::~FXToggleButton  )  [virtual]
 

Destructor.


Member Function Documentation

virtual void FX::FXToggleButton::create  )  [virtual]
 

Create server-side resources.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

virtual void FX::FXToggleButton::detach  )  [virtual]
 

Detach server-side resources.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

virtual bool FX::FXToggleButton::canFocus  )  const [virtual]
 

Returns true because a toggle button can receive focus.

Reimplemented from FX::FXWindow.

virtual FXint FX::FXToggleButton::getDefaultWidth  )  [virtual]
 

Get default width.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

virtual FXint FX::FXToggleButton::getDefaultHeight  )  [virtual]
 

Get default height.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

void FX::FXToggleButton::setAltText const FXString text  ) 
 

Change alternate text shown when toggled.

FXString FX::FXToggleButton::getAltText  )  const [inline]
 

Return alternate text.

void FX::FXToggleButton::setAltIcon FXIcon ic  ) 
 

Change alternate icon shown when toggled.

FXIcon* FX::FXToggleButton::getAltIcon  )  const [inline]
 

Return alternate icon.

void FX::FXToggleButton::setState FXbool  s = TRUE,
FXbool  notify = FALSE
 

Change toggled state.

FXbool FX::FXToggleButton::getState  )  const [inline]
 

return toggled state

void FX::FXToggleButton::setAltHelpText const FXString text  ) 
 

Change alternate help text shown when toggled.

FXString FX::FXToggleButton::getAltHelpText  )  const [inline]
 

Return alternate help text.

void FX::FXToggleButton::setAltTipText const FXString text  ) 
 

Change alternate tip text shown when toggled.

FXString FX::FXToggleButton::getAltTipText  )  const [inline]
 

Return alternate tip text.

void FX::FXToggleButton::setToggleStyle FXuint  style  ) 
 

Set the toggle button style flags.

FXuint FX::FXToggleButton::getToggleStyle  )  const
 

Get the toggle button style flags.

virtual void FX::FXToggleButton::save FXStream store  )  const [virtual]
 

Save toggle button to a stream.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

virtual void FX::FXToggleButton::load FXStream store  )  [virtual]
 

Load toggle button from a stream.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

Copyright © 1997-2005 Jeroen van der Zijp