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

A static group of objects. The background color can be solid or transparent. More...

#include <Panel.hpp>

Inheritance diagram for tgui::Panel:
tgui::GroupObject tgui::OBJECT tgui::Group tgui::ChildWindow

Public Member Functions

 Panel ()
 Default constructor. More...
 
 Panel (const Panel &copy)
 Copy constructor. More...
 
virtual ~Panel ()
 Destructor. More...
 
Paneloperator= (const Panel &right)
 Overload of assignment operator. More...
 
virtual bool load (float width, float height, const sf::Color &backgroundColor=sf::Color::Transparent, const std::string &backgroundImageFilename="")
 Creates the panel. More...
 
virtual void setSize (float width, float height)
 Changes the size of the panel. More...
 
virtual Vector2u getSize () const
 Returns the size of the panel, unaffected by scaling. More...
 
virtual Vector2f getScaledSize () const
 Returns the size of the panel, after the scaling transformation. More...
 
virtual bool setBackgroundImage (const std::string &filename="")
 Changes the background image of the panel. More...
 
virtual std::string getLoadedBackgroundImageFilename () const
 Returns the filename that was used to load the current background image. More...
 
virtual void addCallback (const Callback &callback)
 Adds a callback to the list in tgui::Window. More...
 
- Public Member Functions inherited from tgui::GroupObject
 GroupObject ()
 Default constructor. More...
 
 GroupObject (const GroupObject &copy)
 Copy constructor. More...
 
virtual ~GroupObject ()
 Destructor. More...
 
GroupObjectoperator= (const GroupObject &right)
 Overload of assignment operator. 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 Member Functions inherited from tgui::Group
 Group ()
 Default constructor. More...
 
 Group (const Group &copy)
 Copy constructor. More...
 
virtual ~Group ()
 Destructor. More...
 
Groupoperator= (const Group &right)
 Overload of assignment operator. More...
 
template<typename T >
T * add (const sf::String &objectName="")
 Creates and adds an object to the group. More...
 
template<typename T >
T * get (const sf::String &objectName) const
 Returns a pointer to an earlier created object. More...
 
template<typename T >
T * copy (T *oldObject, const sf::String &newObjectName="")
 Makes a copy of any existing object and returns the pointer to the new object. More...
 
template<typename T >
T * copy (const sf::String &oldObjectName, const sf::String &newObjectName="")
 Makes a copy of any existing object and returns the pointer to the new object. More...
 
virtual bool loadObjectsFromFile (const std::string &filename)
 Loads a form from a file. More...
 
virtual std::vector< OBJECT * > & getObjects ()
 Returns a list of all the objects. More...
 
virtual std::vector< sf::String > & getObjectNames ()
 Returns a list of the names of all the objects. More...
 
virtual void remove (const sf::String &objectName)
 Removes a single object that was added to the group. More...
 
virtual void remove (OBJECT *object)
 Removes a single object that was added to the group. More...
 
virtual void removeAllObjects ()
 Removes all objects that were added to the group. More...
 
virtual void focusObject (OBJECT *const object)
 Focuses an object. More...
 
virtual void unfocusObject (OBJECT *const object)
 Unfocuses an object. More...
 
virtual void unfocusAllObjects ()
 Unfocuses all the objects. More...
 
virtual void uncheckRadioButtons ()
 Uncheck all the radio buttons. More...
 
virtual void updateTime (const sf::Time &elapsedTime)
 Update the internal clock to make animation possible. More...
 
virtual void moveObjectToFront (OBJECT *object)
 Places an object before all other objects. More...
 
virtual void moveObjectToBack (OBJECT *object)
 Places an object behind all other objects. More...
 

Public Attributes

sf::Color backgroundColor
 The background color of the Panel. The default is a transparent background (sf::Color::Transparent). More...
 
- Public Attributes inherited from tgui::Group
sf::Font globalFont
 The internal font, used by all objects by default. If not changed then this is the default SFML font. More...
 

Detailed Description

A static group of objects. The background color can be solid or transparent.

Constructor & Destructor Documentation

tgui::Panel::Panel ( )

Default constructor.

tgui::Panel::Panel ( const Panel copy)

Copy constructor.

virtual tgui::Panel::~Panel ( )
virtual

Destructor.

Member Function Documentation

virtual void tgui::Panel::addCallback ( const Callback callback)
virtual

Adds a callback to the list in tgui::Window.

This callback can be obtained by calling the getCallback function of the window.

Implements tgui::Group.

virtual std::string tgui::Panel::getLoadedBackgroundImageFilename ( ) const
virtual

Returns the filename that was used to load the current background image.

If no background image was loaded then this function will return an empty string.

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

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

Implements tgui::OBJECT.

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

Returns the size of the panel, unaffected by scaling.

Implements tgui::OBJECT.

virtual bool tgui::Panel::load ( float  width,
float  height,
const sf::Color &  backgroundColor = sf::Color::Transparent,
const std::string &  backgroundImageFilename = "" 
)
virtual

Creates the panel.

Parameters
widthSets the width of the panel.
heightSets the height of the panel.
backgroundColorSets the background color of the panel (fully transparent by default).
backgroundImageFilenameThe filename to an image that will be used as background image (empty string by default)
Returns
  • true on success
  • false when background image couldn't be loaded (only if backgroundImageFilename isn't empty)

Reimplemented in tgui::ChildWindow.

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

Overload of assignment operator.

virtual bool tgui::Panel::setBackgroundImage ( const std::string &  filename = "")
virtual

Changes the background image of the panel.

This image will be scaled to fill the whole panel. Passing an empty string to this function will remove the current background image.

Reimplemented in tgui::ChildWindow.

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

Changes the size of the panel.

Parameters
widthSets the new width of the panel.
heightSets the new height of the panel.

Implements tgui::OBJECT.

Member Data Documentation

sf::Color tgui::Panel::backgroundColor

The background color of the Panel. The default is a transparent background (sf::Color::Transparent).


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