Get only text from input fields (bug #4025)

experimental
Andrei Kortunov 7 years ago
parent 8acf0ba633
commit 67d59bead5

@ -64,7 +64,7 @@ namespace MWGui
void AlchemyWindow::onCreateButtonClicked(MyGUI::Widget* _sender) void AlchemyWindow::onCreateButtonClicked(MyGUI::Widget* _sender)
{ {
MWMechanics::Alchemy::Result result = mAlchemy->create (mNameEdit->getCaption ()); MWMechanics::Alchemy::Result result = mAlchemy->create (mNameEdit->getOnlyText());
MWBase::WindowManager *winMgr = MWBase::Environment::get().getWindowManager(); MWBase::WindowManager *winMgr = MWBase::Environment::get().getWindowManager();
switch (result) switch (result)

@ -483,7 +483,7 @@ namespace MWGui
std::string CreateClassDialog::getName() const std::string CreateClassDialog::getName() const
{ {
return mEditName->getCaption(); return mEditName->getOnlyText();
} }
std::string CreateClassDialog::getDescription() const std::string CreateClassDialog::getDescription() const

@ -3,6 +3,7 @@
#include <iomanip> #include <iomanip>
#include <MyGUI_Button.h> #include <MyGUI_Button.h>
#include <MyGUI_EditBox.h>
#include <MyGUI_ScrollView.h> #include <MyGUI_ScrollView.h>
#include <components/widgets/list.hpp> #include <components/widgets/list.hpp>
@ -312,7 +313,7 @@ namespace MWGui
return; return;
} }
if (mName->getCaption ().empty()) if (mName->getOnlyText().empty())
{ {
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}"); MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}");
return; return;
@ -336,7 +337,7 @@ namespace MWGui
return; return;
} }
mEnchanting.setNewItemName(mName->getCaption()); mEnchanting.setNewItemName(mName->getOnlyText());
mEnchanting.setEffect(mEffectList); mEnchanting.setEffect(mEffectList);
MWWorld::Ptr player = MWMechanics::getPlayer(); MWWorld::Ptr player = MWMechanics::getPlayer();

@ -58,7 +58,7 @@ namespace MWGui
MyGUI::Button* mTypeButton; MyGUI::Button* mTypeButton;
MyGUI::Button* mBuyButton; MyGUI::Button* mBuyButton;
MyGUI::TextBox* mName; MyGUI::EditBox* mName;
MyGUI::TextBox* mEnchantmentPoints; MyGUI::TextBox* mEnchantmentPoints;
MyGUI::TextBox* mCastCost; MyGUI::TextBox* mCastCost;
MyGUI::TextBox* mCharge; MyGUI::TextBox* mCharge;

@ -248,7 +248,7 @@ namespace MWGui
dialog->eventCancelClicked.clear(); dialog->eventCancelClicked.clear();
return; return;
} }
if (mSaveNameEdit->getCaption().empty()) if (mSaveNameEdit->getOnlyText().empty())
{ {
MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage65}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sNotifyMessage65}");
return; return;
@ -275,7 +275,7 @@ namespace MWGui
if (mSaving) if (mSaving)
{ {
MWBase::Environment::get().getStateManager()->saveGame (mSaveNameEdit->getCaption(), mCurrentSlot); MWBase::Environment::get().getStateManager()->saveGame (mSaveNameEdit->getOnlyText(), mCurrentSlot);
} }
else else
{ {

@ -373,7 +373,7 @@ namespace MWGui
return; return;
} }
if (mNameEdit->getCaption () == "") if (mNameEdit->getOnlyText() == "")
{ {
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}"); MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage10}");
return; return;
@ -394,7 +394,7 @@ namespace MWGui
return; return;
} }
mSpell.mName = mNameEdit->getCaption(); mSpell.mName = mNameEdit->getOnlyText();
int price = MyGUI::utility::parseInt(mPriceLabel->getCaption()); int price = MyGUI::utility::parseInt(mPriceLabel->getCaption());

@ -53,7 +53,7 @@ namespace MWGui
void TextInputDialog::onOkClicked(MyGUI::Widget* _sender) void TextInputDialog::onOkClicked(MyGUI::Widget* _sender)
{ {
if (mTextEdit->getCaption() == "") if (mTextEdit->getOnlyText() == "")
{ {
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage37}"); MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage37}");
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget (mTextEdit); MWBase::Environment::get().getWindowManager()->setKeyFocusWidget (mTextEdit);
@ -69,7 +69,7 @@ namespace MWGui
std::string TextInputDialog::getTextInput() const std::string TextInputDialog::getTextInput() const
{ {
return mTextEdit->getCaption(); return mTextEdit->getOnlyText();
} }
void TextInputDialog::setTextInput(const std::string &text) void TextInputDialog::setTextInput(const std::string &text)

Loading…
Cancel
Save