TGUI  v0.5.2
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | Public Attributes | List of all members
tgui::Slider2D Struct Reference
Inheritance diagram for tgui::Slider2D:
tgui::OBJECT

Public Member Functions

 Slider2D ()
 Default constructor. More...
 
 Slider2D (const Slider2D &copy)
 Copy constructor. More...
 
virtual ~Slider2D ()
 Destructor. More...
 
Slider2Doperator= (const Slider2D &right)
 Overload of assignment operator. More...
 
virtual bool load (const std::string pathname)
 Loads the slider images. More...
 
virtual void setSize (float width, float height)
 Changes the size of the slider. More...
 
virtual Vector2u getSize () const
 Returns the size of the slider, unaffected by scaling. More...
 
virtual Vector2f getScaledSize () const
 Returns the size of the slider, after the scaling transformation. More...
 
virtual std::string getLoadedPathname () const
 Returns the pathname that was used to load the slider. More...
 
virtual void setMinimum (const Vector2f minimum)
 Sets a minimum value. More...
 
virtual void setMaximum (const Vector2f maximum)
 Sets a maximum value. More...
 
virtual void setValue (const Vector2f value)
 Changes the current value. More...
 
virtual Vector2f getMinimum () const
 Returns the minimum value. More...
 
virtual Vector2f getMaximum () const
 Returns the maximum value. More...
 
virtual Vector2f getValue () const
 Returns the current value. More...
 
virtual void centerThumb ()
 Places the thumb back in the center. More...
 
- Public Member Functions inherited from tgui::OBJECT
 OBJECT ()
 Default constructor. More...
 
 OBJECT (const OBJECT &copy)
 Copy constructor. More...
 
virtual ~OBJECT ()
 Destructor. More...
 
OBJECToperator= (const OBJECT &right)
 Overload of assignment operator. More...
 
virtual void show ()
 Shows the object. More...
 
virtual void hide ()
 Hides the object. More...
 
virtual bool isVisible () const
 Returns true when the object is visible. More...
 
virtual void enable ()
 Enables the object. More...
 
virtual void disable ()
 Disables the object. More...
 
virtual bool isEnabled () const
 Returns true when the object is enabled. More...
 
virtual bool isDisabled () const
 Returns true when the object is disabled. More...
 
virtual bool isLoaded () const
 Returns true when the object is loaded successfully. More...
 
void focus ()
 Focus the object. More...
 
void unfocus ()
 Unfocus the object. More...
 
void focusNextObject ()
 Focuses the next object. More...
 
virtual bool isFocused () const
 Returns true when the object is focused and false otherwise. More...
 
virtual ObjectTypes getObjectType () const
 Returns the type of the object. More...
 
virtual void moveToFront ()
 Places the object before all other objects. More...
 
virtual void moveToBack ()
 Places the object behind all other objects. More...
 

Public Attributes

bool returnToCenter
 
bool fixedThumbSize
 

Constructor & Destructor Documentation

tgui::Slider2D::Slider2D ( )

Default constructor.

tgui::Slider2D::Slider2D ( const Slider2D copy)

Copy constructor.

virtual tgui::Slider2D::~Slider2D ( )
virtual

Destructor.

Member Function Documentation

virtual void tgui::Slider2D::centerThumb ( )
virtual

Places the thumb back in the center.

When returnToCenter is true then this will happen automatically when the mouse is released.

virtual std::string tgui::Slider2D::getLoadedPathname ( ) const
virtual

Returns the pathname that was used to load the slider.

When the slider has not been loaded yet then this function will return an empty string.

virtual Vector2f tgui::Slider2D::getMaximum ( ) const
virtual

Returns the maximum value.

The default maximum value 1.

virtual Vector2f tgui::Slider2D::getMinimum ( ) const
virtual

Returns the minimum value.

The default minimum value -1.

virtual Vector2f tgui::Slider2D::getScaledSize ( ) const
virtual

Returns the size of the slider, after the scaling transformation.

Implements tgui::OBJECT.

virtual Vector2u tgui::Slider2D::getSize ( ) const
virtual

Returns the size of the slider, unaffected by scaling.

Implements tgui::OBJECT.

virtual Vector2f tgui::Slider2D::getValue ( ) const
virtual

Returns the current value.

virtual bool tgui::Slider2D::load ( const std::string  pathname)
virtual

Loads the slider images.

The verticalScroll member might be changed in this function. If you want to change it then do it afterwards.

Parameters
pathnameThe path to the folder that contains the images. The folder must also contain an info.txt file, which will give more information about the slider.
Returns
  • true on success
  • false when the pathname is empty
  • false when the info.txt file was not found
  • false when the images couldn't be loaded
Slider2D& tgui::Slider2D::operator= ( const Slider2D right)

Overload of assignment operator.

virtual void tgui::Slider2D::setMaximum ( const Vector2f  maximum)
virtual

Sets a maximum value.

When the value is too big then it will be changed to this maximum. The default maximum value is (1,1).

virtual void tgui::Slider2D::setMinimum ( const Vector2f  minimum)
virtual

Sets a minimum value.

When the value is too small then it will be changed to this minimum. The default minimum value is (-1, -1).

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

Changes the size of the slider.

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

Implements tgui::OBJECT.

virtual void tgui::Slider2D::setValue ( const Vector2f  value)
virtual

Changes the current value.

It can't be smaller than the minimum or bigger than the maximum.

Member Data Documentation

bool tgui::Slider2D::fixedThumbSize

Should the thumb be scaled together with the slider or not? This bool is true by default, which means that the thumb always has the exact size as the loaded image.

bool tgui::Slider2D::returnToCenter

Should we return thumb to center after mouse up? This bool is true by default.


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