本文整理汇总了C++中UICheckBox类的典型用法代码示例。如果您正苦于以下问题:C++ UICheckBox类的具体用法?C++ UICheckBox怎么用?C++ UICheckBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UICheckBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: lua_cocos2dx_UICheckBox_addEventListenerCheckBox
static int lua_cocos2dx_UICheckBox_addEventListenerCheckBox(lua_State* L)
{
if (nullptr == L)
return 0;
int argc = 0;
UICheckBox* self = nullptr;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
if (!tolua_isusertype(L,1,"UICheckBox",0,&tolua_err)) goto tolua_lerror;
#endif
self = static_cast<UICheckBox*>(tolua_tousertype(L,1,0));
#if COCOS2D_DEBUG >= 1
if (nullptr == self) {
tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UICheckBox_addEventListenerCheckBox'\n", NULL);
return 0;
}
#endif
argc = lua_gettop(L) - 1;
if (1 == argc)
{
#if COCOS2D_DEBUG >= 1
if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err))
{
goto tolua_lerror;
}
#endif
LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();
if (nullptr == listener)
{
tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL);
return 0;
}
LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0));
ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::EVENT_LISTENER);
self->setUserObject(listener);
self->addEventListenerCheckBox(listener, checkboxselectedeventselector(LuaCocoStudioEventListener::eventCallbackFunc));
return 0;
}
CCLOG("'addEventListenerCheckBox' function of UICheckBox has wrong number of arguments: %d, was expecting %d\n", argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1
tolua_lerror:
tolua_error(L,"#ferror in function 'addEventListenerCheckBox'.",&tolua_err);
return 0;
#endif
}
开发者ID:CryQ,项目名称:coclua,代码行数:56,代码来源:lua_cocos2dx_coco_studio_manual.cpp
示例2: UICheckBox
UICheckBox* UIFactory::createCheckBox(vec2 pos, float rot, vec2 scale, const char* filename, UIController* uiController){
UICheckBox* checkbox = new UICheckBox(filename, uiController);
//Creo un estado externo
UIState* externalState = UIFactory::createState(pos, rot, scale, 1.0f, NULL);
//Informo que debe destruirse el estado luego de efectuar una transicion
externalState->setDestroyedAfterTransition(true);
//Asigno el estado
checkbox->getExternalState()->makeStateTransition(externalState);
return checkbox;
}
开发者ID:MarcoLotto,项目名称:ScaenaFramework,代码行数:10,代码来源:UIFactory.cpp
示例3: UICheckBox
UICheckBox* UICheckBox::create()
{
UICheckBox* widget = new UICheckBox();
if (widget && widget->init())
{
return widget;
}
CC_SAFE_DELETE(widget);
return NULL;
}
开发者ID:huangchonghai,项目名称:Cocos2d-x-For-CocoStudio,代码行数:10,代码来源:UICheckBox.cpp
示例4: HDRHandler
void DeferredRenderingApp::HDRHandler(UICheckBox const & sender)
{
if (DeferredRenderingLayer::DT_Final == buffer_type_)
{
hdr_enabled_ = sender.GetChecked();
RenderEngine& re = Context::Instance().RenderFactoryInstance().RenderEngineInstance();
re.HDREnabled(hdr_enabled_);
}
}
开发者ID:Chenmxs,项目名称:KlayGE,代码行数:9,代码来源:DeferredRendering.cpp
示例5: AntiAliasHandler
void DeferredRenderingApp::AntiAliasHandler(UICheckBox const & sender)
{
if (DeferredRenderingLayer::DT_Final == buffer_type_)
{
anti_alias_enabled_ = sender.GetChecked();
RenderEngine& re = Context::Instance().RenderFactoryInstance().RenderEngineInstance();
re.PPAAEnabled(anti_alias_enabled_);
}
}
开发者ID:Chenmxs,项目名称:KlayGE,代码行数:9,代码来源:DeferredRendering.cpp
示例6: CtrlCameraHandler
void GlobalIlluminationApp::CtrlCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
开发者ID:xdzj,项目名称:KlayGE,代码行数:11,代码来源:GlobalIllumination.cpp
示例7: CtrlCameraHandler
void CascadedShadowMapApp::CtrlCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
开发者ID:BitYorkie,项目名称:KlayGE,代码行数:11,代码来源:CascadedShadowMap.cpp
示例8: FPSCameraHandler
void PostProcessingApp::FPSCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
开发者ID:,项目名称:,代码行数:11,代码来源:
示例9: CtrlCameraHandler
void DeferredRenderingApp::CtrlCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
开发者ID:Chenmxs,项目名称:KlayGE,代码行数:11,代码来源:DeferredRendering.cpp
示例10:
void SoundApp::Music2Handler(UICheckBox const & sender)
{
AudioFactory& af = Context::Instance().AudioFactoryInstance();
AudioEngine& ae = af.AudioEngineInstance();
if (sender.GetChecked())
{
ae.Play(2, true);
}
else
{
ae.Stop(2);
}
}
开发者ID:zsnake1209,项目名称:KlayGE,代码行数:13,代码来源:Sound.cpp
示例11: UICheckBox
UICheckBox *LandscapeToolsPanel::CreateCkeckbox(const Rect &rect, const WideString &text)
{
UICheckBox *checkbox = new UICheckBox("~res:/Gfx/UI/chekBox", rect);
checkbox->SetDelegate(this);
AddControl(checkbox);
Rect textRect;
textRect.x = rect.x + rect.dx + OFFSET;
textRect.y = rect.y;
textRect.dx = TEXT_WIDTH;
textRect.dy = rect.dy;
UIStaticText *textControl = new UIStaticText(textRect);
textControl->SetText(text);
textControl->SetFont(ControlsFactory::GetFont12());
textControl->SetTextColor(ControlsFactory::GetColorLight());
textControl->SetAlign(ALIGN_VCENTER | ALIGN_LEFT);
AddControl(textControl);
SafeRelease(textControl);
return checkbox;
}
开发者ID:,项目名称:,代码行数:22,代码来源:
示例12: TessellationOnHandler
void TessellationApp::TessellationOnHandler(UICheckBox const & sender)
{
bool enabled = sender.GetChecked();
checked_pointer_cast<TriangleObject>(polygon_)->TessEnabled(enabled);
dialog_->Control<UIStatic>(id_edge0_static_)->SetEnabled(enabled);
dialog_->Control<UISlider>(id_edge0_slider_)->SetEnabled(enabled);
dialog_->Control<UIStatic>(id_edge1_static_)->SetEnabled(enabled);
dialog_->Control<UISlider>(id_edge1_slider_)->SetEnabled(enabled);
dialog_->Control<UIStatic>(id_edge2_static_)->SetEnabled(enabled);
dialog_->Control<UISlider>(id_edge2_slider_)->SetEnabled(enabled);
dialog_->Control<UIStatic>(id_inside_static_)->SetEnabled(enabled);
dialog_->Control<UISlider>(id_inside_slider_)->SetEnabled(enabled);
}
开发者ID:iankona,项目名称:KlayGE,代码行数:15,代码来源:Tessellation.cpp
示例13: SSVOHandler
void DeferredRenderingApp::SSVOHandler(UICheckBox const & sender)
{
if ((DeferredRenderingLayer::DT_Final == buffer_type_) || (DeferredRenderingLayer::DT_SSVO == buffer_type_))
{
ssvo_enabled_ = sender.GetChecked();
deferred_rendering_->SSVOEnabled(0, ssvo_enabled_);
RenderEngine& re = Context::Instance().RenderFactoryInstance().RenderEngineInstance();
if (DeferredRenderingLayer::DT_SSVO == buffer_type_)
{
re.HDREnabled(false);
}
else
{
re.HDREnabled(hdr_enabled_);
}
}
}
开发者ID:Chenmxs,项目名称:KlayGE,代码行数:17,代码来源:DeferredRendering.cpp
示例14: ColorGradingHandler
void GlobalIlluminationApp::ColorGradingHandler(UICheckBox const & sender)
{
Context::Instance().RenderFactoryInstance().RenderEngineInstance().ColorGradingEnabled(sender.GetChecked());
}
开发者ID:xdzj,项目名称:KlayGE,代码行数:4,代码来源:GlobalIllumination.cpp
示例15: AAHandler
void GlobalIlluminationApp::AAHandler(UICheckBox const & sender)
{
Context::Instance().RenderFactoryInstance().RenderEngineInstance().PPAAEnabled(sender.GetChecked() ? 1 : 0);
}
开发者ID:xdzj,项目名称:KlayGE,代码行数:4,代码来源:GlobalIllumination.cpp
示例16: SSVOHandler
void GlobalIlluminationApp::SSVOHandler(UICheckBox const & sender)
{
deferred_rendering_->SSVOEnabled(0, sender.GetChecked());
}
开发者ID:xdzj,项目名称:KlayGE,代码行数:4,代码来源:GlobalIllumination.cpp
示例17: ColorMapHandler
void RasterizationOrderApp::ColorMapHandler(UICheckBox const & sender)
{
checked_pointer_cast<RenderQuad>(render_quad_)->ColorMapOn(sender.GetChecked());
}
开发者ID:zsnake1209,项目名称:KlayGE,代码行数:4,代码来源:RasterizationOrder.cpp
示例18: UIPopupWindow
//.........这里部分代码省略.........
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);
widgetWrap_[widget] = editfield;
return editfield;
}
if (widget->IsOfType<TBSkinImage>())
{
UISkinImage* skinimage = new UISkinImage(context_, "", false);
skinimage->SetWidget(widget);
widgetWrap_[widget] = skinimage;
return skinimage;
}
if (widget->IsOfType<TBImageWidget>())
{
UIImageWidget* imagewidget = new UIImageWidget(context_, false);
imagewidget->SetWidget(widget);
widgetWrap_[widget] = imagewidget;
return imagewidget;
}
if (widget->IsOfType<TBClickLabel>())
{
UIClickLabel* nwidget = new UIClickLabel(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBCheckBox>())
{
UICheckBox* nwidget = new UICheckBox(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBSelectList>())
{
UISelectList* nwidget = new UISelectList(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBMessageWindow>())
{
UIMessageWindow* nwidget = new UIMessageWindow(context_, NULL, "", false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBTabContainer>())
{
UITabContainer* nwidget = new UITabContainer(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<SceneViewWidget>())
{
UISceneView* nwidget = new UISceneView(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
if (widget->IsOfType<TBLayout>())
{
UILayout* layout = new UILayout(context_, (UI_AXIS) widget->GetAxis(), false);
layout->SetWidget(widget);
widgetWrap_[widget] = layout;
return layout;
}
if (widget->IsOfType<TBWidget>())
{
UIWidget* nwidget = new UIWidget(context_, false);
nwidget->SetWidget(widget);
widgetWrap_[widget] = nwidget;
return nwidget;
}
return 0;
}
开发者ID:marynate,项目名称:AtomicGameEngine,代码行数:101,代码来源:UI.cpp
示例19: UIPopupWindow
//.........这里部分代码省略.........
if (widget->IsOfType<TBEditField>())
{
UIEditField* editfield = new UIEditField(context_, false);
editfield->SetWidget(widget);
WrapWidget(editfield, widget);
return editfield;
}
if (widget->IsOfType<TBSkinImage>())
{
UISkinImage* skinimage = new UISkinImage(context_, "", false);
skinimage->SetWidget(widget);
WrapWidget(skinimage, widget);
return skinimage;
}
if (widget->IsOfType<TBImageWidget>())
{
UIImageWidget* imagewidget = new UIImageWidget(context_, false);
imagewidget->SetWidget(widget);
WrapWidget(imagewidget, widget);
return imagewidget;
}
if (widget->IsOfType<TBClickLabel>())
{
UIClickLabel* nwidget = new UIClickLabel(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBCheckBox>())
{
UICheckBox* nwidget = new UICheckBox(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBRadioButton>())
{
UIRadioButton* nwidget = new UIRadioButton(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBBarGraph>())
{
UIBargraph* nwidget = new UIBargraph(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBSelectList>())
{
UISelectList* nwidget = new UISelectList(context_, false);
nwidget->SetWidget(widget);
WrapWidget(nwidget, widget);
return nwidget;
}
if (widget->IsOfType<TBMessageWindow>())
{
UIMessageWindow* nwidget = new UIMessageWindow(context_, NULL, "", false);
开发者ID:abandonrules,项目名称:AtomicGameEngine,代码行数:67,代码来源:UI.cpp
示例20: PolycodeEditor
PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectManager) : PolycodeEditor(true){
this->projectManager = projectManager;
Config *conf = CoreServices::getInstance()->getConfig();
String fontName = conf->getStringValue("Polycode", "uiDefaultFontName");
int fontSize = conf->getNumericValue("Polycode", "uiDefaultFontSize");
Number padding = conf->getNumericValue("Polycode", "uiWindowSkinPadding");
headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10);
addChild(headerBg);
headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT);
headerBg->setColor(0.1, 0.1, 0.1, 1.0);
ScreenLabel *label = new ScreenLabel("PROJECT SETTINGS", 22, "section", Label::ANTIALIAS_FULL);
label->color.a = 0.4;
addChild(label);
label->setPosition(10, 0);
moduleSettingsWindow = new UIElement();
moduleSettingsWindow->setPosition(350,10);
addChild(moduleSettingsWindow);
Number lastYPos = 40;
label = new ScreenLabel("PROJECT MODULES", 22, "section", Label::ANTIALIAS_FULL);
label->color.a = 0.4;
moduleSettingsWindow->addChild(label);
label->setPosition(0, lastYPos);
lastYPos += 40;
String polycodeBasePath = CoreServices::getInstance()->getCore()->getDefaultWorkingDirectory();
std::vector<OSFileEntry> moduleFolders = OSBasics::parseFolder(polycodeBasePath+"/Standalone/Modules", false);
for(int i=0; i < moduleFolders.size(); i++) {
OSFileEntry entry = moduleFolders[i];
if(entry.type == OSFileEntry::TYPE_FOLDER) {
UICheckBox *moduleCheckBox = new UICheckBox(entry.name, false);
moduleCheckBox->setPosition(0, lastYPos);
lastYPos += moduleCheckBox->getHeight() + 5;
moduleSettingsWindow->addChild(moduleCheckBox);
moduleCheckboxes.push_back(moduleCheckBox);
}
}
lastYPos += 20;
label = new ScreenLabel("PROJECT FONTS", 22, "section", Label::ANTIALIAS_FULL);
label->color.a = 0.4;
moduleSettingsWindow->addChild(label);
label->setPosition(0, lastYPos);
lastYPos += 30;
fontEntryBase = new UIElement();
moduleSettingsWindow->addChild(fontEntryBase);
fontEntryBase->setPosition(0, lastYPos);
addFontButton = new UIButton("Add Font", 100);
fontEntryBase->addChild(addFontButton);
addFontButton->addEventListener(this, UIEvent::CLICK_EVENT);
mainSettingsWindow = new UIElement();
mainSettingsWindow->setPosition(0,10);
addChild(mainSettingsWindow);
ScreenLabel *label2 = new ScreenLabel(L"DEFAULT VIDEO OPTIONS", 22, "section", Label::ANTIALIAS_FULL);
label2->setColor(1.0, 1.0, 1.0, 0.4);
mainSettingsWindow->addChild(label2);
label2->setPosition(padding, 40);
label2 = new ScreenLabel(L"Width:", fontSize, fontName, Label::ANTIALIAS_FULL);
mainSettingsWindow->addChild(label2);
label2->setPosition(padding, 80);
defaultWidthInput = new UITextInput(false, 60, 12);
mainSettingsWindow->addChild(defaultWidthInput);
defaultWidthInput->setPosition(label2->getPosition().x, label2->getPosition().y+18);
defaultWidthInput->setNumberOnly(true);
label2 = new ScreenLabel(L"Height:", fontSize, fontName, Label::ANTIALIAS_FULL);
mainSettingsWindow->addChild(label2);
label2->setPosition(padding + 80, 80);
defaultHeightInput = new UITextInput(false, 60, 12);
mainSettingsWindow->addChild(defaultHeightInput);
defaultHeightInput->setPosition(label2->getPosition().x, label2->getPosition().y+18);
defaultHeightInput->setNumberOnly(true);
label2 = new ScreenLabel(L"Anti-aliasing:", fontSize, fontName, Label::ANTIALIAS_FULL);
mainSettingsWindow->addChild(label2);
label2->setPosition(padding + 160, 80);
//.........这里部分代码省略.........
开发者ID:baumicon,项目名称:Polycode,代码行数:101,代码来源:PolycodeProjectEditor.cpp
注:本文中的UICheckBox类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论