void vis_settings_panel_impl::set_light(bool on) { CEGUI::GUIContext& context = CEGUI::System::getSingleton().getDefaultGUIContext(); CEGUI::Window* root = context.getRootWindow(); if (root->isChild(setting_dlg + "/Settings/chkLights")) { ToggleButton* button = static_cast<ToggleButton*>(root->getChild(setting_dlg + "/Settings/chkLights")); return button->setSelected(on); } }
void onCapture() { if (m_start.isSelected()) { m_start.setText(L"Start"); m_start.setSelected(false); } else { m_webcam.setDriver(m_driver.getSelectedItem()); } m_webcam.capture(); }
/************************************************************************* Creates a checkbox to let the user choose to display randomised or real FPS value *************************************************************************/ void CustomShapesDrawingSample::createCheckboxShowRealFPS() { WindowManager& winMgr = WindowManager::getSingleton(); // We create a button and subscribe to its click events ToggleButton* checkboxShowRealFPS = static_cast<CEGUI::ToggleButton*>(winMgr.createWindow("WindowsLook/Checkbox")); checkboxShowRealFPS->setSize(CEGUI::USize(cegui_reldim(0.25f), cegui_reldim(0.035f))); checkboxShowRealFPS->setHorizontalAlignment(HA_CENTRE); checkboxShowRealFPS->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.13f))); checkboxShowRealFPS->setText("Show randomly generated FPS values"); checkboxShowRealFPS->subscribeEvent(ToggleButton::EventSelectStateChanged, Event::Subscriber(&CustomShapesDrawingSample::handleToggleButtonShowRandomisedFpsSelectionChanged, this)); checkboxShowRealFPS->setSelected(true); d_root->addChild(checkboxShowRealFPS); }