
The button fires a ONE::util::ActionEvent with either TOGGLE_ON or TOGGLE_OFF when toggled.
Public Types | |
| typedef ONE::util::ConstIterator< const Widget * > | ChildConstItr |
| typedef ONE::util::SmartPointer< ChildConstItr, ONE::util::DestructiveCopy > | ChildConstItrSP |
| typedef ONE::util::Iterator< Widget * > | ChildItr |
| typedef ONE::util::SmartPointer< ChildItr, ONE::util::DestructiveCopy > | ChildItrSP |
| typedef ActionListener * | LPtr |
Public Member Functions | |
| virtual void | add (Component *, const LayoutConstraint *) |
| void | addActionListener (const LPtr &l) |
| virtual void | clear () |
| void | draw (Renderer2D *r, const int &x, const int &y, const int &w, const int &h) |
| draws a portion of this object | |
| void | draw (Renderer2D *) |
| draws this object. | |
| EventDispatcher () | |
| void | fireEvent (ActionEvent &e) const |
| notifies all registered listeners | |
| Color | getBackground () const |
| accesses the color that should be used to render the object's background. | |
| const BrdSP & | getBorder () const |
| accesses the component's border | |
| const BrdDSP & | getBorderDelegate () const |
| const Bounds & | getBounds () const |
| accesses this object's bounds | |
| virtual int | getChildCount () const |
| virtual ChildConstItrSP | getChildren () const |
| virtual ChildItrSP | getChildren () |
| Bounds | getContentBounds () const |
| calculates the bounds around the label string and icon, if available | |
| const IMSP & | getDefaultInputMap () const |
| accesses this widget's default input map | |
| const UIDSP & | getDelegate () const |
| DelegateID | getDelegateID () const |
| Color | getDisabledBackground () const |
| accesses the color that should be used to render the object's background when the object is disabled | |
| Color | getDisabledForeground () const |
| accesses the color that should be used to render the object's foreground when the object is disabled. | |
| const IconSP & | getDisabledIcon () const |
| accesses the disabled icon | |
| Color | getFocus () const |
| accesses the color that should be used to render the component focus | |
| const FntSP & | getFont () const |
| accesses the font that should be used to render the label's text | |
| Color | getForeground () const |
| accesses the color that should be used to render the object's foreground. | |
| unsigned char | getHorizontalAlignment () const |
| const IconSP & | getIcon () const |
| accesses this label's standard icon | |
| const Point & | getIconOffset () const |
| const IMSP & | getInputMap () const |
| Fringe | getPadding () const |
| Widget * | getParent () const |
| const Point & | getPosition () const |
| accesses this object's position | |
| Size | getPreferredSize () const |
| determines this object's preferred size. | |
| const Size & | getSize () const |
| accesses this object's size | |
| const std::string & | getText () const |
| accesses the label's text | |
| const Point & | getTextOffset () const |
| accesses the text position offset | |
| unsigned char | getVerticalAlignment () const |
| virtual bool | hasChildren () const |
| bool | hasFocus () const |
| checks if this component has the input focus | |
| bool | isEnabled () const |
| checks if this widget is enabled | |
| bool | isMuted () const |
| reflects this dispatcher's muted state. | |
| bool | isOpaque () const |
| checks this object's opacity | |
| bool | isPressed () const |
| checks if the button is pressed | |
| bool | isSelected () const |
| virtual bool | isUnder (const Point &) const |
| virtual bool | isVisible () const |
| acesses the visibility property | |
| void | layout () |
| lays out this component's internal elements | |
| void | processKeyEvent (KeyEvent &) |
| does nothing | |
| void | processMouseMotion (MouseEvent &) |
| does nothing | |
| void | processMousePress (MouseEvent &) |
| does nothing | |
| void | processMouseRelease (MouseEvent &) |
| does nothing | |
| void | releaseFocus () const |
| drops the input focus | |
| virtual void | remove (Component *) |
| void | removeActionListener (const LPtr &l) |
| bool | requestFocus () |
| requests the input focus for this component. | |
| void | scheduleLayout () |
schedules a call to layout | |
| void | setBackground (const Color &c, bool laf=true) |
| changes this object's background color | |
| void | setBorder (const BrdSP &b, bool laf=true) |
| changes the component's border | |
| void | setBounds (const int &x, const int &y, const int &w, const int &h) |
| void | setBounds (const Bounds &b) |
| changes this object's bounds | |
| void | setDisabledBackground (const Color &c, bool laf=true) |
| changes this object's disabled background color | |
| void | setDisabledForeground (const Color &c, bool laf=true) |
| changes this object's disabled foreground color | |
| void | setDisabledIcon (const IconID &icon) |
| sets this label's disabled icon | |
| void | setDisabledIcon (const IconSP &icon) |
| sets this label's disabled icon | |
| virtual void | setEnabled (bool) |
| enables or disables this component | |
| void | setFocus (const Color &c, bool laf=true) |
| changes the color that will be used to draw the component focus marker | |
| void | setFont (const FntSP &fnt, bool laf=true) |
| void | setForeground (const Color &c, bool laf=true) |
| changes this object's foreground color | |
| void | setHorizontalAlignment (const char &halign, bool laf=true) |
| void | setIcon (const IconID &icon) |
| changes this label's icon | |
| void | setIcon (const IconSP &icon) |
| changes this label's icon | |
| void | setInputMap (const IMSP &im, bool laf=true) |
| void | setMuted (bool mute) |
| mutes or un-mutes the dispatcher | |
| void | setOpaque (bool o, bool laf=true) |
| changes this object's opacity | |
| void | setParent (Widget *p) |
| changes this component's parent | |
| void | setPosition (const int &x, const int &y) |
| void | setPosition (const Point &p) |
| changes this object's position | |
| void | setPreferredSize (const Size &s) |
| sets the object's preferred size | |
| void | setPressed (bool) |
| void | setSelected (bool) |
| void | setSize (const int &w, const int &h) |
| void | setSize (const Size &s) |
| changes this object's size | |
| void | setText (const std::string &t) |
| changes the label's text | |
| void | setVerticalAlignment (const char &valign, bool laf=true) |
| virtual void | setVisible (bool vis) |
| ToggleButton (const std::string &t, const IconID &sicn, const IconID &dicn=UNKNOWN_ICON) | |
| ToggleButton (const std::string &t, const IconSP &sicn=0, const IconSP &dicn=0) | |
| ToggleButton (const IconID &sicn, const IconID &dicn=UNKNOWN_ICON) | |
| ToggleButton (const IconSP &sicn, const IconSP &dicn=0) | |
| void | updateUI () |
Static Public Attributes | |
| static const util::Command | TOGGLE_OFF |
| the button is no longer selected | |
| static const util::Command | TOGGLE_ON |
| the button is now selected | |
Protected Types | |
| typedef unsigned int | bits |
Protected Member Functions | |
| void | add (const LPtr &l) |
| registers a listener | |
| void | buttonPressed () |
| void | buttonReleased (bool) |
| void | doDraw (Renderer2D *, const int &, const int &, const int &, const int &) |
| performs subclass-specific drawing | |
| bool | getBit (const bits &bit) const |
| void | layout (const Bounds &b) |
lays out the text using b as the usable area. | |
| void | remove (const LPtr &l) |
| de-registers a listener. | |
| void | setBit (const bits &bit, bool val) |
Protected Attributes | |
| Point | iconOffset |
| Size | prefSize |
| Point | textOffset |
Static Protected Attributes | |
| static const bits | ENABLED |
| static const bits | LSCHED |
| set when this object is scheduled to be laid out | |
| static const bits | OPQ |
| opacity bit | |
| static const bits | VIS |
| visibility bit | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
registers a listener
|
|
||||||||||||
|
the default implementation of this function does nothing Implements ONE::gui::Widget. Reimplemented in ONE::gui::Panel. |
|
|
|
|
|
Implements ONE::gui::AbstractButton. |
|
|
Implements ONE::gui::AbstractButton. |
|
|
the default implementation of this function does nothing Implements ONE::gui::Widget. Reimplemented in ONE::gui::Panel. |
|
||||||||||||||||||||||||
|
performs subclass-specific drawing
Implementations of this function may assume that this object is visible and that
Implements ONE::gui::Displayable. |
|
||||||||||||||||||||||||
|
draws a portion of this object
This function calls
|
|
|
draws this object.
This function calls |
|
|
|
|
|
notifies all registered listeners
The listeners are called in the order in which they were added.
|
|
|
accesses the color that should be used to render the object's background.
|
|
|
|
|
|
accesses the component's border
|
|
|
|
|
|
accesses this object's bounds
The
|
|
|
the default implementation of this function returns Implements ONE::gui::Widget. Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport. |
|
|
the default implementation of this function returns Implements ONE::gui::Widget. Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport. |
|
|
the default implementation of this function returns Implements ONE::gui::Widget. Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport. |
|
|
calculates the bounds around the label string and icon, if available
|
|
|
accesses this widget's default input map The default implementation returns an empty map. Subclasses may override this function in order to specify a different default map.
Reimplemented from ONE::gui::Widget. |
|
|
|
|
|
Reimplemented from ONE::gui::Label. Reimplemented in ONE::gui::CheckBox. |
|
|
accesses the color that should be used to render the object's background when the object is disabled
|
|
|
accesses the color that should be used to render the object's foreground when the object is disabled.
|
|
|
accesses the disabled icon
|
|
|
accesses the color that should be used to render the component focus
|
|
|
accesses the font that should be used to render the label's text
|
|
|
accesses the color that should be used to render the object's foreground.
|
|
|
|
|
|
accesses this label's standard icon
|
|
|
|
|
|
|
|
|
|
|
|
Implements ONE::gui::Widget. |
|
|
accesses this object's position
|
|
|
determines this object's preferred size.
If this object has a non-degenerate preferred size (i.e. Implements ONE::gui::Displayable. |
|
|
accesses this object's size
|
|
|
accesses the label's text
|
|
|
accesses the text position offset The offset specifies the position of the label string's top left corner relative to this component's position.
|
|
|
|
|
|
the default implementation of this function returns Implements ONE::gui::Widget. Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport. |
|
|
checks if this component has the input focus
This function queries the
Implements ONE::gui::Control. |
|
|
checks if this widget is enabled
Implements ONE::gui::Control. |
|
|
reflects this dispatcher's muted state.
|
|
|
checks this object's opacity objects that are set to not opaque (i.e. transparent) should not draw their background display.
|
|
|
checks if the button is pressed
|
|
|
|
|
|
This implementation checks if the given point is within the widget's bounds and then queries the delegate. Implements ONE::gui::Control. Reimplemented in ONE::gui::Picture. |
|
|
acesses the visibility property
The default value is
|
|
|
lays out this component's internal elements
This function may not change this object's bounds. Implementations should lay out their internal elements according to the currently set bounds. Implements ONE::gui::Displayable. |
|
|
lays out the text using
|
|
|
does nothing
Reimplemented from ONE::gui::Label. |
|
|
does nothing
Reimplemented from ONE::gui::Label. |
|
|
does nothing
Reimplemented from ONE::gui::Label. |
|
|
does nothing
Reimplemented from ONE::gui::Label. |
|
|
drops the input focus
Implements ONE::gui::Control. |
|
|
de-registers a listener.
This listener will no longer notify
|
|
|
the default implementation of this function does nothing Implements ONE::gui::Widget. Reimplemented in ONE::gui::Panel. |
|
|
|
|
|
requests the input focus for this component.
The
Implements ONE::gui::Control. |
|
|
schedules a call to
This function makes component layout more efficient as several calls to this function within one frame duration result in only one call to |
|
||||||||||||
|
changes this object's background color
The setting is active immediately. If
|
|
||||||||||||
|
|
|
||||||||||||
|
changes the component's border
If
|
|
||||||||||||||||||||
|
|
|
|
changes this object's bounds
See
|
|
||||||||||||
|
changes this object's disabled background color
The setting is active immediately. If
|
|
||||||||||||
|
changes this object's disabled foreground color
The setting is active immediately. If
|
|
|
sets this label's disabled icon
See |
|
|
sets this label's disabled icon
This icon must have the same dimension as the standard icon. If no standard icon is set, it will be set to |
|
|
enables or disables this component Disabled components no longer react to user input. If this object has children, they are modified accordingly. Implements ONE::gui::Control. Reimplemented in ONE::gui::Button, ONE::gui::Console, ONE::gui::Frame, and ONE::gui::TitleBar. |
|
||||||||||||
|
changes the color that will be used to draw the component focus marker
The setting is active immediately. If
|
|
||||||||||||
|
|
|
||||||||||||
|
changes this object's foreground color
The setting is active immediately. If
|
|
||||||||||||
|
|
|
|
changes this label's icon
This function removes the old icon (if present) but does not recalculate the component layout. The new icon will be displayed only after |
|
|
changes this label's icon Note that this icon must have the same dimension as the disabled icon. |
|
||||||||||||
|
|
|
|
mutes or un-mutes the dispatcher Muted dispatchers no longer notify their listeners. |
|
||||||||||||
|
changes this object's opacity
The setting is active immediately. If
|
|
|
changes this component's parent If a previous parent was set, this component will be removed from it.
|
|
||||||||||||
|
|
|
|
changes this object's position Note that this function does not request a re-layout.
|
|
|
sets the object's preferred size If the value is set to an empty size object, the component will calculate its preferred size.
|
|
|
Reimplemented from ONE::gui::AbstractButton. |
|
|
|
|
||||||||||||
|
|
|
|
changes this object's size Note that this function does not request a re-layout.
|
|
|
changes the label's text
This function calls
|
|
||||||||||||
|
|
|
|
This function releases the input focus if the widget is set to invisible. Reimplemented from ONE::gui::Displayable. |
|
|
Reimplemented from ONE::gui::Label. Reimplemented in ONE::gui::CheckBox, and ONE::gui::RadioButton. |
|
|
|
|
|
|
|
|
set when this object is scheduled to be laid out
|
|
|
opacity bit
|
|
|
|
|
|
|
|
|
the button is no longer selected
|
|
|
the button is now selected
|
|
|
visibility bit
|
1.4.3