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

A NWN scrollbar widget. More...

#include <scrollbar.h>

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

Public Member Functions

 WidgetScrollbar (::Engines::GUI &gui, const Common::UString &tag, Scrollbar::Type type, float range)
 
 ~WidgetScrollbar ()
 
void show ()
 Show the widget. More...
 
void hide ()
 Hide the widget. More...
 
void setPosition (float x, float y, float z)
 Set the widget's position. More...
 
void setLength (float length)
 Set the length of the scrollbar, as a fraction of the range. More...
 
float getState () const
 Get the current state, as a fraction of the range. More...
 
void setState (float state)
 Set the current state, as a fraction of the range. More...
 
float getWidth () const
 Get the widget's width. More...
 
float getHeight () const
 Get the widget's height. More...
 
float getBarPosition () const
 
void mouseDown (uint8 state, float x, float y)
 A mouse button was pressed on the widget. More...
 
void mouseMove (uint8 state, float x, float y)
 The mouse was moved over the widget. More...
 
void mouseWheel (uint8 state, int x, int y)
 A mouse wheel was used on 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...
 
virtual void setTag (const Common::UString &tag)
 Set 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 setDisabled (bool disabled)
 Disable/Enable the widget. 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 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 Attributes

Scrollbar::Type _type
 
bool _full
 
float _range
 
float _length
 
float _state
 
float _dragX
 
float _dragY
 
float _dragState
 
Scrollbar _scrollbar
 

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::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 scrollbar widget.

Definition at line 95 of file scrollbar.h.

Constructor & Destructor Documentation

◆ WidgetScrollbar()

Engines::NWN::WidgetScrollbar::WidgetScrollbar ( ::Engines::GUI gui,
const Common::UString tag,
Scrollbar::Type  type,
float  range 
)

Definition at line 244 of file scrollbar.cpp.

References _scrollbar, Graphics::Renderable::setClickable(), setLength(), and Graphics::Renderable::setTag().

Here is the call graph for this function:

◆ ~WidgetScrollbar()

Engines::NWN::WidgetScrollbar::~WidgetScrollbar ( )

Definition at line 254 of file scrollbar.cpp.

Member Function Documentation

◆ getBarPosition()

float Engines::NWN::WidgetScrollbar::getBarPosition ( ) const

Definition at line 326 of file scrollbar.cpp.

References _scrollbar, _type, Engines::NWN::Scrollbar::getPosition(), Engines::NWN::Scrollbar::kTypeHorizontal, and Engines::NWN::Scrollbar::kTypeVertical.

Referenced by Engines::NWN::WidgetGridBox::mouseDown(), and Engines::NWN::WidgetListBox::mouseDown().

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

◆ getHeight()

float Engines::NWN::WidgetScrollbar::getHeight ( ) const
virtual

Get the widget's height.

Reimplemented from Engines::Widget.

Definition at line 322 of file scrollbar.cpp.

References _scrollbar, and Engines::NWN::Scrollbar::getHeight().

Here is the call graph for this function:

◆ getState()

float Engines::NWN::WidgetScrollbar::getState ( ) const

Get the current state, as a fraction of the range.

Definition at line 297 of file scrollbar.cpp.

References _state.

Referenced by Engines::NWN::WidgetListBox::remove(), Engines::NWN::WidgetGridBox::subActive(), and Engines::NWN::WidgetListBox::subActive().

Here is the caller graph for this function:

◆ getWidth()

float Engines::NWN::WidgetScrollbar::getWidth ( ) const
virtual

Get the widget's width.

Reimplemented from Engines::Widget.

Definition at line 318 of file scrollbar.cpp.

References _scrollbar, and Engines::NWN::Scrollbar::getWidth().

Referenced by Engines::NWN::WidgetListBox::createScrollbar().

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

◆ hide()

void Engines::NWN::WidgetScrollbar::hide ( )
virtual

Hide the widget.

Reimplemented from Engines::NWN::NWNWidget.

Definition at line 267 of file scrollbar.cpp.

References _scrollbar, Engines::NWN::NWNWidget::hide(), Graphics::Renderable::hide(), and Engines::Widget::isVisible().

Referenced by Engines::NWN::WidgetListBox::hide().

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

◆ mouseDown()

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

A mouse button was pressed on the widget.

Reimplemented from Engines::Widget.

Definition at line 338 of file scrollbar.cpp.

References _dragState, _dragX, _dragY, _full, Engines::Widget::_owner, _state, Engines::Widget::isDisabled(), and Engines::Widget::mouseDown().

