xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::NWN::WidgetSlider Class Reference

A NWN slider widget. More...

#include <slider.h>

Inheritance diagram for Engines::NWN::WidgetSlider:
Inheritance graph
[legend]
Collaboration diagram for Engines::NWN::WidgetSlider:
Collaboration graph
[legend]

Public Member Functions

 WidgetSlider (::Engines::GUI &gui, const Common::UString &tag, const Common::UString &model)
 
 ~WidgetSlider ()
 
void setPosition (float x, float y, float z)
 Set the widget's position. More...
 
void setSteps (int steps)
 
int getState () const
 
void setState (int state)
 
void mouseMove (uint8 state, float x, float y)
 The mouse was moved over the widget. More...
 
void mouseDown (uint8 state, float x, float y)
 A mouse button was pressed on the widget. More...
 
- Public Member Functions inherited from Engines::NWN::ModelWidget
 ModelWidget (::Engines::GUI &gui, const Common::UString &tag, const Common::UString &model)
 
 ~ModelWidget ()
 
void show ()
 Show the widget. More...
 
void hide ()
 Hide the widget. More...
 
float getWidth () const
 Get the widget's width. More...
 
float getHeight () const
 Get the widget's height. More...
 
void setTag (const Common::UString &tag)
 Set the widget's tag. More...
 
Graphics::Aurora::ModelNodegetNode (const Common::UString &nodeName) const
 
- Public Member Functions inherited from Engines::NWN::NWNWidgetWithCaption
 NWNWidgetWithCaption (::Engines::GUI &gui, const Common::UString &tag)
 
 ~NWNWidgetWithCaption ()
 
void show ()
 Show the widget. More...
 
void hide ()
 Hide the widget. More...
 
virtual void initCaption (const Common::UString &font, const Common::UString &text, float r=1.0f, float g=1.0f, float b=1.0f, float a=1.0f, float halign=Graphics::Aurora::kHAlignLeft, float valign=Graphics::Aurora::kVAlignTop)
 
void setColor (float r, float g, float b, float a)
 
void setText (const Common::UString &text)
 
const Common::UString getText () const
 
float getWidth () const
 Get the widget's width. More...
 
float getHeight () const
 Get the widget's height. More...
 
float getHorizontalAlign () const
 
float getVerticalAlign () const
 
void setDisabled (bool disabled)
 Disable/Enable the widget. More...
 
- Public Member Functions inherited from Engines::NWN::NWNWidget
 NWNWidget (::Engines::GUI &gui, const Common::UString &tag)
 
 ~NWNWidget ()
 
void enter ()
 The mouse entered the widget. More...
 
void leave ()
 The mouse left the widget. More...
 
void setTooltip (const Common::UString &text)
 
void setTooltipPosition (float x, float y, float z)
 
- Public Member Functions inherited from Engines::Widget
 Widget (GUI &gui, const Common::UString &tag)
 
virtual ~Widget ()
 
const Common::UStringgetTag () const
 Get the widget's tag. More...
 
bool isActive () const
 Was the widget activated? More...
 
bool isVisible () const
 Is the widget visible? More...
 
bool isDisabled () const
 Is the widget disabled? More...
 
bool isInvisible () const
 Is the widget invisible (never visible)? More...
 
WidgetgetParent ()
 
const WidgetgetParent () const
 
WidgetgetChild (const Common::UString &childTag)
 Get the widget's child by tag. More...
 
virtual void movePosition (float x, float y, float z)
 Move the widget, relative to its current position. More...
 
virtual void getPosition (float &x, float &y, float &z) const
 Get the widget's position. More...
 
virtual void setInvisible (bool invisible)
 Make the widget invisible. More...
 
virtual void mouseUp (uint8 state, float x, float y)
 A mouse button was released on the widget. More...
 
virtual void mouseWheel (uint8 state, int x, int y)
 A mouse wheel was used on the widget. More...
 
virtual void mouseDblClick (uint8 state, float x, float y)
 A mouse button was double-clicked on the widget. More...
 
virtual void subActive (Widget &widget)
 A sub-widget was activated. More...
 
void remove ()
 Remove the widget from the GUI. More...
 
virtual void addSub (Widget &widget)
 Add a sub-widget to the widget. More...
 
virtual void addChild (Widget &widget)
 Add a child to the widget. More...
 
virtual void addGroupMember (Widget &widget)
 Add a fellow group member to the widget. More...
 
virtual void removeSub (Widget &widget)
 Remove a sub-widget from the widget. More...
 
virtual void removeChild (Widget &widget)
 Remove a child from the widget. More...
 
virtual void removeGroupMember (Widget &widget)
 Remove fellow group member from the widget. More...
 

Private Member Functions

void changedValue (float x, float y)
 
void changePosition (float value)
 

Private Attributes

float _width
 
float _position
 
int _steps
 
int _state
 
