Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::gui::Button Class Reference

Inheritance diagram for ONE::gui::Button:

Inheritance graph
[legend]
List of all members.

Detailed Description

a button widget.

Button s are activated by clicking (i.e. pressing and releasing) a mouse button inside the widget's bounds. The clicks may be detected by registering an ActionListener with the button. Two methods are available for separation of actions from several buttons. The ActionEvent::getSource() function returns a pointer to the button that was clicked. In addition, the button's command id is reflected by the ActionEvent::getCommand() function. This id may be modified for each button by calling the Button::setCommand() function. The mouse button recognized as a click may be changed through the ACTIVATION_CLICK LaF property.

Author:
Daniel Seibert


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)
 Button (const IconSP &sicn, const IconSP &dicn=0, const util::Command &cmd=DEFAULT_COMMAND)
 Button (const IconID &sicn, const IconID &dicn=UNKNOWN_ICON, const util::Command &cmd=DEFAULT_COMMAND)
 Button (const std::string &text="", const util::Command &cmd=DEFAULT_COMMAND)
 creates a new button
virtual void clear ()
void click ()
 emulates a click on the button
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 BrdSPgetBorder () const
 accesses the component's border
const BrdDSPgetBorderDelegate () const
const BoundsgetBounds () const
 accesses this object's bounds
virtual int getChildCount () const
virtual ChildConstItrSP getChildren () const
virtual ChildItrSP getChildren ()
const util::CommandgetCommand () const
 retrieves the currently set action commandthe command
Bounds getContentBounds () const
 calculates the bounds around the label string and icon, if available
const IMSPgetDefaultInputMap () const
 accesses this widget's default input map
const UIDSPgetDelegate () 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 IconSPgetDisabledIcon () const
 accesses the disabled icon
Color getFocus () const
 accesses the color that should be used to render the component focus
const FntSPgetFont () 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 IconSPgetIcon () const
 accesses this label's standard icon
const PointgetIconOffset () const
const IMSPgetInputMap () const
Fringe getPadding () const
WidgetgetParent () const
const PointgetPosition () const
 accesses this object's position
Size getPreferredSize () const
 determines this object's preferred size.
const SizegetSize () const
 accesses this object's size
const std::string & getText () const
 accesses the label's text
const PointgetTextOffset () 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
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 setCommand (const util::Command &cmd)
 changes the click action command
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
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
virtual void setPressed (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)
void updateUI ()

Static Public Attributes

static const util::Command DEFAULT_COMMAND
 the default command that is used when no command id is set

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


Member Typedef Documentation

typedef unsigned int ONE::gui::Displayable::bits [protected, inherited]
 

typedef ONE::util::ConstIterator<const Widget*> ONE::gui::Widget::ChildConstItr [inherited]
 

typedef ONE::util::SmartPointer<ChildConstItr,ONE::util::DestructiveCopy> ONE::gui::Widget::ChildConstItrSP [inherited]
 

typedef ONE::util::Iterator<Widget*> ONE::gui::Widget::ChildItr [inherited]
 

typedef ONE::util::SmartPointer<ChildItr,ONE::util::DestructiveCopy> ONE::gui::Widget::ChildItrSP [inherited]
 

typedef ActionListener * ONE::util::EventDispatcher< ActionEvent , ActionListener , struct ActionRelay >::LPtr [inherited]
 


Constructor & Destructor Documentation

ONE::gui::Button::Button const std::string &  text = "",
const util::Command cmd = DEFAULT_COMMAND
 

creates a new button

The button is labeled with the text string. The click action command is set to cmd, see Button::setCommand() for details.

Parameters:
text the button's label
cmd the action command

ONE::gui::Button::Button const IconID sicn,
const IconID dicn = UNKNOWN_ICON,
const util::Command cmd = DEFAULT_COMMAND
 

ONE::gui::Button::Button const IconSP sicn,
const IconSP dicn = 0,
const util::Command cmd = DEFAULT_COMMAND
 


Member Function Documentation

void ONE::util::EventDispatcher< ActionEvent , ActionListener , struct ActionRelay >::add const LPtr l  )  [protected, inherited]
 

registers a listener

Parameters:
l a listener

virtual void ONE::gui::Component::add Component ,
const LayoutConstraint
[virtual, inherited]
 

the default implementation of this function does nothing

Implements ONE::gui::Widget.

Reimplemented in ONE::gui::Panel.

void ONE::util::ActionDispatcher::addActionListener const LPtr l  )  [inline, inherited]
 

