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

#include <MyGUI_Gui.h>

+ Inheritance diagram for MyGUI::Gui:

Public Member Functions

 Gui ()
 ~Gui ()
void initialise (const std::string &_core="core.xml", const std::string &_logFileName="MyGUI.log")
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="")
const IntSizegetViewSize () 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)
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 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 GuigetInstance ()
static GuigetInstancePtr ()

Data Fields

FrameEventDelegate eventFrameStart

Friends

class WidgetManager

Detailed Description

Definition at line 39 of file MyGUI_Gui.h.


Constructor & Destructor Documentation

Definition at line 63 of file MyGUI_Gui.cpp.

Definition at line 70 of file MyGUI_Gui.cpp.


Member Function Documentation

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.

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 89 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 95 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 101 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 107 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::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::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:
_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 file). If your widget will overlap with any other you shoud select _layer with "overlapped" property enabled.
_nameif 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]

See Gui::createWidgetT

Definition at line 71 of file MyGUI_Gui.h.

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.

Destroy vector of widgets

Definition at line 264 of file MyGUI_Gui.cpp.

Destroy Enumerator of widgets

Definition at line 269 of file MyGUI_Gui.cpp.

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

Definition at line 227 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 168 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 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.

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.

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]
Deprecated:
"use : void Gui::setVisiblePointer(bool _value)"

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

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

Definition at line 75 of file MyGUI_Gui.cpp.

void MyGUI::Gui::injectFrameEntered ( float  _time) [inline]
Deprecated:
"called be renderer, do not call it manually"

Definition at line 236 of file MyGUI_Gui.h.

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

Inject KeyPress event

Returns:
true if event has been processed by GUI

Definition at line 187 of file MyGUI_Gui.cpp.

Inject KeyReleas event

Returns:
true if event has been processed by GUI

Definition at line 188 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 183 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 184 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 185 of file MyGUI_Gui.cpp.

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

Definition at line 234 of file MyGUI_Gui.h.

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]
Deprecated:
"use : void Gui::setVisiblePointer(bool _value)"

Definition at line 232 of file MyGUI_Gui.h.

Shutdown GUI and all GUI Managers

Definition at line 133 of file MyGUI_Gui.cpp.


Friends And Related Function Documentation

friend class WidgetManager [friend]

Reimplemented from MyGUI::IWidgetCreator.

Definition at line 41 of file MyGUI_Gui.h.


Field Documentation

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

Parameters:
_timeTime elapsed since last frame

Definition at line 221 of file MyGUI_Gui.h.


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