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

Classes

struct  Layout
 The layout of the object. More...
 

Public Member Functions

 Grid ()
 Default constructor. More...
 
 Grid (const Grid &copy)
 Copy constructor. More...
 
virtual ~Grid ()
 Destructor. More...
 
Gridoperator= (const Grid &right)
 Overload of assignment operator. More...
 
virtual void setSize (float width, float height)
 Changes the size of the grid. More...
 
virtual Vector2u getSize () const
 Returns the size of the grid, unaffected by scaling. More...
 
virtual Vector2f getScaledSize () const
 Returns the size of the grid, after the scaling transformation. 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 addToRow (OBJECT *const object, const Vector4u &borders=Vector4u(0, 0, 0, 0), Layout::layouts layout=Layout::Center)
 Add a new object to the next column. More...
 
virtual void addRow (unsigned int rowHeight=0)
 Adds a new row to the grid. More...
 
virtual void updateObjects ()
 Updates the position and size of the object. More...
 
virtual void changeObjectLayout (const OBJECT *const object, Layout::layouts layout=Layout::Center)
 Changes the layout of a given object. 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 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...
 

Additional Inherited Members

- 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...
 

Constructor & Destructor Documentation

tgui::Grid::Grid ( )

Default constructor.

tgui::Grid::Grid ( const Grid copy)

Copy constructor.

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

Destructor.

Member Function Documentation

virtual void tgui::Grid::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 void tgui::Grid::addRow ( unsigned int  rowHeight = 0)
virtual

Adds a new row to the grid.

Parameters
rowHeightThe height of the row when it stays empty, or the minimum height when objects are added to the row.
virtual void tgui::Grid::addToRow ( OBJECT *const  object,
const Vector4u borders = Vector4u(0, 0, 0, 0),
Layout::layouts  layout = Layout::Center 
)
virtual

Add a new object to the next column.

Parameters
objectPointer to a fully created object that will be added to the grid.
bordersDistance from the grid square to the object (left, top, right, bottom).
layoutWhere the object is located in the square.
virtual void tgui::Grid::changeObjectLayout ( const OBJECT *const  object,
Layout::layouts  layout = Layout::Center 
)
virtual

Changes the layout of a given object.

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

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

Returns
Size of the grid

Implements tgui::OBJECT.

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

Returns the size of the grid, unaffected by scaling.

Returns
Size of the grid

Implements tgui::OBJECT.

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

Overload of assignment operator.

Parameters
rightInstance to assign
Returns
Reference to itself
virtual void tgui::Grid::remove ( OBJECT object)
virtual

Removes a single object that was added to the group.

Parameters
objectPointer to an object that was added to the group with the add function.
See Also
remove(sf::String)

Reimplemented from tgui::Group.

virtual void tgui::Grid::removeAllObjects ( )
virtual

Removes all objects that were added to the group.

Reimplemented from tgui::Group.

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

Changes the size of the grid.

By default, the grid will have the size of the objects that were added to it. When changing this size, all objects will be scaled to fit inside the grid with this fixed size.

This function will change the scale factors.

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

Implements tgui::OBJECT.

virtual void tgui::Grid::updateObjects ( )
virtual

Updates the position and size of the object.

After an object has been added to the grid, you will have to call this function when you change the size of the object.


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