本文整理汇总了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);
//.........这里部分代码省略.........
示例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;
}
//.........这里部分代码省略.........