示例#1
0
/*BOOL型数据改变 Check
*/
static void _simpleDataCheckChange(MyGUI::Widget* _sender){
	MyGUI::Button* sender = _sender->castType<MyGUI::Button>(false);
	if( sender ){
		SimpleData* psd = sender->getUserData<SimpleData>(false);
		sender->setStateSelected(!sender->getStateSelected());
		if( psd ){
			if( psd->type==SimpleData::BOOL ){
				psd->b = sender->getStateSelected();
			}
			if( psd->change )
				psd->change->invoke(psd);
		}
	}
}
void RigEditorCommands2Panel::CallbackClick_NeedsEngineChekckbox(MyGUI::Widget* sender)
{
	// Clear "mixed values" state
	m_needs_engine_checkbox->setTextColour(m_text_color_default);
	m_data.SetNeedsEngineIsUniform(true);

	// Update data
	MyGUI::Button* button = sender->castType<MyGUI::Button>();
	m_data.SetBoolNeedsEngine(button->getStateSelected());
}
	void KeyboardPanel::notifyMouseButtonClick(MyGUI::Widget* _sender)
	{
		MyGUI::Button* button = _sender->castType<MyGUI::Button>();
		bool selected = button->getStateSelected();
		if (selected)
		{
			button->setStateSelected(false);
			CommandManager::getInstance().execiteCommand("KeyboardClick", std::string(mMainWidget->getUserString("Command")));
		}
		else
		{
			mButtonEngine->setStateSelected(false);
			mButtonGun->setStateSelected(false);
			mButtonAmmo->setStateSelected(false);
			mButtonArmor->setStateSelected(false);
			button->setStateSelected(true);
			CommandManager::getInstance().execiteCommand("KeyboardClick", std::string(button->getUserString("Command")));
		}
	}
示例#4
0
    void PropertyGridManager::onMyGUIMouseButtonClickForCheckboxToggle(MyGUI::Widget *button)
    {
        MyGUI::Button *checkbox = button->castType<MyGUI::Button>();

        PropertyGridProperty *const property = *(button->getUserData<PropertyGridProperty *>());

        if(nullptr == property)
        {
            Debug::error(STEEL_METH_INTRO, "no property linked to control ", button->getParent()).endl().breakHere();
            return;
        }

        bool const currentState = checkbox->getStateSelected();

        if(PropertyGridPropertyValueType::Bool == property->valueType())
            property->write(!currentState);
        else
            Debug::error(STEEL_METH_INTRO, "got a checkbox event for property ", *property, ". Skipping event.").endl();
    }
示例#5
0
void CameraPanel::notifyMouseButtonClick(MyGUI::Widget* _sender)
{
	MyGUI::Button* button = _sender->castType<MyGUI::Button>();
	bool pressed = button->getStateSelected();
	
	if(!pressed)
	{
		mBtnFixed->setStateSelected(false);
		mBtnManipulable->setStateSelected(false);
		mBtnTracking->setStateSelected(false);
		button->setStateSelected(!pressed);
		
		std::string btName = button->getName();
 		if(btName == "RBCamFixed")
			mCamMode = 0;
		else if(btName == "RBCamFixed")
			mCamMode = 1;
		else 
			mCamMode = 2;
	}
}
	void SettingsGeneralControl::notifyMouseButtonClick(MyGUI::Widget* _sender)
	{
		MyGUI::Button* button = _sender->castType<MyGUI::Button>(false);
		if (button != nullptr)
			button->setStateSelected(!button->getStateSelected());
	}