void ONE::gui::Button::buttonPressed  )  [protected, virtual]
 

Implements ONE::gui::AbstractButton.

void ONE::gui::Button::buttonReleased bool   )  [protected, virtual]
 

Implements ONE::gui::AbstractButton.

virtual void ONE::gui::Component::clear  )  [virtual, inherited]
 

the default implementation of this function does nothing

Implements ONE::gui::Widget.

Reimplemented in ONE::gui::Panel.

void ONE::gui::Button::click  ) 
 

emulates a click on the button

This function notifies all registered ActionListener s that the button was pressed.

void ONE::gui::Label::doDraw Renderer2D ,
const int &  ,
const int &  ,
const int &  ,
const int & 
[protected, virtual, inherited]
 

performs subclass-specific drawing

Implementations of this function may assume that this object is visible and that r is in 2D mode.

Parameters:
r the renderer used to draw this object
x the left edge of the drawable area
y the top edge of the drawable are
w the width of the drawable area
h the height of the drawable are

Implements ONE::gui::Displayable.

void ONE::gui::Displayable::draw Renderer2D r,
const int &  x,
const int &  y,
const int &  w,
const int &  h
[inherited]
 

draws a portion of this object

This function calls doDraw(Renderer2D*,int,int,int,int) if this object is set to visible. Note that the renderer must be active in 2D mode.

Parameters:
r the renderer used to draw this object
x the left edge of the drawn area
y the top edge of the drawn are
w the width of the drawn area
h the height of the drawn are

void ONE::gui::Displayable::draw Renderer2D  )  [inline, inherited]
 

draws this object.

This function calls draw(Renderer2D*,int,int,int,int) with this object's bounds.

ONE::util::EventDispatcher< ActionEvent , ActionListener , struct ActionRelay >::EventDispatcher  )  [inherited]
 

void ONE::util::EventDispatcher< ActionEvent , ActionListener , struct ActionRelay >::fireEvent ActionEvent e  )  const [inherited]
 

notifies all registered listeners

The listeners are called in the order in which they were added.
This function is provided primarily for use by subclasses. However, it may also be called from the outside in order to inject events into the system. Note that great care should be taken when doing so. For example, listeners generally rely on the event's source being identical to the instance that passes them around, i.e. this event dispatcher.

Parameters:
e the event to forward to each listener

Color ONE::gui::Displayable::getBackground  )  const [inline, inherited]
 

accesses the color that should be used to render the object's background.

Returns:
a color

bool ONE::gui::Displayable::getBit const bits bit  )  const [inline, protected, inherited]
 

const BrdSP & ONE::gui::Bordered::getBorder  )  const [inline, inherited]
 

accesses the component's border

Returns:
the border or 0 if no border is set

const BrdDSP & ONE::gui::Bordered::getBorderDelegate  )  const [inline, inherited]
 

const Bounds & ONE::gui::Displayable::getBounds  )  const [inline, inherited]
 

accesses this object's bounds

The Bounds object represents the position of the top left corner as well as the size of this object's bounding rectangle.

Returns:
this object's bounds

virtual int ONE::gui::Component::getChildCount  )  const [virtual, inherited]
 

the default implementation of this function returns 0

Implements ONE::gui::Widget.

Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport.

virtual ChildConstItrSP ONE::gui::Component::getChildren  )  const [virtual, inherited]
 

the default implementation of this function returns 0

Implements ONE::gui::Widget.

Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport.

virtual ChildItrSP ONE::gui::Component::getChildren  )  [virtual, inherited]
 

the default implementation of this function returns 0

Implements ONE::gui::Widget.

Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport.

const util::Command& ONE::gui::Button::getCommand  )  const
 

retrieves the currently set action commandthe command

If no action command was set, this function returns Button::DEFAULT_COMMAND.

Bounds ONE::gui::Label::getContentBounds  )  const [inherited]
 

calculates the bounds around the label string and icon, if available

const IMSP & ONE::gui::AbstractButton::getDefaultInputMap  )  const [inline, virtual, inherited]
 

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.

Returns:
the widget's default input map

Reimplemented from ONE::gui::Widget.

const UIDSP & ONE::gui::Displayable::getDelegate  )  const [inline, inherited]
 

DelegateID ONE::gui::Button::getDelegateID  )  const [virtual]
 

Reimplemented from ONE::gui::Label.

Color ONE::gui::Widget::getDisabledBackground  )  const [inline, inherited]
 

accesses the color that should be used to render the object's background when the object is disabled

Returns:
a color

