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


C++ Widget::getBottom方法代码示例

本文整理汇总了C++中mygui::Widget::getBottom方法的典型用法代码示例。如果您正苦于以下问题:C++ Widget::getBottom方法的具体用法?C++ Widget::getBottom怎么用?C++ Widget::getBottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mygui::Widget的用法示例。


在下文中一共展示了Widget::getBottom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: buildNewControl

    bool PropertyGridManager::buildNewControl(PropertyGridProperty *const property, int &height)
    {
        if(nullptr == mContainerWidget)
        {
            Debug::error(STEEL_METH_INTRO, "no container for controls. Aborting.").endl();
            return false;
        }

        // build the control matching the property value type
        Ogre::String const skin = "PanelEmpty";
        Ogre::String const controlName = "PropertyGridManager_Control_" + property->id();

        // original control size is set here, but the method that build the control can totally resize it.
        MyGUI::IntCoord coords(0, height, mContainerWidget->getClientWidget()->getWidth(), 20);
        MyGUI::Widget *control = mContainerWidget->createWidget<MyGUI::Widget>(skin, coords, MyGUI::Align::HCenter | MyGUI::Align::Top, controlName);

        if(nullptr == control)
        {
            Debug::error(STEEL_METH_INTRO, "could not build control for property: ", *property, ". Skipping.").endl();
            return false;
        }

        switch(property->valueType())
        {
            case PropertyGridPropertyValueType::Bool:
                buildBoolControl(control, property);
                break;

            case PropertyGridPropertyValueType::String:
                buildStringControl(control, property);
                break;

            case PropertyGridPropertyValueType::Range:
                buildRangeControl(control, property);
                break;

            case PropertyGridPropertyValueType::StringVectorSelection:
                buildStringVectorSelectionControl(control, property);
                break;

            case PropertyGridPropertyValueType::None:
            default:
                buildDummyControl(control, property);
        }

        height = control->getBottom();
        mControlsMap.insert(std::make_pair(property->id(), control));

        // subscribe to property changes
        Signal propertyChanged = property->getSignal(PropertyGridProperty::PublicSignal::changed);
        registerSignal(propertyChanged);
        mSignals.propertyChanged.insert(propertyChanged);

        // update control value
        updateControlValue(control, property);

        return true;
    }
开发者ID:onze,项目名称:Steel,代码行数:58,代码来源:PropertyGridManager.cpp


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