//----------------------------------------------------------------------------------- bool ItemSelectorViewManager::handleCheckStateChanged(const CEGUI::EventArgs& e) { // activate controller if set if (mItemSelectorController) { CEGUI::Checkbox* checkbox = static_cast<CEGUI::Checkbox*>( static_cast<const CEGUI::WindowEventArgs&>(e).window); mItemSelectorController->itemStateChanged(checkbox->getID(), checkbox->isSelected()); float selectColour = checkbox->isSelected() ? 0.0f : 1.0f; checkbox->setProperty("NormalTextColour", CEGUI::PropertyHelper::colourToString(CEGUI::colour(selectColour, 1.0f, selectColour))); } return true; }
_MEMBER_FUNCTION_IMPL(GUICheckBox, isChecked) { CEGUI::Checkbox * pWindow = sq_getinstance<CEGUI::Checkbox *>(pVM); if(!pWindow) { sq_pushbool(pVM, false); return 1; } sq_pushbool(pVM, pWindow->isSelected()); return 1; }
bool OgreSample13App::handleCheckboxs(const CEGUI::EventArgs & args) { CEGUI::Checkbox * cb = static_cast<CEGUI::Checkbox *>(static_cast<const CEGUI::WindowEventArgs&>(args).window); if (cb->getName() == CEGUI::String("OgreSample13/checkbox2")) { if (cb->isSelected()) { mSceneMgr->setShadowTechnique(SHADOWTYPE_TEXTURE_MODULATIVE); mSceneMgr->setShadowFarDistance(1000.0f); } else { mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE); } } else { CompositorManager::getSingleton().setCompositorEnabled(mCameraMan->getCamera()->getViewport(),"Bloom",cb->isSelected()); } return true; }
/*********************************************************** handle connect button event ***********************************************************/ bool LoginGUI::HandleConnect(const CEGUI::EventArgs& e) { try { CEGUI::WindowManager::getSingleton().getWindow("DisplayLoginErrorFrame")->hide(); CEGUI::Editbox * lt = static_cast<CEGUI::Editbox *> ( CEGUI::WindowManager::getSingleton().getWindow("LoginText")); CEGUI::Editbox * pt = static_cast<CEGUI::Editbox *> ( CEGUI::WindowManager::getSingleton().getWindow("PasswordText")); CEGUI::Checkbox * cbl = static_cast<CEGUI::Checkbox *> ( CEGUI::WindowManager::getSingleton().getWindow("LoginPlayLocalCb")); if(lt && pt && cbl) { bool seleplaylo = cbl->isSelected(); std::string txtl = lt->getText().c_str(); std::string txtt = pt->getText().c_str(); if((txtl != "") && (txtl.size() <= 20) && (txtt.size() <= 20)) { std::string samples = "Data/Samples/lba2launcherblob.wav"; MusicHandler::getInstance()->PlaySample(samples, 0); ConfigurationManager::GetInstance()->SetString("Player.Name", txtl); pt->setText(""); ThreadSafeWorkpile::getInstance()->AddEvent(new LoginEvent(txtl, txtt, seleplaylo)); } } } catch(CEGUI::Exception &ex) { LogHandler::getInstance()->LogToFile(std::string("Exception trying to get connection info from the gui: ") + ex.getMessage().c_str()); return false; } return true; }