Color ONE::gui::Widget::getDisabledForeground  )  const [inline, inherited]
 

accesses the color that should be used to render the object's foreground when the object is disabled.

Returns:
a color

const IconSP & ONE::gui::Label::getDisabledIcon  )  const [inline, inherited]
 

accesses the disabled icon

Returns:
the disabled icon or the standard icon if no disabled icon is set or 0 if no icon was set or the icon was set through the IconID function and Label::updateUI was not called

Color ONE::gui::Widget::getFocus  )  const [inline, inherited]
 

accesses the color that should be used to render the component focus

Returns:
a color

const FntSP & ONE::gui::Label::getFont  )  const [inline, inherited]
 

accesses the font that should be used to render the label's text

Returns:
a font

Color ONE::gui::Displayable::getForeground  )  const [inline, inherited]
 

accesses the color that should be used to render the object's foreground.

Returns:
a color

unsigned char ONE::gui::Label::getHorizontalAlignment  )  const [inherited]
 

const IconSP & ONE::gui::Label::getIcon  )  const [inline, inherited]
 

accesses this label's standard icon

Returns:
the label's icon or 0 if no icon is set or an icon was set through the Label::setIcon(IconID&) function and Label::updateUI has not yet been called

const Point & ONE::gui::Label::getIconOffset  )  const [inline, inherited]
 

const IMSP & ONE::gui::Widget::getInputMap  )  const [inline, inherited]
 

Fringe ONE::gui::Label::getPadding  )  const [inline, inherited]
 

Widget* ONE::gui::Component::getParent  )  const [virtual, inherited]
 

Returns:
this object's parent

Implements ONE::gui::Widget.

const Point & ONE::gui::Displayable::getPosition  )  const [inline, inherited]
 

accesses this object's position

Returns:
the position of this object's top left corner

Size ONE::gui::Label::getPreferredSize  )  const [virtual, inherited]
 

determines this object's preferred size.

If this object has a non-degenerate preferred size (i.e. Size::isZero returns false), that value is returned. Otherwise, this function calculates the optimal size for this object.

Implements ONE::gui::Displayable.

const Size & ONE::gui::Displayable::getSize  )  const [inline, inherited]
 

accesses this object's size

Returns:
the size of this object's bounding rectangle

const std::string & ONE::gui::Label::getText  )  const [inline, inherited]
 

accesses the label's text

Returns:
the text displayed by this label

const Point & ONE::gui::Label::getTextOffset  )  const [inline, inherited]
 

accesses the text position offset

The offset specifies the position of the label string's top left corner relative to this component's position.

Returns:
the offset

unsigned char ONE::gui::Label::getVerticalAlignment  )  const [inherited]
 

virtual bool ONE::gui::Component::hasChildren  )  const [virtual, inherited]
 

the default implementation of this function returns false

Implements ONE::gui::Widget.

Reimplemented in ONE::gui::Console, ONE::gui::Panel, ONE::gui::ScrollBar, ONE::gui::TitleBar, and ONE::gui::Viewport.

bool ONE::gui::Component::hasFocus  )  const [virtual, inherited]
 

checks if this component has the input focus

This function queries the FocusManager.

Returns:
true if this component is focused

Implements ONE::gui::Control.

bool ONE::gui::Widget::isEnabled  )  const [inline, virtual, inherited]
 

checks if this widget is enabled

Returns:
true if is enabled, false otherwise

Implements ONE::gui::Control.

bool ONE::util::EventDispatcher< ActionEvent , ActionListener , struct ActionRelay >::isMuted  )  const [inherited]
 

reflects this dispatcher's muted state.

Returns:
true if the dispatcher is muted, false otherwise

bool ONE::gui::Displayable::isOpaque  )  const [inline, inherited]
 

checks this object's opacity

objects that are set to not opaque (i.e. transparent) should not draw their background display.

Returns:
if this object is set to opaque

bool ONE::gui::AbstractButton::isPressed  )  const [inline, inherited]
 

checks if the button is pressed

Returns:
true if the button is pressed, false otherwise

virtual bool ONE::gui::Widget::isUnder const Point  )  const [virtual, inherited]
 

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.

bool ONE::gui::Displayable::isVisible  )  const [inline, virtual, inherited]
 

acesses the visibility property

The default value is true. However, subclasses may choose to change this.

Returns:
true if the object is visible

void ONE::gui::Label::layout  )  [virtual, inherited]
 

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.
The provided implementation de-schedules layouting for this object. Overriding classes must make sure they call Displayable::layout if not the layout function of their immediate superclass.

