MyGUI 3.2.0

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_WidgetTranslate.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_WIDGET_TRANSLATE_H__
23 #define __MYGUI_WIDGET_TRANSLATE_H__
24
25 #include "MyGUI_Prerequest.h"
26
27 namespace MyGUI
28 {
29
30 inline int getWidgetWidth(Widget* _widget, bool _vert)
31 {
32 return _vert ? _widget->getWidth() : _widget->getHeight();
33 }
34
35 inline int getWidgetHeight(Widget* _widget, bool _vert)
36 {
37 return _vert ? _widget->getHeight() : _widget->getWidth();
38 }
39
40 inline int getWidgetLeft(Widget* _widget, bool _vert)
41 {
42 return _vert ? _widget->getLeft() : _widget->getTop();
43 }
44
45 inline int getWidgetTop(Widget* _widget, bool _vert)
46 {
47 return _vert ? _widget->getTop() : _widget->getLeft();
48 }
49
50 inline void setWidgetSize(Widget* _widget, int _width, int _height, bool _vert)
51 {
52 _vert ? _widget->setSize(_width, _height) : _widget->setSize(_height, _width);
53 }
54
55 inline void setWidgetCoord(Widget* _widget, int _left, int _top, int _width, int _height, bool _vert)
56 {
57 _vert ? _widget->setCoord(_left, _top, _width, _height) : _widget->setCoord(_top, _left, _height, _width);
58 }
59
60 inline void convertWidgetCoord(IntCoord& _coord, bool _vert)
61 {
62 if (!_vert)
63 {
64 std::swap(_coord.left, _coord.top);
65 std::swap(_coord.width, _coord.height);
66 }
67 }
68
69 } // namespace MyGUI
70
71 #endif // __MYGUI_WIDGET_TRANSLATE_H__
MyGUI::types::TCoord
Definition: MyGUI_TCoord.h:35
MyGUI::Widget
Definition: MyGUI_Widget.h:41
MyGUI_Prerequest.h
MyGUI::ICroppedRectangle::getHeight
int getHeight() const
Definition: MyGUI_ICroppedRectangle.h:134
MyGUI::ICroppedRectangle::getLeft
int getLeft() const
Definition: MyGUI_ICroppedRectangle.h:109
MyGUI::getWidgetHeight
int getWidgetHeight(Widget *_widget, bool _vert)
Definition: MyGUI_WidgetTranslate.h:35
MyGUI::types::TCoord::width
T width
Definition: MyGUI_TCoord.h:39
MyGUI::Widget::setCoord
virtual void setCoord(const IntCoord &_value)
Definition: MyGUI_Widget.cpp:691
MyGUI::Widget::setSize
virtual void setSize(const IntSize &_value)
Definition: MyGUI_Widget.cpp:656
MyGUI::types::TCoord::top
T top
Definition: MyGUI_TCoord.h:38
MyGUI::getWidgetTop
int getWidgetTop(Widget *_widget, bool _vert)
Definition: MyGUI_WidgetTranslate.h:45
MyGUI::ICroppedRectangle::getWidth
int getWidth() const
Definition: MyGUI_ICroppedRectangle.h:129
MyGUI::getWidgetLeft
int getWidgetLeft(Widget *_widget, bool _vert)
Definition: MyGUI_WidgetTranslate.h:40
MyGUI::setWidgetSize
void setWidgetSize(Widget *_widget, int _width, int _height, bool _vert)
Definition: MyGUI_WidgetTranslate.h:50
MyGUI::setWidgetCoord
void setWidgetCoord(Widget *_widget, int _left, int _top, int _width, int _height, bool _vert)
Definition: MyGUI_WidgetTranslate.h:55
MyGUI::ICroppedRectangle::getTop
int getTop() const
Definition: MyGUI_ICroppedRectangle.h:119
MyGUI::types::TCoord::left
T left
Definition: MyGUI_TCoord.h:37
MyGUI::getWidgetWidth
int getWidgetWidth(Widget *_widget, bool _vert)
Definition: MyGUI_WidgetTranslate.h:30
MyGUI::types::TCoord::height
T height
Definition: MyGUI_TCoord.h:40
MyGUI::convertWidgetCoord
void convertWidgetCoord(IntCoord &_coord, bool _vert)
Definition: MyGUI_WidgetTranslate.h:60