Graphics::Aurora::ModelNode_thumb
 

Additional Inherited Members

- Protected Member Functions inherited from Engines::Widget
virtual void signalGroupMemberActive ()
 A fellow group member signaled that it is now active. More...
 
void setActive (bool active)
 The widget's active state. More...
 
void raiseCallbackActive (Widget &widget)
 
- Protected Attributes inherited from Engines::NWN::ModelWidget
Graphics::Aurora::Model_model
 
- Protected Attributes inherited from Engines::NWN::NWNWidgetWithCaption
Common::ScopedPtr< Graphics::Aurora::Text_caption
 
float _r
 
float _g
 
float _b
 
float _a
 
- Protected Attributes inherited from Engines::Widget
GUI_gui
 The GUI the widget belongs to. More...
 
Common::UString _tag
 The widget's tag. More...
 
Widget_parent
 The widget's parent, if any. More...
 
Widget_owner
 The widget's owner, if any. More...
 
std::list< Widget * > _subWidgets
 The widget's sub-widgets. More...
 
std::list< Widget * > _children
 The widget's children. More...
 
std::list< Widget * > _groupMembers
 The widget's fellow group members. More...
 

Detailed Description

A NWN slider widget.

Definition at line 41 of file slider.h.

Constructor & Destructor Documentation

◆ WidgetSlider()

Engines::NWN::WidgetSlider::WidgetSlider ( ::Engines::GUI gui,
const Common::UString tag,
const Common::UString model 
)

◆ ~WidgetSlider()

Engines::NWN::WidgetSlider::~WidgetSlider ( )

Definition at line 54 of file slider.cpp.

Member Function Documentation

◆ changedValue()

void Engines::NWN::WidgetSlider::changedValue ( float  x,
float  y 
)
private

Definition at line 96 of file slider.cpp.

References _state, _steps, _width, changePosition(), CLIP(), Engines::Widget::getPosition(), and Engines::Widget::setActive().

Referenced by mouseDown(), and mouseMove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ changePosition()

void Engines::NWN::WidgetSlider::changePosition ( float  value)
private

Definition at line 119 of file slider.cpp.

References _position, _thumb, _width, Graphics::Aurora::ModelNode::getWidth(), and Graphics::Aurora::ModelNode::move().

Referenced by changedValue(), setState(), and WidgetSlider().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getState()

int Engines::NWN::WidgetSlider::getState ( ) const

Definition at line 65 of file slider.cpp.

References _state.

Referenced by Engines::NWN::OptionsFeedbackMenu::adoptChanges(), and Engines::NWN::OptionsFeedbackMenu::updateTooltipDelay().

Here is the caller graph for this function:

◆ mouseDown()

void Engines::NWN::WidgetSlider::mouseDown ( uint8  state,
float  x,
float  y 
)
virtual

A mouse button was pressed on the widget.

Reimplemented from Engines::Widget.

Definition at line 86 of file slider.cpp.

References changedValue(), and Engines::Widget::isDisabled().

Here is the call graph for this function:

◆ mouseMove()

void Engines::NWN::WidgetSlider::mouseMove ( uint8  state,
float  x,
float  y 
)
virtual

The mouse was moved over the widget.

Reimplemented from Engines::Widget.

Definition at line 75 of file slider.cpp.

References changedValue(), and Engines::Widget::isDisabled().

Here is the call graph for this function:

◆ setPosition()

void Engines::NWN::WidgetSlider::setPosition ( float  x,
float  y,
float  z 
)
virtual

Set the widget's position.

Reimplemented from Engines::NWN::ModelWidget.

Definition at line 57 of file slider.cpp.

References Engines::NWN::ModelWidget::setPosition().

Here is the call graph for this function:

◆ setState()

void Engines::NWN::WidgetSlider::setState ( int  state)

◆ setSteps()

void Engines::NWN::WidgetSlider::setSteps ( int  steps)

Definition at line 61 of file slider.cpp.

References _steps.

Member Data Documentation

◆ _position

float Engines::NWN::WidgetSlider::_position
private

Definition at line 60 of file slider.h.

Referenced by changePosition().

◆ _state

int Engines::NWN::WidgetSlider::_state
private

Definition at line 63 of file slider.h.

Referenced by changedValue(), getState(), and setState().

◆ _steps

int Engines::NWN::WidgetSlider::_steps
private

Definition at line 62 of file slider.h.

Referenced by changedValue(), setState(), and setSteps().

◆ _thumb

Graphics::Aurora::ModelNode* Engines::NWN::WidgetSlider::_thumb
private

Definition at line 65 of file slider.h.

Referenced by changePosition(), and WidgetSlider().

◆ _width

float Engines::NWN::WidgetSlider::_width
private

Definition at line 58 of file slider.h.

Referenced by changedValue(), changePosition(), and WidgetSlider().


The documentation for this class was generated from the following files: