TGUI  v0.6.10
Public Types | Public Member Functions | List of all members
tgui::Scrollbar Class Reference
Inheritance diagram for tgui::Scrollbar:
tgui::Widget tgui::Transformable tgui::CallbackManager

Public Types

- Public Types inherited from tgui::Widget

Public Member Functions

 Scrollbar ()
 Default constructor. More...
 
 Scrollbar (const Scrollbar &copy)
 Copy constructor. More...
 
virtual ~Scrollbar ()
 Destructor. More...
 
Scrollbaroperator= (const Scrollbar &right)
 Overload of assignment operator. More...
 
bool load (const std::string &configFileFilename, const std::string &sectionName="Scrollbar")
 Loads the widget. More...
 
const std::string & getLoadedConfigFile () const
 Returns the filename of the config file that was used to load the widget. More...
 
void setSize (float width, float height)
 Changes the size of the scrollbar. More...
 
virtual sf::Vector2f getSize () const
 Returns the size of the scrollbar. More...
 
void setMaximum (unsigned int maximum)
 Sets a maximum value. More...
 
void setValue (unsigned int value)
 Changes the current value. More...
 
void setLowValue (unsigned int lowValue)
 Changes the 'low value'. More...
 
void setVerticalScroll (bool verticallScroll)
 Changes whether the scrollbar lies vertical or horizontal. More...
 
unsigned int getMaximum () const
 Returns the maximum value. More...
 
unsigned int getValue () const
 Returns the current value. More...
 
unsigned int getLowValue () const
 Returns the low value. More...
 
bool getVerticalScroll () const
 Returns whether the scrollbar lies vertical or horizontal. More...
 
void setArrowScrollAmount (unsigned int scrollAmount)
 Changes how much the value changes when pressing one of the arrows of the scrollbar. More...
 
unsigned int getArrowScrollAmount ()
 Returns how much the value changes when pressing one of the arrows of the scrollbar. More...
 
void setAutoHide (bool autoHide)
 Changes whether the scrollbar should hide automatically or not. More...
 
bool getAutoHide () const
 Returns whether the scrollbar is hiding automatically or not. More...
 
virtual void setTransparency (unsigned char transparency)
 Changes the transparency of the widget. More...
 
- Public Member Functions inherited from tgui::Widget
 Widget ()
 Default constructor. More...
 
 Widget (const Widget &copy)
 Copy constructor. More...
 
virtual ~Widget ()
 Destructor. More...
 
Widgetoperator= (const Widget &right)
 Overload of assignment operator. More...
 
virtual sf::Vector2f getAbsolutePosition () const
 Get the absolute position of the widget on the screen. More...
 
virtual void show ()
 Shows the widget. More...
 
virtual void hide ()
 Hides the widget. More...
 
bool isVisible () const
 Returns true when the widget is visible. More...
 
virtual void enable ()
 Enables the widget. More...
 
virtual void disable ()
 Disables the widget. More...
 
bool isEnabled () const
 Returns true when the widget is enabled. More...
 
bool isDisabled () const
 Returns true when the widget is disabled. More...
 
bool isLoaded () const
 Returns true when the widget is loaded successfully. More...
 
virtual void focus ()
 Focus the widget. More...
 
virtual void unfocus ()
 Unfocus the widget. More...
 
bool isFocused () const
 Returns true when the widget is focused and false otherwise. More...
 
WidgetTypes getWidgetType () const
 Returns the type of the widget. More...
 
ContainergetParent () const
 Returns a pointer to the parent widget. More...
 
unsigned char getTransparency () const
 Returns the transparency of the widget. More...
 
virtual void moveToFront ()
 Places the widget before all other widgets. More...
 
virtual void moveToBack ()
 Places the widget behind all other widgets. More...
 
void setCallbackId (unsigned int callbackId)
 Changes the callback id of the widget. More...
 
unsigned int getCallbackId ()
 Returns the callback id of the widget. More...
 
- Public Member Functions inherited from tgui::Transformable
 Transformable ()
 Default constructor. More...
 
virtual ~Transformable ()
 Destructor. More...
 
virtual void setPosition (float x, float y)
 Set the position of the widget. More...
 
void setPosition (const sf::Vector2f &position)
 set the position of the widget More...
 
const sf::Vector2f & getPosition () const
 get the position of the widget More...
 
void move (float offsetX, float offsetY)
 Move the widget by a given offset. More...
 
void move (const sf::Vector2f &offset)
 Move the widget by a given offset. More...
 
virtual sf::Vector2f getFullSize () const
 Returns the entire size that the widget is using. More...
 
void scale (float factorX, float factorY)
 Scale the widget. More...
 
void scale (const sf::Vector2f &factors)
 Scale the widget. More...
 
