MyGUI::Gui Class Reference

#include <MyGUI_Gui.h>

Inheritance diagram for MyGUI::Gui:
Inheritance graph
[legend]

Public Member Functions

void initialise (const std::string &_core="core.xml", const std::string &_logFileName="MyGUI.log")
void shutdown ()
WidgetPtr createWidgetT (const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
WidgetPtr 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="")
WidgetPtr createWidgetRealT (const std::string &_type, const std::string &_skin, const FloatCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="")
WidgetPtr 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="")
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="")
const IntSizegetViewSize ()
int getViewWidth ()
int getViewHeight ()
void injectFrameEntered (float _time)
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 destroyWidget (WidgetPtr _widget)
void destroyWidgets (VectorWidgetPtr &_widgets)
void destroyWidgets (EnumeratorWidgetPtr &_widgets)
WidgetPtr findWidgetT (const std::string &_name, bool _throw=true)
WidgetPtr findWidgetT (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 setVisiblePointer (bool _visible)
bool isVisiblePointer ()
bool load (const std::string &_file)
void resizeWindow (const IntSize &_size)
void destroyChildWidget (WidgetPtr _widget)
void destroyAllChildWidget ()
EnumeratorWidgetPtr getEnumerator ()
 __declspec (deprecated("use : void Gui::destroyWidgets(VectorWidgetPtr &_widgets)")) void destroyWidgetsVector(VectorWidgetPtr &_widgets)
 __declspec (deprecated("use : void Gui::setVisiblePointer(bool _value)")) void hidePointer()
 __declspec (deprecated("use : void Gui::setVisiblePointer(bool _value)")) void showPointer()
 __declspec (deprecated("use : bool Gui::isVisiblePointer()")) bool isShowPointer()

Data Fields

FrameEventDelegate eventFrameStart

Friends

class WidgetManager

Detailed Description

Definition at line 40 of file MyGUI_Gui.h.


Member Function Documentation

MyGUI::Gui::__declspec ( deprecated("use : bool Gui::isVisiblePointer()")   )  [inline]
Deprecated:
"use : bool Gui::isVisiblePointer()"

Definition at line 232 of file MyGUI_Gui.h.

MyGUI::Gui::__declspec ( deprecated("use : void Gui::setVisiblePointer(bool _value)")   )  [inline]
Deprecated:
"use : void Gui::setVisiblePointer(bool _value)"

Definition at line 230 of file MyGUI_Gui.h.

MyGUI::Gui::__declspec ( deprecated("use : void Gui::setVisiblePointer(bool _value)")   )  [inline]
Deprecated:
"use : void Gui::setVisiblePointer(bool _value)"

Definition at line 228 of file MyGUI_Gui.h.

MyGUI::Gui::__declspec ( deprecated("use : void Gui::destroyWidgets(VectorWidgetPtr &_widgets)")   )  [inline]
Deprecated:
"use : void Gui::destroyWidgets(VectorWidgetPtr &_widgets)"

Definition at line 225 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 WidgetPtr

Definition at line 96 of file MyGUI_Gui.h.

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 WidgetPtr

Definition at line 90 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 WidgetPtr

Definition at line 108 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 WidgetPtr

Definition at line 102 of file MyGUI_Gui.h.

WidgetPtr 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 = "" 
) [inline]

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

Definition at line 82 of file MyGUI_Gui.h.

WidgetPtr MyGUI::Gui::createWidgetRealT ( const std::string &  _type,
const std::string &  _skin,
const FloatCoord _coord,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
) [inline]

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

Definition at line 77 of file MyGUI_Gui.h.

WidgetPtr 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 = "" 
) [inline]

See Gui::createWidgetT

Definition at line 72 of file MyGUI_Gui.h.

WidgetPtr MyGUI::Gui::createWidgetT ( const std::string &  _type,
const std::string &  _skin,
const IntCoord _coord,
Align  _align,
const std::string &  _layer,
const std::string &  _name = "" 
) [inline]

Create widget

Parameters:
_type widget type
_skin widget skin
_coord int coordinates of widget (_left, _top, _width, _height)
_align widget align (possible values can be found in enum Align)
_layer layer where widget will be created (all layers usually defined in core.layer file). If your widget will overlap with any other you shoud select _layer with "overlapped" property enabled.
_name if needed (you can use it for finding widget by name later)

Definition at line 67 of file MyGUI_Gui.h.

void MyGUI::Gui::destroyAllChildWidget (  )  [inline]

Destroy all child widgets

