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

Movable Panel with title bar. More...

#include <ChildWindow.hpp>

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

Public Member Functions

 ChildWindow ()
 Default constructor. More...
 
 ChildWindow (const ChildWindow &copy)
 Copy constructor. More...
 
virtual ~ChildWindow ()
 Destructor. More...
 
ChildWindowoperator= (const ChildWindow &right)
 Overload of assignment operator. More...
 
virtual bool load (float width, float height, const sf::Color &backgroundColor, const std::string &pathname)
 Creates the child window. More...
 
virtual std::string getLoadedPathname () const
 Returns the pathname that was used to load the child window. More...
 
virtual bool setBackgroundImage (const std::string &filename="")
 Changes the background image of the child window. More...
 
virtual void setTitlebarHeight (unsigned int height)
 Change the height of the title bar. More...
 
virtual unsigned int getTitleBarHeight () const
 Returns the height of the title bar. More...
 
virtual void setTransparency (unsigned char transparency)
 Changes the transparency of the window. More...
 
virtual unsigned char getTransparency () const
 Returns the transparency of the window. More...
 
virtual void setBorders (unsigned int leftBorder=0, unsigned int topBorder=0, unsigned int rightBorder=0, unsigned int bottomBorder=0)
 Changes the size of the borders. More...
 
- Public Member Functions inherited from tgui::Panel
 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 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 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 Member Functions inherited from tgui::OBJECT_BORDERS
 OBJECT_BORDERS ()
 Default constructor. More...
 
virtual Vector4u getBorders () const
 Returns the size of the borders as a tgui::Vector4u. More...
 

Public Attributes

Layout layout
 Should the close button be on the right side or on the left side of the title bar? More...
 
TitleAlignment titleAlignment
 Should the text be on the left or the right or should it be centered? More...
 
unsigned int distanceToSide
 The distance between the side of the title bar and the close button. More...
 
sf::Color borderColor
 The color that is used to draw the borders of the window. More...
 
sf::String title
 The title of the window. More...
 
- Public Attributes inherited from tgui::Panel
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

Movable Panel with title bar.

Constructor & Destructor Documentation

tgui::ChildWindow::ChildWindow ( )

Default constructor.

tgui::ChildWindow::ChildWindow ( const ChildWindow copy)

Copy constructor.

virtual tgui::ChildWindow::~ChildWindow ( )
virtual

Destructor.

Member Function Documentation

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

Returns the pathname that was used to load the child window.

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

virtual unsigned int tgui::ChildWindow::getTitleBarHeight ( ) const
virtual

Returns the height of the title bar.

virtual unsigned char tgui::ChildWindow::getTransparency ( ) const
virtual

Returns the transparency of the window.

virtual bool tgui::ChildWindow::load ( float  width,
float  height,
const sf::Color &  backgroundColor,
const std::string &  pathname 
)
virtual

Creates the child window.

Parameters
widthSets the width of the child window.
heightSets the height of the child window.
backgroundColorSets the background color of the child window.
pathnameThe path to the folder that contains the images for the titlebar and an optional background image. The folder must also contain an info.txt file, which will give more information about the child window.
Returns
  • true on success
  • false when the pathname was empty
  • false when the info.txt file was not found
  • false when the images couldn't be loaded

Reimplemented from tgui::Panel.

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

Overload of assignment operator.

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

Changes the background image of the child window.

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

Reimplemented from tgui::Panel.

virtual void tgui::ChildWindow::setBorders ( unsigned int  leftBorder = 0,
unsigned int  topBorder = 0,
unsigned int  rightBorder = 0,
unsigned int  bottomBorder = 0 
)
virtual

Changes the size of the borders.

Parameters
leftBorderThe width of the left border
topBorderThe height of the top border
rightBorderThe width of the right border
bottomBorderThe height of the bottom border

Implements tgui::OBJECT_BORDERS.

virtual void tgui::ChildWindow::setTitlebarHeight ( unsigned int  height)
virtual

Change the height of the title bar.

The default height is the height of the title bar image that is loaded with the load function.

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

Changes the transparency of the window.

By default all objects in the window are drawn fully opaque, but with this function you can make them semi-transparent.

Warning
This function no longer works like expected. This is the cost for the performance improvements that I made. The next version of tgui will reimplement transparency (but for ALL objects) without losing performance while not used.

Member Data Documentation

sf::Color tgui::ChildWindow::borderColor

The color that is used to draw the borders of the window.

unsigned int tgui::ChildWindow::distanceToSide

The distance between the side of the title bar and the close button.

Layout tgui::ChildWindow::layout

Should the close button be on the right side or on the left side of the title bar?

sf::String tgui::ChildWindow::title

The title of the window.

TitleAlignment tgui::ChildWindow::titleAlignment

Should the text be on the left or the right or should it be centered?


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