Implements ONE::gui::Displayable.

void ONE::gui::Label::layout const Bounds b  )  [protected, inherited]
 

lays out the text using b as the usable area.

Parameters:
b the area allowed for the layout process.

void ONE::gui::AbstractButton::processKeyEvent KeyEvent  )  [virtual, inherited]
 

does nothing

Reimplemented from ONE::gui::Label.

void ONE::gui::AbstractButton::processMouseMotion MouseEvent  )  [virtual, inherited]
 

does nothing

Reimplemented from ONE::gui::Label.

void ONE::gui::AbstractButton::processMousePress MouseEvent  )  [virtual, inherited]
 

does nothing

Reimplemented from ONE::gui::Label.

void ONE::gui::AbstractButton::processMouseRelease MouseEvent  )  [virtual, inherited]
 

does nothing

Reimplemented from ONE::gui::Label.

void ONE::gui::Component::releaseFocus  )  const [virtual, inherited]
 

drops the input focus

Implements ONE::gui::Control.

void ONE::util::EventDispatcher< ActionEvent , ActionListener , struct ActionRelay >::remove const LPtr l  )  [protected, inherited]
 

de-registers a listener.

This listener will no longer notify l of events, unless l is registered more than once. If so, a call to this function will only remove the first occurence of l.

Parameters:
l a listener

virtual void ONE::gui::Component::remove Component  )  [virtual, inherited]
 

the default implementation of this function does nothing

Implements ONE::gui::Widget.

Reimplemented in ONE::gui::Panel.

void ONE::util::ActionDispatcher::removeActionListener const LPtr l  )  [inline, inherited]
 

bool ONE::gui::Component::requestFocus  )  [virtual, inherited]
 

requests the input focus for this component.

The FocusManager may deny the request, see FocusManager::requestFocus() for details.

Returns:
if the request was granted

Implements ONE::gui::Control.

void ONE::gui::Displayable::scheduleLayout  )  [inherited]
 

schedules a call to layout

This function makes component layout more efficient as several calls to this function within one frame duration result in only one call to layout.

void ONE::gui::Displayable::setBackground const Color c,
bool  laf = true
[inherited]
 

changes this object's background color

The setting is active immediately. If laf is true (the default), the setting is propagated to the GuiManager as an individual setting.

Parameters:
c the new background color
laf if the setting should be propagated to the GuiManager

void ONE::gui::Displayable::setBit const bits bit,
bool  val
[inline, protected, inherited]
 

void ONE::gui::Bordered::setBorder const BrdSP b,
bool  laf = true
[inherited]
 

changes the component's border

If laf is true, the setting is propagated to the GuiManager as an individual setting. Note that this function does not request a re-layout.

Parameters:
b the new border
laf if the setting should be propagated to the GuiManager

void ONE::gui::Displayable::setBounds const int &  x,
const int &  y,
const int &  w,
const int &  h
[inline, inherited]
 

void ONE::gui::Displayable::setBounds const Bounds b  )  [inline, inherited]
 

changes this object's bounds

See setSize and setPosition

Parameters:
b the new bounds

void ONE::gui::Button::setCommand const util::Command cmd  ) 
 

changes the click action command

This command may be used to distinguish between ActionEvent s. Each action event dispatched by this button carries the command id, which may be retrieved by calling ActionEvent::getCommand().

Parameters:
cmd the new action command id

void ONE::gui::Widget::setDisabledBackground const Color c,
bool  laf = true
[inherited]
 

changes this object's disabled background color

The setting is active immediately. If laf is true (the default), the setting is propagated to the GuiManager as an individual setting.

Parameters:
c the new background color
laf if the setting should be propagated to the GuiManager

void ONE::gui::Widget::setDisabledForeground const Color c,
bool  laf = true
[inherited]
 

changes this object's disabled foreground color

The setting is active immediately. If laf is true (the default), the setting is propagated to the GuiManager as an individual setting.

Parameters:
c the new foreground color
laf if the setting should be propagated to the GuiManager

void ONE::gui::Label::setDisabledIcon const IconID icon  )  [inherited]
 

sets this label's disabled icon

See Label::setIcon(IconID&) for functionality. This function also sets the standard icon if none is set.

void ONE::gui::Label::setDisabledIcon const IconSP icon  )  [inherited]
 

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 icon

void ONE::gui::Button::setEnabled bool   )  [virtual]
 

enables or disables this component

Disabled components no longer react to user input. If this object has children, they are modified accordingly.

