MyGUI 3.0.1
|
#include <MyGUI_Gui.h>
Public Member Functions | |
Gui () | |
~Gui () | |
void | initialise (const std::string &_core="core.xml", const std::string &_logFileName="MyGUI.log") |
void | shutdown () |
Widget * | createWidgetT (const std::string &_type, const std::string &_skin, const IntCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="") |
Widget * | 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="") |
Widget * | createWidgetRealT (const std::string &_type, const std::string &_skin, const FloatCoord &_coord, Align _align, const std::string &_layer, const std::string &_name="") |
Widget * | 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 IntSize & | getViewSize () const |
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 | destroyWidget (Widget *_widget) |
void | destroyWidgets (VectorWidgetPtr &_widgets) |
void | destroyWidgets (EnumeratorWidgetPtr &_widgets) |
Widget * | findWidgetT (const std::string &_name, bool _throw=true) |
Widget * | 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 (Widget *_widget) |
void | destroyAllChildWidget () |
EnumeratorWidgetPtr | getEnumerator () |
void | _injectFrameEntered (float _time) |
void | destroyWidgetsVector (VectorWidgetPtr &_widgets) |
void | hidePointer () |
void | showPointer () |
bool | isShowPointer () |
void | injectFrameEntered (float _time) |
Static Public Member Functions | |
static Gui & | getInstance () |
static Gui * | getInstancePtr () |
Data Fields | |
FrameEventDelegate | eventFrameStart |
Friends | |
class | WidgetManager |
Definition at line 39 of file MyGUI_Gui.h.
MyGUI::Gui::Gui | ( | ) |
Definition at line 63 of file MyGUI_Gui.cpp.
MyGUI::Gui::~Gui | ( | ) |
Definition at line 70 of file MyGUI_Gui.cpp.
void MyGUI::Gui::_injectFrameEntered | ( | 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 284 of file MyGUI_Gui.cpp.
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 89 of file MyGUI_Gui.h.
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 95 of file MyGUI_Gui.h.
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 101 of file MyGUI_Gui.h.
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 107 of file MyGUI_Gui.h.
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 = "" |
||
) | [inline] |
Create widget using coordinates relative to parent. see Gui::createWidgetT
Definition at line 81 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 = "" |
||
) | [inline] |
Create widget using coordinates relative to parent. see Gui::createWidgetT
Definition at line 76 of file MyGUI_Gui.h.
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 = "" |
||
) | [inline] |
Create widget
_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 66 of file MyGUI_Gui.h.
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 = "" |
||
) | [inline] |
Definition at line 71 of file MyGUI_Gui.h.
void MyGUI::Gui::destroyAllChildWidget | ( | ) | [inline] |
Destroy all child widgets
Definition at line 201 of file MyGUI_Gui.h.
void MyGUI::Gui::destroyChildWidget | ( | Widget * | _widget | ) | [inline] |
Destroy child widget or throw exception if this child widget not found
Definition at line 198 of file MyGUI_Gui.h.
void MyGUI::Gui::destroyWidget | ( | Widget * | _widget | ) |
Destroy any created widget
Definition at line 259 of file MyGUI_Gui.cpp.
void MyGUI::Gui::destroyWidgets | ( | VectorWidgetPtr & | _widgets | ) |
Destroy vector of widgets
Definition at line 264 of file MyGUI_Gui.cpp.
void MyGUI::Gui::destroyWidgets | ( | EnumeratorWidgetPtr & | _widgets | ) |
Destroy Enumerator of widgets
Definition at line 269 of file MyGUI_Gui.cpp.
void MyGUI::Gui::destroyWidgetsVector | ( | VectorWidgetPtr & | _widgets | ) | [inline] |
Definition at line 227 of file MyGUI_Gui.h.
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 168 of file MyGUI_Gui.h.
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 179 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 200 of file MyGUI_Gui.cpp.
Widget* 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 158 of file MyGUI_Gui.h.
EnumeratorWidgetPtr MyGUI::Gui::getEnumerator | ( | ) | [inline] |
Get name of Gui ResourceGroup Get root widgets Enumerator
Definition at line 207 of file MyGUI_Gui.h.
Gui & MyGUI::Gui::getInstance | ( | ) | [static] |
Definition at line 57 of file MyGUI_Gui.cpp.
Gui * MyGUI::Gui::getInstancePtr | ( | ) | [static] |
Definition at line 52 of file MyGUI_Gui.cpp.
int MyGUI::Gui::getViewHeight | ( | ) | [inline] |
Definition at line 116 of file MyGUI_Gui.h.
const IntSize& MyGUI::Gui::getViewSize | ( | ) | const [inline] |
Get view size of GUI area
Definition at line 113 of file MyGUI_Gui.h.
int MyGUI::Gui::getViewWidth | ( | ) | [inline] |
Definition at line 115 of file MyGUI_Gui.h.
void MyGUI::Gui::hidePointer | ( | ) | [inline] |
Definition at line 230 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
_core | name of core config file for MyGUI (contain main config files with skins, layers, fonts, etc.) |
_logFileName | Log file name |
Definition at line 75 of file MyGUI_Gui.cpp.
void MyGUI::Gui::injectFrameEntered | ( | float | _time | ) | [inline] |
Definition at line 236 of file MyGUI_Gui.h.
Inject KeyPress event
Definition at line 187 of file MyGUI_Gui.cpp.
bool MyGUI::Gui::injectKeyRelease | ( | KeyCode | _key | ) |
Inject KeyReleas event
Definition at line 188 of file MyGUI_Gui.cpp.
bool MyGUI::Gui::injectMouseMove | ( | int | _absx, |
int | _absy, | ||
int | _absz | ||
) |
Inject MouseMove event
Definition at line 183 of file MyGUI_Gui.cpp.
bool MyGUI::Gui::injectMousePress | ( | int | _absx, |
int | _absy, | ||
MouseButton | _id | ||
) |
Inject MousePress event
Definition at line 184 of file MyGUI_Gui.cpp.
bool MyGUI::Gui::injectMouseRelease | ( | int | _absx, |
int | _absy, | ||
MouseButton | _id | ||
) |
Inject MouseRelease event
Definition at line 185 of file MyGUI_Gui.cpp.
bool MyGUI::Gui::isShowPointer | ( | ) | [inline] |
Definition at line 234 of file MyGUI_Gui.h.
bool MyGUI::Gui::isVisiblePointer | ( | ) |
Is mouse pointer visible
Definition at line 279 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 254 of file MyGUI_Gui.cpp.
void MyGUI::Gui::resizeWindow | ( | const IntSize & | _size | ) |
Definition at line 308 of file MyGUI_Gui.cpp.
void MyGUI::Gui::setVisiblePointer | ( | bool | _visible | ) |
Show or hide mouse pointer
Definition at line 274 of file MyGUI_Gui.cpp.
void MyGUI::Gui::showPointer | ( | ) | [inline] |
Definition at line 232 of file MyGUI_Gui.h.
void MyGUI::Gui::shutdown | ( | ) |
Shutdown GUI and all GUI Managers
Definition at line 133 of file MyGUI_Gui.cpp.
friend class WidgetManager [friend] |
Reimplemented from MyGUI::IWidgetCreator.
Definition at line 41 of file MyGUI_Gui.h.
Multidelegate for GUI per frame call.
signature : void method(float _time)
_time | Time elapsed since last frame |
Definition at line 221 of file MyGUI_Gui.h.