Here is the call graph for this function:

◆ mouseMove()

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

The mouse was moved over the widget.

Reimplemented from Engines::Widget.

Definition at line 358 of file scrollbar.cpp.

References _dragState, _dragX, _dragY, _full, _length, _range, _type, Engines::Widget::isDisabled(), Engines::NWN::Scrollbar::kTypeHorizontal, Engines::NWN::Scrollbar::kTypeVertical, Engines::Widget::setActive(), and setState().

Here is the call graph for this function:

◆ mouseWheel()

void Engines::NWN::WidgetScrollbar::mouseWheel ( uint8  state,
int  x,
int  y 
)
virtual

A mouse wheel was used on the widget.

Reimplemented from Engines::Widget.

Definition at line 380 of file scrollbar.cpp.

References _full, Engines::Widget::_owner, Engines::Widget::isDisabled(), and Engines::Widget::mouseWheel().

Here is the call graph for this function:

◆ setLength()

void Engines::NWN::WidgetScrollbar::setLength ( float  length)

Set the length of the scrollbar, as a fraction of the range.

Definition at line 281 of file scrollbar.cpp.

References _full, _length, _range, _scrollbar, _state, CLIP(), MAX(), Engines::NWN::Scrollbar::setLength(), and setState().

Referenced by Engines::NWN::WidgetGridBox::updateScrollbarLength(), Engines::NWN::WidgetListBox::updateScrollbarLength(), and WidgetScrollbar().

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

◆ setPosition()

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

Set the widget's position.

Reimplemented from Engines::NWN::NWNWidget.

Definition at line 275 of file scrollbar.cpp.

References _state, Engines::NWN::NWNWidget::setPosition(), and setState().

Referenced by Engines::NWN::WidgetListBox::createScrollbar().

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

◆ setState()

void Engines::NWN::WidgetScrollbar::setState ( float  state)

Set the current state, as a fraction of the range.

Definition at line 301 of file scrollbar.cpp.

References _length, _range, _scrollbar, _state, _type, CLIP(), Engines::Widget::getPosition(), Engines::NWN::Scrollbar::kTypeHorizontal, Engines::NWN::Scrollbar::kTypeVertical, and Engines::NWN::Scrollbar::setPosition().

Referenced by mouseMove(), setLength(), setPosition(), and Engines::NWN::WidgetListBox::updateScrollbarPosition().

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

◆ show()

void Engines::NWN::WidgetScrollbar::show ( )
virtual

Show the widget.

Reimplemented from Engines::Widget.

Definition at line 257 of file scrollbar.cpp.

References _scrollbar, Engines::Widget::isInvisible(), Engines::Widget::isVisible(), Engines::Widget::show(), and Graphics::Renderable::show().

Referenced by Engines::NWN::WidgetListBox::show().

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

Member Data Documentation

◆ _dragState

float Engines::NWN::WidgetScrollbar::_dragState
private

Definition at line 134 of file scrollbar.h.

Referenced by mouseDown(), and mouseMove().

◆ _dragX

float Engines::NWN::WidgetScrollbar::_dragX
private

Definition at line 132 of file scrollbar.h.

Referenced by mouseDown(), and mouseMove().

◆ _dragY

float Engines::NWN::WidgetScrollbar::_dragY
private

Definition at line 133 of file scrollbar.h.

Referenced by mouseDown(), and mouseMove().

◆ _full

bool Engines::NWN::WidgetScrollbar::_full
private

Definition at line 126 of file scrollbar.h.

Referenced by mouseDown(), mouseMove(), mouseWheel(), and setLength().

◆ _length

float Engines::NWN::WidgetScrollbar::_length
private

Definition at line 129 of file scrollbar.h.

Referenced by mouseMove(), setLength(), and setState().

◆ _range

float Engines::NWN::WidgetScrollbar::_range
private

Definition at line 128 of file scrollbar.h.

Referenced by mouseMove(), setLength(), and setState().

◆ _scrollbar

Scrollbar Engines::NWN::WidgetScrollbar::_scrollbar
private

◆ _state

float Engines::NWN::WidgetScrollbar::_state
private

Definition at line 130 of file scrollbar.h.

Referenced by getState(), mouseDown(), setLength(), setPosition(), and setState().

◆ _type

Scrollbar::Type Engines::NWN::WidgetScrollbar::_type
private

Definition at line 124 of file scrollbar.h.

Referenced by getBarPosition(), mouseMove(), and setState().


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