- Public Member Functions inherited from tgui::CallbackManager
void bindCallback (std::function< void()> func, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
template<typename T >
void bindCallback (void(T::*func)(), T *const classPtr, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
void bindCallbackEx (std::function< void(const Callback &)> func, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
template<typename T >
void bindCallbackEx (void(T::*func)(const Callback &), T *const classPtr, unsigned int trigger)
 Bind a function to one or more specific callback trigger(s). More...
 
void bindCallback (unsigned int trigger)
 Bind one or more specific callback trigger(s) to the parent widget. More...
 
void unbindCallback (unsigned int trigger)
 Unbind all callback function bound to the given trigger. More...
 
void unbindAllCallback ()
 Unbind all callback functions bound to any callback. More...
 

Member Enumeration Documentation

Defines specific triggers to Scrollbar.

Enumerator
ValueChanged 

Value changed (thumb moved)

AllScrollbarCallbacks 

All triggers defined in Scrollbar and its base classes.

Constructor & Destructor Documentation

tgui::Scrollbar::Scrollbar ( )

Default constructor.

tgui::Scrollbar::Scrollbar ( const Scrollbar copy)

Copy constructor.

Parameters
copyInstance to copy
virtual tgui::Scrollbar::~Scrollbar ( )
virtual

Destructor.

Member Function Documentation

unsigned int tgui::Scrollbar::getArrowScrollAmount ( )

Returns how much the value changes when pressing one of the arrows of the scrollbar.

Returns
How far should the scrollbar scroll when an arrow is clicked?
bool tgui::Scrollbar::getAutoHide ( ) const

Returns whether the scrollbar is hiding automatically or not.

When true (default), the scrollbar will not be drawn when the maximum is smaller than the low value. So when you can't scroll, the scrollbar won't be drawn.

const std::string& tgui::Scrollbar::getLoadedConfigFile ( ) const

Returns the filename of the config file that was used to load the widget.

Returns
Filename of loaded config file. Empty string when no config file was loaded yet.
unsigned int tgui::Scrollbar::getLowValue ( ) const

Returns the low value.

See also
setLowValue
unsigned int tgui::Scrollbar::getMaximum ( ) const

Returns the maximum value.

Returns
The current maximum value

The default maximum value is 10.

virtual sf::Vector2f tgui::Scrollbar::getSize ( ) const
virtual

Returns the size of the scrollbar.

Returns
Size of the scrollbar

Implements tgui::Transformable.

unsigned int tgui::Scrollbar::getValue ( ) const

Returns the current value.

Returns
The current value

The default value is 0.

bool tgui::Scrollbar::getVerticalScroll ( ) const

Returns whether the scrollbar lies vertical or horizontal.

Returns
Does the scrollbar lie vertically?
bool tgui::Scrollbar::load ( const std::string &  configFileFilename,
const std::string &  sectionName = "Scrollbar" 
)

Loads the widget.

Parameters
configFileFilenameFilename of the config file.
sectionNameName of the section in the file to load

The config file must contain a Scrollbar section with the needed information.

Scrollbar& tgui::Scrollbar::operator= ( const Scrollbar right)

Overload of assignment operator.

Parameters
rightInstance to assign
Returns
Reference to itself
void tgui::Scrollbar::setArrowScrollAmount ( unsigned int  scrollAmount)

Changes how much the value changes when pressing one of the arrows of the scrollbar.

Parameters
scrollAmountHow far should the scrollbar scroll when an arrow is clicked?
void tgui::Scrollbar::setAutoHide ( bool  autoHide)

Changes whether the scrollbar should hide automatically or not.

When true (default), the scrollbar will not be drawn when the maximum is smaller than the low value.

Parameters
autoHideShould the scrollbar be invisible when you can't scroll?
void tgui::Scrollbar::setLowValue ( unsigned int  lowValue)

Changes the 'low value'.

Parameters
lowValueThe new low value. In e.g. a list box, this value is the amount of items that fit inside the list box.

Until the maximum is bigger than this value, no scrollbar will be drawn. You can however choose to always draw the scrollbar by calling setAutoHide(false). The default low value is 6.

void tgui::Scrollbar::setMaximum ( unsigned int  maximum)

Sets a maximum value.

Parameters
maximumThe new maximum value

When the value is bigger than (maximum - low value), the value is set to maximum - low value. The default maximum value is 10.

void tgui::Scrollbar::setSize ( float  width,
float  height 
)
virtual

Changes the size of the scrollbar.

Parameters
widthThe new width of the scrollbar
heightThe new height of the scrollbar

Implements tgui::Transformable.

virtual void tgui::Scrollbar::setTransparency ( unsigned char  transparency)
virtual

Changes the transparency of the widget.

Parameters
transparencyThe transparency of the widget. 0 is completely transparent, while 255 (default) means fully opaque.

Note that this will only change the transparency of the images. The parts of the widgets that use a color will not be changed. You must change them yourself by setting the alpha channel of the color.

Reimplemented from tgui::Widget.

void tgui::Scrollbar::setValue ( unsigned int  value)

Changes the current value.

Parameters
valueThe new value

The value has to be smaller than maximum - low value.

void tgui::Scrollbar::setVerticalScroll ( bool  verticallScroll)

Changes whether the scrollbar lies vertical or horizontal.

Parameters
verticallScrollDoes the scrollbar lie vertically?

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