本文整理汇总了C++中UICheckBox类的典型用法代码示例。如果您正苦于以下问题:C++ UICheckBox类的具体用法?C++ UICheckBox怎么用?C++ UICheckBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UICheckBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
示例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;
}
示例3: UICheckBox
UICheckBox* UICheckBox::create()
{
UICheckBox* widget = new UICheckBox();
if (widget && widget->init())
{
return widget;
}
CC_SAFE_DELETE(widget);
return NULL;
}
示例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_);
}
}
示例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_);
}
}
示例6: CtrlCameraHandler
void GlobalIlluminationApp::CtrlCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
示例7: CtrlCameraHandler
void CascadedShadowMapApp::CtrlCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
示例8: FPSCameraHandler
void PostProcessingApp::FPSCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
示例9: CtrlCameraHandler
void DeferredRenderingApp::CtrlCameraHandler(UICheckBox const & sender)
{
if (sender.GetChecked())
{
fpcController_.AttachCamera(this->ActiveCamera());
}
else
{
fpcController_.DetachCamera();
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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_);
}
}
}
示例14: ColorGradingHandler
void GlobalIlluminationApp::ColorGradingHandler(UICheckBox const & sender)
{
Context::Instance().RenderFactoryInstance().RenderEngineInstance().ColorGradingEnabled(sender.GetChecked());
}
示例15: AAHandler
void GlobalIlluminationApp::AAHandler(UICheckBox const & sender)
{
Context::Instance().RenderFactoryInstance().RenderEngineInstance().PPAAEnabled(sender.GetChecked() ? 1 : 0);
}