MyGUI_WidgetTranslate.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_WIDGET_TRANSLATE_H_
#define MYGUI_WIDGET_TRANSLATE_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Types.h"
namespace MyGUI
{
inline int getWidgetWidth(Widget* _widget, bool _vert)
{
return _vert ? _widget->getWidth() : _widget->getHeight();
}
inline int getWidgetHeight(Widget* _widget, bool _vert)
{
return _vert ? _widget->getHeight() : _widget->getWidth();
}
inline int getWidgetLeft(Widget* _widget, bool _vert)
{
return _vert ? _widget->getLeft() : _widget->getTop();
}
inline int getWidgetTop(Widget* _widget, bool _vert)
{
return _vert ? _widget->getTop() : _widget->getLeft();
}
inline void setWidgetSize(Widget* _widget, int _width, int _height, bool _vert)
{
_vert ? _widget->setSize(_width, _height) : _widget->setSize(_height, _width);
}
inline void setWidgetCoord(Widget* _widget, int _left, int _top, int _width, int _height, bool _vert)
{
_vert ? _widget->setCoord(_left, _top, _width, _height) : _widget->setCoord(_top, _left, _height, _width);
}
inline void convertWidgetCoord(IntCoord& _coord, bool _vert)
{
if (!_vert)
{
std::swap(_coord.left, _coord.top);
std::swap(_coord.width, _coord.height);
}
}
} // namespace MyGUI
#endif // MYGUI_WIDGET_TRANSLATE_H_
MyGUI_Prerequest.h
MyGUI_Types.h
MyGUI::ICroppedRectangle::getTop
int getTop() const
Definition MyGUI_ICroppedRectangle.h:103
MyGUI::ICroppedRectangle::getWidth
int getWidth() const
Definition MyGUI_ICroppedRectangle.h:113
MyGUI::ICroppedRectangle::getHeight
int getHeight() const
Definition MyGUI_ICroppedRectangle.h:118
MyGUI::ICroppedRectangle::getLeft
int getLeft() const
Definition MyGUI_ICroppedRectangle.h:93
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::Widget::setSize
void setSize(const IntSize &_size) override
Definition MyGUI_Widget.cpp:693
MyGUI::Widget::setCoord
void setCoord(const IntCoord &_coord) override
Definition MyGUI_Widget.cpp:730
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::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
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::height
T height
Definition MyGUI_TCoord.h:23
MyGUI::types::TCoord::width
T width
Definition MyGUI_TCoord.h:22
MyGUI::types::TCoord::top
T top
Definition MyGUI_TCoord.h:21
MyGUI::types::TCoord::left
T left
Definition MyGUI_TCoord.h:20