MyGUI  3.2.1
Public Member Functions | Data Fields | Friends
MyGUI::Gui Class Reference

#include <MyGUI_Gui.h>

+ Inheritance diagram for MyGUI::Gui:

Public Member Functions

 Gui ()
 
void initialise (const std::string &_core="MyGUI_Core.xml")
 
void initialise (const std::string &_core, const std::string &_logFileName)
 
void shutdown ()
 
WidgetcreateWidgetT (const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
 
WidgetcreateWidgetT (const std::string &_type, const std::string &_skin, int _left, int _top, int _width, int _height, Align _align, const std::string &_layer, const std::string &_name="")
 
WidgetcreateWidgetRealT (const std::string &_type, const std::string &_skin, const FloatCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
 
WidgetcreateWidgetRealT (const std::string &_type, const std::string &_skin, float _left, float _top, float _width, float _height, Align _align, const std::string &_layer, const std::string &_name="")
 
template<typename T >
T * createWidget (const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
 
template<typename T >
T * createWidget (const std::string &_skin, int _left, int _top, int _width, int _height, Align _align, const std::string &_layer, const std::string &_name="")
 
template<typename T >
T * createWidgetReal (const std::string &_skin, const FloatCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
 
template<typename T >
T * createWidgetReal (const std::string &_skin, float _left, float _top, float _width, float _height, Align _align, const std::string &_layer, const std::string &_name="")
 
void destroyWidget (Widget *_widget)
 
void destroyWidgets (const VectorWidgetPtr &_widgets)
 
void destroyWidgets (EnumeratorWidgetPtr &_widgets)
 
WidgetfindWidgetT (const std::string &_name, bool _throw=true)
 
WidgetfindWidgetT (const std::string &_name, const std::string &_prefix, bool _throw=true)
 
template<typename T >
T * findWidget (const std::string &_name, bool _throw=true)
 
template<typename T >
T * findWidget (const std::string &_name, const std::string &_prefix, bool _throw=true)
 
void destroyChildWidget (Widget *_widget)
 
void destroyAllChildWidget ()
 
EnumeratorWidgetPtr getEnumerator () const
 
void frameEvent (float _time)
 
void _linkChildWidget (Widget *_widget)
 
void _unlinkChildWidget (Widget *_widget)
 
- Public Member Functions inherited from MyGUI::Singleton< Gui >
 Singleton ()
 
virtual ~Singleton ()
 
- Public Member Functions inherited from MyGUI::MemberObsolete< Gui >
void destroyWidgetsVector (VectorWidgetPtr &_widgets)
 
void hidePointer ()
 
void showPointer ()
 
bool isShowPointer ()
 
void injectFrameEntered (float _time)
 
int getViewWidth ()
 
int getViewHeight ()
 
bool injectMouseMove (int _absx, int _absy, int _absz)
 
bool injectMousePress (int _absx, int _absy, MouseButton _id)
 
bool injectMouseRelease (int _absx, int _absy, MouseButton _id)
 
bool injectKeyPress (KeyCode _key, Char _text=0)
 
bool injectKeyRelease (KeyCode _key)
 
void setVisiblePointer (bool _value)
 
bool isVisiblePointer ()
 
bool load (const std::string &_file)
 
const IntSizegetViewSize ()
 
void _injectFrameEntered (float _time)
 
void _resizeWindow (const IntSize &_size)
 

Data Fields

EventHandle_FrameEventDelegate eventFrameStart
 

Friends

class WidgetManager
 

Additional Inherited Members

- Public Types inherited from MyGUI::Singleton< Gui >
typedef Singleton< GuiBase
 
- Static Public Member Functions inherited from MyGUI::Singleton< Gui >
static GuigetInstance ()
 
static GuigetInstancePtr ()
 
static const char * getClassTypeName ()
 

Detailed Description

Definition at line 23 of file MyGUI_Gui.h.

Constructor & Destructor Documentation

MyGUI::Gui::Gui ( )

Definition at line 37 of file MyGUI_Gui.cpp.

Member Function Documentation

void MyGUI::Gui::_linkChildWidget ( Widget _widget)

Definition at line 278 of file MyGUI_Gui.cpp.

void MyGUI::Gui::_unlinkChildWidget ( Widget _widget)

Definition at line 285 of file MyGUI_Gui.cpp.

template<typename T >
T* MyGUI::Gui::createWidget ( const std::string &  _skin,
const IntCoord _coord,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)
inline

Same as Gui::createWidgetT but return T* instead of Widget*

Definition at line 69 of file MyGUI_Gui.h.

template<typename T >
T* MyGUI::Gui::createWidget ( const std::string &  _skin,
int  _left,
int  _top,
int  _width,
int  _height,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)
inline

Same as Gui::createWidgetT but return T* instead of Widget*

Definition at line 75 of file MyGUI_Gui.h.

template<typename T >
T* MyGUI::Gui::createWidgetReal ( const std::string &  _skin,
const FloatCoord _coord,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)
inline

Same as Gui::createWidgetRealT but return T* instead of Widget*

Definition at line 81 of file MyGUI_Gui.h.

template<typename T >
T* MyGUI::Gui::createWidgetReal ( const std::string &  _skin,
float  _left,
float  _top,
float  _width,
float  _height,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)
inline

Same as Gui::createWidgetRealT but return T* instead of Widget*

Definition at line 87 of file MyGUI_Gui.h.

Widget * MyGUI::Gui::createWidgetRealT ( const std::string &  _type,
const std::string &  _skin,
const FloatCoord _coord,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)

Create widget using coordinates relative to parent widget. see Gui::createWidgetT

Definition at line 302 of file MyGUI_Gui.cpp.

Widget * MyGUI::Gui::createWidgetRealT ( const std::string &  _type,
const std::string &  _skin,
float  _left,
float  _top,
float  _width,
float  _height,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)

Create widget using coordinates relative to parent. see Gui::createWidgetT

Definition at line 308 of file MyGUI_Gui.cpp.

Widget * MyGUI::Gui::createWidgetT ( const std::string &  _type,
const std::string &  _skin,
const IntCoord _coord,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)

Create widget

Parameters
_typewidget type
_skinwidget skin
_coordint coordinates of widget (_left, _top, _width, _height)
_alignwidget align (possible values can be found in enum Align)
_layerlayer where widget will be created (all layers usually defined in core_layer.xml file).
_nameoptional widget name (you can use it for finding widget by name later)

Definition at line 292 of file MyGUI_Gui.cpp.

Widget * MyGUI::Gui::createWidgetT ( const std::string &  _type,
const std::string &  _skin,
int  _left,
int  _top,
int  _width,
int  _height,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
)

See Gui::createWidgetT

Definition at line 297 of file MyGUI_Gui.cpp.

void MyGUI::Gui::destroyAllChildWidget ( )

Destroy all child widgets

Definition at line 324 of file MyGUI_Gui.cpp.

void MyGUI::Gui::destroyChildWidget ( Widget _widget)

Destroy child widget or throw exception if this child widget not found

Definition at line 319 of file MyGUI_Gui.cpp.

void MyGUI::Gui::destroyWidget ( Widget _widget)

Destroy any created widget

Definition at line 250 of file MyGUI_Gui.cpp.

void MyGUI::Gui::destroyWidgets ( const VectorWidgetPtr _widgets)

Destroy vector of widgets

Definition at line 259 of file MyGUI_Gui.cpp.

void MyGUI::Gui::destroyWidgets ( EnumeratorWidgetPtr _widgets)

Destroy Enumerator of widgets

Definition at line 265 of file MyGUI_Gui.cpp.

template<typename T >
T* MyGUI::Gui::findWidget ( const std::string &  _name,
bool  _throw = true 
)
inline

Find widget by name and cast it to T type. If widget not found or T and found widget have different types exception will be thrown, or if the second parameter is false the nullptr pointer will be returned

Definition at line 115 of file MyGUI_Gui.h.

template<typename T >
T* MyGUI::Gui::findWidget ( const std::string &  _name,
const std::string &  _prefix,
bool  _throw = true 
)
inline

Find widget by name and prefix and cast it to T type If widget not found or T and found widget have different types cause exception, or if the second parameter is false the nullptr pointer will be returned

Definition at line 126 of file MyGUI_Gui.h.

Widget * MyGUI::Gui::findWidgetT ( const std::string &  _name,
bool  _throw = true 
)

Find widget by name If widget is not found the exception will be thrown, or if the second parameter is false the nullptr pointer will be returned

Definition at line 196 of file MyGUI_Gui.cpp.

Widget * MyGUI::Gui::findWidgetT ( const std::string &  _name,
const std::string &  _prefix,
bool  _throw = true 
)

Find widget by name and prefix If widget is not found the exception will be thrown, or if the second parameter is false the nullptr pointer will be returned

Definition at line 314 of file MyGUI_Gui.cpp.

void MyGUI::Gui::frameEvent ( float  _time)

Inject frame entered event (called be renderer, do not call it manually). This function is called every frame by renderer.

Definition at line 334 of file MyGUI_Gui.cpp.

EnumeratorWidgetPtr MyGUI::Gui::getEnumerator ( ) const

Get root widgets Enumerator

Definition at line 329 of file MyGUI_Gui.cpp.

void MyGUI::Gui::initialise ( const std::string &  _core = "MyGUI_Core.xml")

Initialise GUI and all GUI Managers

Parameters
_corename of core config file for MyGUI (contain main config files with skins, layers, fonts, etc.)
_logFileNameLog file name

Definition at line 58 of file MyGUI_Gui.cpp.

void MyGUI::Gui::initialise ( const std::string &  _core,
const std::string &  _logFileName 
)
Deprecated:
" is deprecated, use : void Gui::initialise(const std::string& _core) and set log filename in Platform"

Definition at line 124 of file MyGUI_Gui.cpp.

void MyGUI::Gui::shutdown ( )

Shutdown GUI and all GUI Managers

Definition at line 130 of file MyGUI_Gui.cpp.

Friends And Related Function Documentation

friend class WidgetManager
friend

Definition at line 28 of file MyGUI_Gui.h.

Field Documentation

EventHandle_FrameEventDelegate MyGUI::Gui::eventFrameStart

Event : Multidelegate. GUI per frame call.
signature : void method(float _time)

Parameters
_timeTime elapsed since last frame

Definition at line 150 of file MyGUI_Gui.h.


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