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


C++ UICheckBox::SetWidget方法代码示例

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


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

示例1: WrapWidget

UIWidget* UI::WrapWidget(tb::TBWidget* widget)
{
    if (!widget)
        return NULL;

    if (widgetWrap_.Contains(widget))
        return widgetWrap_[widget];

    // switch this to use a factory?

    // this is order dependent as we're using IsOfType which also works if a base class

    if (widget->IsOfType<TBPopupWindow>())
    {
        UIPopupWindow* popupWindow = new UIPopupWindow(context_, false);
        popupWindow->SetWidget(widget);
        widgetWrap_[widget] = popupWindow;
        return popupWindow;
    }

    if (widget->IsOfType<TBDimmer>())
    {
        UIDimmer* dimmer = new UIDimmer(context_, false);
        dimmer->SetWidget(widget);
        widgetWrap_[widget] = dimmer;
        return dimmer;
    }

    if (widget->IsOfType<TBScrollContainer>())
    {
        UIScrollContainer* container = new UIScrollContainer(context_, false);
        container->SetWidget(widget);
        widgetWrap_[widget] = container;
        return container;
    }

    if (widget->IsOfType<TBInlineSelect>())
    {
        UIInlineSelect* select = new UIInlineSelect(context_, false);
        select->SetWidget(widget);
        widgetWrap_[widget] = select;
        return select;
    }

    if (widget->IsOfType<TBSection>())
    {
        UISection* section = new UISection(context_, false);
        section->SetWidget(widget);
        widgetWrap_[widget] = section;
        return section;
    }

    if (widget->IsOfType<TBSeparator>())
    {
        UISeparator* sep = new UISeparator(context_, false);
        sep->SetWidget(widget);
        widgetWrap_[widget] = sep;
        return sep;
    }

    if (widget->IsOfType<TBContainer>())
    {
        UIContainer* container = new UIContainer(context_, false);
        container->SetWidget(widget);
        widgetWrap_[widget] = container;
        return container;
    }

    if (widget->IsOfType<TBSelectDropdown>())
    {
        UISelectDropdown* select = new UISelectDropdown(context_, false);
        select->SetWidget(widget);
        widgetWrap_[widget] = select;
        return select;
    }

    if (widget->IsOfType<TBButton>())
    {
        // don't wrap the close button of a TBWindow.close
        if (widget->GetID() == TBIDC("TBWindow.close"))
            return 0;

        UIButton* button = new UIButton(context_, false);
        button->SetWidget(widget);
        widgetWrap_[widget] = button;
        return button;
    }

    if (widget->IsOfType<TBTextField>())
    {
        UITextField* textfield = new UITextField(context_, false);
        textfield->SetWidget(widget);
        widgetWrap_[widget] = textfield;
        return textfield;
    }

    if (widget->IsOfType<TBEditField>())
    {
        UIEditField* editfield = new UIEditField(context_, false);
        editfield->SetWidget(widget);
//.........这里部分代码省略.........
开发者ID:marynate,项目名称:AtomicGameEngine,代码行数:101,代码来源:UI.cpp

示例2: WrapWidget

UIWidget* UI::WrapWidget(tb::TBWidget* widget)
{
    if (!widget)
        return NULL;

    if (widgetWrap_.Contains(widget))
        return widgetWrap_[widget];

    // switch this to use a factory?

    // this is order dependent as we're using IsOfType which also works if a base class

    if (widget->IsOfType<TBPopupWindow>())
    {
        UIPopupWindow* popupWindow = new UIPopupWindow(context_, false);
        popupWindow->SetWidget(widget);
        WrapWidget(popupWindow, widget);
        return popupWindow;
    }

    if (widget->IsOfType<TBDimmer>())
    {
        UIDimmer* dimmer = new UIDimmer(context_, false);
        dimmer->SetWidget(widget);
        WrapWidget(dimmer, widget);
        return dimmer;
    }

    if (widget->IsOfType<TBScrollContainer>())
    {
        UIScrollContainer* container = new UIScrollContainer(context_, false);
        container->SetWidget(widget);
        WrapWidget(container, widget);
        return container;
    }

    if (widget->IsOfType<TBInlineSelect>())
    {
        UIInlineSelect* select = new UIInlineSelect(context_, false);
        select->SetWidget(widget);
        WrapWidget(select, widget);
        return select;
    }

    if (widget->IsOfType<TBSlider>())
    {
        UISlider* slider = new UISlider(context_, false);
        slider->SetWidget(widget);
        WrapWidget(slider, widget);
        return slider;
    }

    if (widget->IsOfType<TBScrollBar>())
    {
        UIScrollBar* slider = new UIScrollBar(context_, false);
        slider->SetWidget(widget);
        WrapWidget(slider, widget);
        return slider;
    }

    if (widget->IsOfType<TBColorWidget>())
    {
        UIColorWidget* colorWidget = new UIColorWidget(context_, false);
        colorWidget->SetWidget(widget);
        WrapWidget(colorWidget, widget);
        return colorWidget;
    }

    if (widget->IsOfType<TBColorWheel>())
    {
        UIColorWheel* colorWheel = new UIColorWheel(context_, false);
        colorWheel->SetWidget(widget);
        WrapWidget(colorWheel, widget);
        return colorWheel;
    }

    if (widget->IsOfType<TBSection>())
    {
        UISection* section = new UISection(context_, false);
        section->SetWidget(widget);
        WrapWidget(section, widget);
        return section;
    }

    if (widget->IsOfType<TBSeparator>())
    {
        UISeparator* sep = new UISeparator(context_, false);
        sep->SetWidget(widget);
        WrapWidget(sep, widget);
        return sep;
    }

    if (widget->IsOfType<TBContainer>())
    {
        UIContainer* container = new UIContainer(context_, false);
        container->SetWidget(widget);
        WrapWidget(container, widget);
        return container;
    }

//.........这里部分代码省略.........
开发者ID:abandonrules,项目名称:AtomicGameEngine,代码行数:101,代码来源:UI.cpp


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