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 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.

Get default width.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

Get default height.

Reimplemented from FX::FXLabel.

Reimplemented in FX::FXTriStateButton.

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

Change alternate text shown when toggled.

Return alternate text.

Change alternate icon shown when toggled.

Return alternate icon.

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

Change toggled state.

return toggled state

Change alternate help text shown when toggled.

Return alternate help text.

Change alternate tip text shown when toggled.

Return alternate tip text.

Set the toggle button style flags.

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