本文整理汇总了C++中mygui::Button::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Button::getName方法的具体用法?C++ Button::getName怎么用?C++ Button::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mygui::Button
的用法示例。
在下文中一共展示了Button::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: notifyRotationChange
void SceneObjectPanel::notifyRotationChange(MyGUI::Widget* _sender)
{
if(mPickableObj == nullptr) return;
MyGUI::Button* btn = static_cast<MyGUI::Button*>(_sender);
//TODO: change compare to AnyData injected in the widget later
std::string btnName = btn->getName();
btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());
if(btnName == "BT_ROTATE_Y_LEFT")
{
*mRotateAngleY -= 1;
std::string str = Ogre::StringConverter::toString(*mRotateAngleY);
mEditBoxRotateY->setCaption(str);
}
else if(btnName == "BT_ROTATE_Y_RIGHT")
{
*mRotateAngleY += 1;
std::string str = Ogre::StringConverter::toString(*mRotateAngleY);
mEditBoxRotateY->setCaption(str);
}
mPickableObj->applyOperation(1);
}
示例2: notifyStateChanged
void SceneObjectPanel::notifyStateChanged(MyGUI::Widget* _sender)
{
if(mPickableObj == nullptr) return;
MyGUI::Button *btn = static_cast<MyGUI::Button*>(_sender);
std::string btnName = btn->getName();
btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());
if(btnName == "RB_FIX_XAXIS")
{
*mIsXFixed = !(*mIsXFixed);
btn->setStateSelected((*mIsXFixed));
}
else if(btnName == "RB_FIX_YAXIS")
{
*mIsYFixed = !(*mIsYFixed);
btn->setStateSelected((*mIsYFixed));
}
else
{
*mIsZFixed = !(*mIsZFixed);
btn->setStateSelected((*mIsZFixed));
}
}
示例3: notifyScaleChange
void SceneObjectPanel::notifyScaleChange(MyGUI::Widget* _sender)
{
if(mPickableObj == nullptr) return;
MyGUI::Button* btn = static_cast<MyGUI::Button*>(_sender);
//TODO: change compare to AnyData injected in the widget later
std::string btnName = btn->getName();
btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());
if(btnName == "BT_SCALE_X_RIGHT")
{
mScale->x += 1;
std::string str = Ogre::StringConverter::toString(mScale->x);
mEditBoxScaleX->setCaption(str);
}
else if(btnName == "BT_SCALE_X_LEFT")
{
mScale->x -= 1;
std::string str = Ogre::StringConverter::toString(mScale->x);
mEditBoxScaleX->setCaption(str);
}
else if(btnName == "BT_SCALE_Y_LEFT")
{
mScale->y -= 1;
std::string str = Ogre::StringConverter::toString(mScale->y);
mEditBoxScaleY->setCaption(str);
}
else if(btnName == "BT_SCALE_Y_RIGHT")
{
mScale->y += 1;
std::string str = Ogre::StringConverter::toString(mScale->y);
mEditBoxScaleY->setCaption(str);
}
else if(btnName == "BT_SCALE_Z_LEFT")
{
mScale->z -= 1;
std::string str = Ogre::StringConverter::toString(mScale->z);
mEditBoxScaleZ->setCaption(str);
}
else if(btnName == "BT_SCALE_Z_RIGHT")
{
mScale->z += 1;
std::string str = Ogre::StringConverter::toString(mScale->z);
mEditBoxScaleZ->setCaption(str);
}
mPickableObj->applyOperation(0);
}
示例4: notifyApplyOperation
void SceneObjectPanel::notifyApplyOperation(MyGUI::Widget* _sender)
{
if(mPickableObj == nullptr) return;
MyGUI::Button* btn = static_cast<MyGUI::Button*>(_sender);
//TODO: change compare to AnyData injected in the widget later
std::string btnName = btn->getName();
btnName = btnName.substr(mPrefix.length(),btnName.length() - mPrefix.length());
if(btnName == "BT_APPLY_SCALE")
{
if(mPickableObj != nullptr)
mPickableObj->applyOperation(0);
}
else if(btnName == "BT_APPLY_ROTATE")
{
if(mPickableObj != nullptr)
mPickableObj->applyOperation(1);
}
}
示例5: notifyMouseButtonClick
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;
}
}