MyGUI: MyGUI_WidgetTranslate.h Source File

MyGUI 3.4.2

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

- File List
- Globals

MyGUI_WidgetTranslate.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_WIDGET_TRANSLATE_H_
8#define MYGUI_WIDGET_TRANSLATE_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Types.h"
12
13namespace MyGUI
14{
15
16 inline int getWidgetWidth(Widget* _widget, bool _vert)
17 {
18 return _vert ? _widget->getWidth() : _widget->getHeight();
19 }
20
21 inline int getWidgetHeight(Widget* _widget, bool _vert)
22 {
23 return _vert ? _widget->getHeight() : _widget->getWidth();
24 }
25
26 inline int getWidgetLeft(Widget* _widget, bool _vert)
27 {
28 return _vert ? _widget->getLeft() : _widget->getTop();
29 }
30
31 inline int getWidgetTop(Widget* _widget, bool _vert)
32 {
33 return _vert ? _widget->getTop() : _widget->getLeft();
34 }
35
36 inline void setWidgetSize(Widget* _widget, int _width, int _height, bool _vert)
37 {
38 _vert ? _widget->setSize(_width, _height) : _widget->setSize(_height, _width);
39 }
40
41 inline void setWidgetCoord(Widget* _widget, int _left, int _top, int _width, int _height, bool _vert)
42 {
43 _vert ? _widget->setCoord(_left, _top, _width, _height) : _widget->setCoord(_top, _left, _height, _width);
44 }
45
46 inline void convertWidgetCoord(IntCoord& _coord, bool _vert)
47 {
48 if (!_vert)
49 {
50 std::swap(_coord.left, _coord.top);
51 std::swap(_coord.width, _coord.height);
52 }
53 }
54
55} // namespace MyGUI
56
57#endif // MYGUI_WIDGET_TRANSLATE_H_
MyGUI_Prerequest.h
MyGUI_Types.h
MyGUI::ICroppedRectangle::getTop
int getTop() const
Definition MyGUI_ICroppedRectangle.h:104
MyGUI::ICroppedRectangle::getWidth
int getWidth() const
Definition MyGUI_ICroppedRectangle.h:114
MyGUI::ICroppedRectangle::getHeight
int getHeight() const
Definition MyGUI_ICroppedRectangle.h:119
MyGUI::ICroppedRectangle::getLeft
int getLeft() const
Definition MyGUI_ICroppedRectangle.h:94
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:37
MyGUI::Widget::setCoord
void setCoord(const IntCoord &_value) override
Definition MyGUI_Widget.cpp:686
MyGUI::Widget::setSize
void setSize(const IntSize &_value) override
Definition MyGUI_Widget.cpp:649
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::getWidgetLeft
int getWidgetLeft(Widget *_widget, bool _vert)
Definition MyGUI_WidgetTranslate.h:26
MyGUI::getWidgetWidth
int getWidgetWidth(Widget *_widget, bool _vert)
Definition MyGUI_WidgetTranslate.h:16
MyGUI::convertWidgetCoord
void convertWidgetCoord(IntCoord &_coord, bool _vert)
Definition MyGUI_WidgetTranslate.h:46
MyGUI::setWidgetSize
void setWidgetSize(Widget *_widget, int _width, int _height, bool _vert)
Definition MyGUI_WidgetTranslate.h:36
MyGUI::getWidgetHeight
int getWidgetHeight(Widget *_widget, bool _vert)
Definition MyGUI_WidgetTranslate.h:21
MyGUI::getWidgetTop
int getWidgetTop(Widget *_widget, bool _vert)
Definition MyGUI_WidgetTranslate.h:31
MyGUI::setWidgetCoord
void setWidgetCoord(Widget *_widget, int _left, int _top, int _width, int _height, bool _vert)
Definition MyGUI_WidgetTranslate.h:41
MyGUI::types::TCoord< int >
MyGUI::types::TCoord::height
T height
Definition MyGUI_TCoord.h:25
MyGUI::types::TCoord::width
T width
Definition MyGUI_TCoord.h:24
MyGUI::types::TCoord::top
T top
Definition MyGUI_TCoord.h:23
MyGUI::types::TCoord::left
T left
Definition MyGUI_TCoord.h:22