Reimplemented from ONE::gui::Widget.

void ONE::gui::Widget::setFocus const Color c,
bool  laf = true
[inherited]
 

changes the color that will be used to draw the component focus marker

The setting is active immediately. If laf is true (the default), the setting is propagated to the GuiManager as an individual setting.

Parameters:
c the new focus color
laf if the setting should be propagated to the GuiManager

void ONE::gui::Label::setFont const FntSP fnt,
bool  laf = true
[inherited]
 

void ONE::gui::Displayable::setForeground const Color c,
bool  laf = true
[inherited]
 

changes this object's foreground color

The setting is active immediately. If laf is true (the default), the setting is propagated to the GuiManager as an individual setting.

Parameters:
c the new foreground color
laf if the setting should be propagated to the GuiManager

void ONE::gui::Label::setHorizontalAlignment const char &  halign,
bool  laf = true
[inherited]
 

void ONE::gui::Label::setIcon const IconID icon  )  [inherited]
 

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 Label::updateUI was called.

void ONE::gui::Label::setIcon const IconSP icon  )  [inherited]
 

changes this label's icon

Note that this icon must have the same dimension as the disabled icon.

void ONE::gui::Widget::setInputMap const IMSP im,
bool  laf = true
[inherited]
 

void ONE::util::EventDispatcher< ActionEvent , ActionListener , struct ActionRelay >::setMuted bool  mute  )  [inherited]
 

mutes or un-mutes the dispatcher

Muted dispatchers no longer notify their listeners.

void ONE::gui::Displayable::setOpaque bool  o,
bool  laf = true
[inherited]
 

changes this object's opacity

The setting is active immediately. If laf is true (the default), the setting is propagated to the GuiManager as an individual setting.

Parameters:
o the new opacity setting
laf if the setting should be propagated to the GuiManager

void ONE::gui::Component::setParent Widget p  )  [inherited]
 

changes this component's parent

If a previous parent was set, this component will be removed from it.

Parameters:
p the new parent

void ONE::gui::Displayable::setPosition const int &  x,
const int &  y
[inline, inherited]
 

void ONE::gui::Displayable::setPosition const Point p  )  [inline, inherited]
 

changes this object's position

Note that this function does not request a re-layout.

Parameters:
p the new position for the object's top left corner

void ONE::gui::Displayable::setPreferredSize const Size s  )  [inline, inherited]
 

sets the object's preferred size

If the value is set to an empty size object, the component will calculate its preferred size.

Parameters:
s the preferred size or a Size object with either a width or a height of 0

virtual void ONE::gui::AbstractButton::setPressed bool   )  [virtual, inherited]
 

Reimplemented in ONE::gui::RadioButton, and ONE::gui::ToggleButton.

void ONE::gui::Displayable::setSize const int &  w,
const int &  h
[inline, inherited]
 

void ONE::gui::Displayable::setSize const Size s  )  [inline, inherited]
 

changes this object's size

Note that this function does not request a re-layout.

Parameters:
s the new size

void ONE::gui::Label::setText const std::string &  t  )  [inherited]
 

changes the label's text

This function calls Label::layout

Parameters:
t the new text

void ONE::gui::Label::setVerticalAlignment const char &  valign,
bool  laf = true
[inherited]
 

void ONE::gui::Widget::setVisible bool  vis  )  [inline, virtual, inherited]
 

This function releases the input focus if the widget is set to invisible.

Reimplemented from ONE::gui::Displayable.

void ONE::gui::AbstractButton::updateUI  )  [virtual, inherited]
 

Reimplemented from ONE::gui::Label.

Reimplemented in ONE::gui::CheckBox, and ONE::gui::RadioButton.


Member Data Documentation

const util::Command ONE::gui::Button::DEFAULT_COMMAND [static]
 

the default command that is used when no command id is set

const bits ONE::gui::Widget::ENABLED [static, protected, inherited]
 

Point ONE::gui::Label::iconOffset [protected, inherited]
 

const bits ONE::gui::Displayable::LSCHED [static, protected, inherited]
 

set when this object is scheduled to be laid out

const bits ONE::gui::Displayable::OPQ [static, protected, inherited]
 

opacity bit

Size ONE::gui::Displayable::prefSize [protected, inherited]
 

Point ONE::gui::Label::textOffset [protected, inherited]
 

const bits ONE::gui::Displayable::VIS [static, protected, inherited]
 

visibility bit


Generated on Wed Sep 7 19:03:15 2005 for ONEngine by  doxygen 1.4.3