Definition at line 207 of file MyGUI_Gui.h.

void MyGUI::Gui::destroyChildWidget ( WidgetPtr  _widget  )  [inline]

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

Definition at line 204 of file MyGUI_Gui.h.

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

Destroy any created widget

Definition at line 264 of file MyGUI_Gui.cpp.

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

Destroy Enumerator of widgets

Definition at line 274 of file MyGUI_Gui.cpp.

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

Destroy vector of widgets

Definition at line 269 of file MyGUI_Gui.cpp.

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 185 of file MyGUI_Gui.h.

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 cause exception, or if the second parameter is false the nullptr pointer will be returned

Definition at line 174 of file MyGUI_Gui.h.

WidgetPtr MyGUI::Gui::findWidgetT ( const std::string &  _name,
const std::string &  _prefix,
bool  _throw = true 
) [inline]

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 164 of file MyGUI_Gui.h.

WidgetPtr 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 205 of file MyGUI_Gui.cpp.

EnumeratorWidgetPtr MyGUI::Gui::getEnumerator (  )  [inline]

Get name of Gui ResourceGroup Get root widgets Enumerator

Definition at line 213 of file MyGUI_Gui.h.

int MyGUI::Gui::getViewHeight (  )  [inline]

Definition at line 117 of file MyGUI_Gui.h.

const IntSize& MyGUI::Gui::getViewSize (  )  [inline]

Get view size of GUI area

Definition at line 114 of file MyGUI_Gui.h.

int MyGUI::Gui::getViewWidth (  )  [inline]

Definition at line 116 of file MyGUI_Gui.h.

void MyGUI::Gui::initialise ( const std::string &  _core = "core.xml",
const std::string &  _logFileName = "MyGUI.log" 
)

Initialise GUI and all GUI Managers

Parameters:
_core name of core config file for MyGUI (contain main config files with skins, layers, fonts, etc.)
_logFileName Log file name

Definition at line 76 of file MyGUI_Gui.cpp.

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

Inject frame entered event. This function should be called every frame.

Definition at line 289 of file MyGUI_Gui.cpp.

bool MyGUI::Gui::injectKeyPress ( KeyCode  _key,
Char  _text = 0 
)

Inject KeyPress event

Returns:
true if event has been processed by GUI

Definition at line 192 of file MyGUI_Gui.cpp.

bool MyGUI::Gui::injectKeyRelease ( KeyCode  _key  ) 

Inject KeyReleas event

Returns:
true if event has been processed by GUI

Definition at line 193 of file MyGUI_Gui.cpp.

bool MyGUI::Gui::injectMouseMove ( int  _absx,
int  _absy,
int  _absz 
)

Inject MouseMove event

Returns:
true if event has been processed by GUI

Definition at line 188 of file MyGUI_Gui.cpp.

bool MyGUI::Gui::injectMousePress ( int  _absx,
int  _absy,
MouseButton  _id 
)

Inject MousePress event

Returns:
true if event has been processed by GUI

Definition at line 189 of file MyGUI_Gui.cpp.

bool MyGUI::Gui::injectMouseRelease ( int  _absx,
int  _absy,
MouseButton  _id 
)

Inject MouseRelease event

Returns:
true if event has been processed by GUI

Definition at line 190 of file MyGUI_Gui.cpp.

bool MyGUI::Gui::isVisiblePointer (  ) 

Is mouse pointer visible

Definition at line 284 of file MyGUI_Gui.cpp.

bool MyGUI::Gui::load ( const std::string &  _file  ) 

Load config with any info (file can have different data such other config files that will be loaded, skins, layers, pointers, etc)

Definition at line 259 of file MyGUI_Gui.cpp.

void MyGUI::Gui::resizeWindow ( const IntSize _size  ) 

Definition at line 313 of file MyGUI_Gui.cpp.

void MyGUI::Gui::setVisiblePointer ( bool  _visible  ) 

Show or hide mouse pointer

Definition at line 279 of file MyGUI_Gui.cpp.

void MyGUI::Gui::shutdown (  ) 

Shutdown GUI and all GUI Managers

Definition at line 136 of file MyGUI_Gui.cpp.


Friends And Related Function Documentation

friend class WidgetManager [friend]

Reimplemented from MyGUI::IWidgetCreator.

Definition at line 42 of file MyGUI_Gui.h.


Field Documentation

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

Parameters:
_time Time elapsed since last frame

Definition at line 220 of file MyGUI_Gui.h.


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

Generated on 5 Dec 2009 for MyGUI by  doxygen 1.6.1