当前位置: 首页>>代码示例>>C++>>正文


C++ Rect2D::x0y0方法代码示例

本文整理汇总了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);
}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:8,代码来源:GuiDropDownList.cpp

示例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);
    }
}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:9,代码来源:GuiRadioButton.cpp

示例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);
     }
}
开发者ID:A7med-Shoukry,项目名称:g3d,代码行数:10,代码来源:GuiCheckBox.cpp

示例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;
}
开发者ID:A7med-Shoukry,项目名称:g3d,代码行数:21,代码来源:GuiPane.cpp


注:本文中的Rect2D::x0y0方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。