本文整理汇总了C++中Rect2D::x0y0方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect2D::x0y0方法的具体用法?C++ Rect2D::x0y0怎么用?C++ Rect2D::x0y0使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect2D
的用法示例。
在下文中一共展示了Rect2D::x0y0方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showMenu
void GuiDropDownList::showMenu() {
// Show the menu
Rect2D clickRect = theme()->dropDownListToClickBounds(rect(), m_captionWidth);
Vector2 clickOffset = clickRect.x0y0() - rect().x0y0();
Vector2 menuOffset(10, clickRect.height() + 10);
menu()->show(m_gui->manager(), window(), this, toOSWindowCoords(clickOffset + menuOffset), false, m_actionCallback);
}
示例2: setRect
void GuiRadioButton::setRect(const Rect2D& rect) {
if (m_style == GuiTheme::NORMAL_RADIO_BUTTON_STYLE) {
// Prevent the radio button from stealing clicks very far away
m_rect = rect;
m_clickRect = Rect2D::xywh(rect.x0y0(), theme()->bounds("AA"));
} else {
GuiControl::setRect(rect);
}
}
示例3: setRect
void GuiCheckBox::setRect(const Rect2D& rect) {
if (m_style == GuiTheme::NORMAL_CHECK_BOX_STYLE) {
// TODO: use the actual font size etc. to compute bounds
// Prevent the checkbox from stealing clicks very far away
m_rect = rect;
m_clickRect = Rect2D::xywh(rect.x0y0(), Vector2(min(rect.width(), 30.0f), rect.height()));
} else {
GuiControl::setRect(rect);
}
}
示例4: addPane
GuiPane* GuiPane::addPane(const GuiText& text, GuiTheme::PaneStyle style) {
Rect2D minRect = theme()->clientToPaneBounds(Rect2D::xywh(0,0,0,0), text, style);
Vector2 pos = nextControlPos();
// Back up by the border size
pos -= minRect.x0y0();
// Ensure the width isn't negative due to a very small m_clientRect
// which would push the position off the parent panel
float newRectWidth = max(m_clientRect.width() - pos.x * 2, 0.0f);
Rect2D newRect = Rect2D::xywh(pos, Vector2(newRectWidth, minRect.height()));
GuiPane* p = new GuiPane(this, text, newRect, style);
containerArray.append(p);
increaseBounds(p->rect().x1y1());
return p;
}