mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 18:35:20 +00:00
Merge remote-tracking branch 'riothamus/riothamus-b752'
This commit is contained in:
commit
9fe5ff46cd
@ -18,6 +18,8 @@ namespace MWGui
|
|||||||
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CountDialog::onOkButtonClicked);
|
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CountDialog::onOkButtonClicked);
|
||||||
mItemEdit->eventEditTextChange += MyGUI::newDelegate(this, &CountDialog::onEditTextChange);
|
mItemEdit->eventEditTextChange += MyGUI::newDelegate(this, &CountDialog::onEditTextChange);
|
||||||
mSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &CountDialog::onSliderMoved);
|
mSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &CountDialog::onSliderMoved);
|
||||||
|
// make sure we read the enter key being pressed to accept multiple items
|
||||||
|
mItemEdit->eventEditSelectAccept += MyGUI::newDelegate(this, &CountDialog::onEnterKeyPressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CountDialog::open(const std::string& item, const std::string& message, const int maxCount)
|
void CountDialog::open(const std::string& item, const std::string& message, const int maxCount)
|
||||||
@ -37,6 +39,7 @@ namespace MWGui
|
|||||||
width,
|
width,
|
||||||
mMainWidget->getHeight());
|
mMainWidget->getHeight());
|
||||||
|
|
||||||
|
// by default, the text edit field has the focus of the keyboard
|
||||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mItemEdit);
|
MyGUI::InputManager::getInstance().setKeyFocusWidget(mItemEdit);
|
||||||
|
|
||||||
mSlider->setScrollPosition(maxCount-1);
|
mSlider->setScrollPosition(maxCount-1);
|
||||||
@ -54,7 +57,16 @@ namespace MWGui
|
|||||||
|
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// essentially duplicating what the OK button does if user presses
|
||||||
|
// Enter key
|
||||||
|
void CountDialog::onEnterKeyPressed(MyGUI::EditBox* _sender)
|
||||||
|
{
|
||||||
|
eventOkClicked(NULL, mSlider->getScrollPosition()+1);
|
||||||
|
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
void CountDialog::onEditTextChange(MyGUI::EditBox* _sender)
|
void CountDialog::onEditTextChange(MyGUI::EditBox* _sender)
|
||||||
{
|
{
|
||||||
if (_sender->getCaption() == "")
|
if (_sender->getCaption() == "")
|
||||||
|
@ -25,11 +25,12 @@ namespace MWGui
|
|||||||
MyGUI::TextBox* mLabelText;
|
MyGUI::TextBox* mLabelText;
|
||||||
MyGUI::Button* mOkButton;
|
MyGUI::Button* mOkButton;
|
||||||
MyGUI::Button* mCancelButton;
|
MyGUI::Button* mCancelButton;
|
||||||
|
|
||||||
void onCancelButtonClicked(MyGUI::Widget* _sender);
|
void onCancelButtonClicked(MyGUI::Widget* _sender);
|
||||||
void onOkButtonClicked(MyGUI::Widget* _sender);
|
void onOkButtonClicked(MyGUI::Widget* _sender);
|
||||||
void onEditTextChange(MyGUI::EditBox* _sender);
|
void onEditTextChange(MyGUI::EditBox* _sender);
|
||||||
void onSliderMoved(MyGUI::ScrollBar* _sender, size_t _position);
|
void onSliderMoved(MyGUI::ScrollBar* _sender, size_t _position);
|
||||||
|
void onEnterKeyPressed(MyGUI::EditBox* _sender);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user