mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 21:49:55 +00:00
Get rid of redundant setKeyFocusWidget() method
This commit is contained in:
parent
675be20a0f
commit
faf940546b
27 changed files with 67 additions and 84 deletions
|
@ -289,9 +289,6 @@ namespace MWBase
|
|||
|
||||
virtual const Translation::Storage& getTranslationDataStorage() const = 0;
|
||||
|
||||
/// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
|
||||
virtual void setKeyFocusWidget (MyGUI::Widget* widget) = 0;
|
||||
|
||||
virtual void loadUserFonts() = 0;
|
||||
|
||||
virtual Loading::Listener* getLoadingScreen() = 0;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <MyGUI_EditBox.h>
|
||||
#include <MyGUI_ControllerManager.h>
|
||||
#include <MyGUI_ControllerRepeatClick.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -168,7 +169,7 @@ namespace MWGui
|
|||
|
||||
update();
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mNameEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mNameEdit);
|
||||
}
|
||||
|
||||
void AlchemyWindow::onIngredientSelected(MyGUI::Widget* _sender)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <MyGUI_ImageBox.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_ScrollView.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -71,7 +72,7 @@ namespace MWGui
|
|||
WindowModal::onOpen();
|
||||
updateBirths();
|
||||
updateSpells();
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mBirthList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mBirthList);
|
||||
|
||||
// Show the current birthsign by default
|
||||
const std::string &signId =
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace MWGui
|
|||
|
||||
setTakeButtonShow(showTakeButton);
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCloseButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCloseButton);
|
||||
}
|
||||
|
||||
void BookWindow::setTakeButtonShow(bool show)
|
||||
|
@ -161,9 +161,9 @@ namespace MWGui
|
|||
mPrevPageButton->setVisible(prevPageVisible);
|
||||
|
||||
if (focus == mNextPageButton && !nextPageVisible && prevPageVisible)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mPrevPageButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mPrevPageButton);
|
||||
else if (focus == mPrevPageButton && !prevPageVisible && nextPageVisible)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mNextPageButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mNextPageButton);
|
||||
|
||||
if (mPages.empty())
|
||||
return;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <MyGUI_ImageBox.h>
|
||||
#include <MyGUI_ListBox.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
|
@ -135,7 +136,7 @@ namespace MWGui
|
|||
WindowModal::onOpen ();
|
||||
updateClasses();
|
||||
updateStats();
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mClassList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mClassList);
|
||||
|
||||
// Show the current class by default
|
||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||
|
@ -436,7 +437,7 @@ namespace MWGui
|
|||
getWidget(mEditName, "EditName");
|
||||
|
||||
// Make sure the edit box has focus
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mEditName);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mEditName);
|
||||
|
||||
MyGUI::Button* descriptionButton;
|
||||
getWidget(descriptionButton, "DescriptionButton");
|
||||
|
@ -902,7 +903,7 @@ namespace MWGui
|
|||
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sInputMenu1", ""));
|
||||
|
||||
// Make sure the edit box has focus
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTextEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||
}
|
||||
|
||||
DescriptionDialog::~DescriptionDialog()
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <MyGUI_Button.h>
|
||||
#include <MyGUI_EditBox.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
@ -33,7 +34,7 @@ namespace MWGui
|
|||
|
||||
mMessage->setSize(mMessage->getWidth(), mMessage->getTextSize().height + 24);
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mOkButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mOkButton);
|
||||
|
||||
center();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "console.hpp"
|
||||
|
||||
#include <MyGUI_EditBox.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
|
@ -151,7 +152,7 @@ namespace MWGui
|
|||
{
|
||||
// Give keyboard focus to the combo box whenever the console is
|
||||
// turned on
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCommandLine);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCommandLine);
|
||||
}
|
||||
|
||||
void Console::print(const std::string &msg, const std::string& color)
|
||||
|
@ -447,7 +448,7 @@ namespace MWGui
|
|||
mPtr = object;
|
||||
}
|
||||
// User clicked on an object. Restore focus to the console command line.
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCommandLine);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCommandLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace MWGui
|
|||
mItemView->setModel (mSortModel);
|
||||
mItemView->resetScrollBars();
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCloseButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCloseButton);
|
||||
|
||||
setTitle(container.getClass().getName(container));
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ namespace MWGui
|
|||
if(mDragAndDrop != nullptr && mDragAndDrop->mIsOnDragAndDrop)
|
||||
return;
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCloseButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCloseButton);
|
||||
|
||||
// transfer everything into the player's inventory
|
||||
ItemModel* playerModel = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getModel();
|
||||
|
@ -222,7 +222,7 @@ namespace MWGui
|
|||
{
|
||||
if(mDragAndDrop == nullptr || !mDragAndDrop->mIsOnDragAndDrop)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCloseButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCloseButton);
|
||||
|
||||
onTakeAllButtonClicked(mTakeButton);
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <MyGUI_Button.h>
|
||||
#include <MyGUI_ScrollBar.h>
|
||||
#include <MyGUI_RenderManager.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <components/widgets/numericeditbox.hpp>
|
||||
|
||||
|
@ -47,7 +48,7 @@ namespace MWGui
|
|||
mMainWidget->getHeight());
|
||||
|
||||
// by default, the text edit field has the focus of the keyboard
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mItemEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mItemEdit);
|
||||
|
||||
mSlider->setScrollPosition(maxCount-1);
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <MyGUI_ProgressBar.h>
|
||||
#include <MyGUI_ScrollBar.h>
|
||||
#include <MyGUI_Button.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/widgets/list.hpp>
|
||||
|
@ -380,7 +381,7 @@ namespace MWGui
|
|||
{
|
||||
onTopicActivated(topic);
|
||||
if (mGoodbyeButton->getEnabled())
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mGoodbyeButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mGoodbyeButton);
|
||||
}
|
||||
else if (topic == sPersuasion)
|
||||
mPersuasionDialog.setVisible(true);
|
||||
|
@ -443,7 +444,7 @@ namespace MWGui
|
|||
return;
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mGoodbyeButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mGoodbyeButton);
|
||||
|
||||
setTitle(mPtr.getClass().getName(mPtr));
|
||||
|
||||
|
@ -622,7 +623,7 @@ namespace MWGui
|
|||
bool goodbyeWasEnabled = mGoodbyeButton->getEnabled();
|
||||
mGoodbyeButton->setEnabled(goodbyeEnabled);
|
||||
if (goodbyeEnabled && !goodbyeWasEnabled)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mGoodbyeButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mGoodbyeButton);
|
||||
|
||||
bool topicsEnabled = !MWBase::Environment::get().getDialogueManager()->isInChoice() && !mGoodbye;
|
||||
mTopicsList->setEnabled(topicsEnabled);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <MyGUI_Button.h>
|
||||
#include <MyGUI_ScrollView.h>
|
||||
#include <MyGUI_EditBox.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <components/widgets/list.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
@ -67,7 +68,7 @@ namespace MWGui
|
|||
void EnchantingDialog::onOpen()
|
||||
{
|
||||
center();
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mName);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mName);
|
||||
}
|
||||
|
||||
void EnchantingDialog::setSoulGem(const MWWorld::Ptr &gem)
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace
|
|||
}
|
||||
updateShowingPages();
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(getWidget<MyGUI::Widget>(CloseBTN));
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(getWidget<MyGUI::Widget>(CloseBTN));
|
||||
}
|
||||
|
||||
void onClose()
|
||||
|
@ -377,9 +377,9 @@ namespace
|
|||
prevPageBtn->setVisible(prevPageVisible);
|
||||
|
||||
if (focus == nextPageBtn && !nextPageVisible && prevPageVisible)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(prevPageBtn);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(prevPageBtn);
|
||||
else if (focus == prevPageBtn && !prevPageVisible && nextPageVisible)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nextPageBtn);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(nextPageBtn);
|
||||
|
||||
setVisible (PageOneNum, relPages > 0);
|
||||
setVisible (PageTwoNum, relPages > 1);
|
||||
|
|
|
@ -83,7 +83,7 @@ void KeyboardNavigation::restoreFocus(int mode)
|
|||
{
|
||||
MyGUI::Widget* w = found->second;
|
||||
if (w && w->getVisible() && w->getEnabled())
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(found->second);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(found->second);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ void KeyboardNavigation::onFrame()
|
|||
// workaround incorrect key focus resets (fix in MyGUI TBD)
|
||||
if (!shouldAcceptKeyFocus(focus) && shouldAcceptKeyFocus(mCurrentFocus) && (!mModalWindow || isRootParent(mCurrentFocus, mModalWindow)))
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCurrentFocus);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCurrentFocus);
|
||||
focus = mCurrentFocus;
|
||||
}
|
||||
|
||||
|
@ -154,12 +154,12 @@ void KeyboardNavigation::setDefaultFocus(MyGUI::Widget *window, MyGUI::Widget *d
|
|||
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
|
||||
if (!focus || !shouldAcceptKeyFocus(focus))
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(defaultFocus);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(defaultFocus);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isRootParent(focus, window))
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(defaultFocus);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(defaultFocus);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ bool KeyboardNavigation::switchFocus(int direction, bool wrap)
|
|||
else if (direction == D_Up && (vertdiff >= 0 || !isVertical))
|
||||
return false;
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(keyFocusList[index]);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(keyFocusList[index]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ bool KeyboardNavigation::selectFirstWidget()
|
|||
|
||||
if (!keyFocusList.empty())
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(keyFocusList[0]);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(keyFocusList[0]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <MyGUI_TextBox.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_RenderManager.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <components/widgets/imagebutton.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
@ -67,12 +68,12 @@ namespace MWGui
|
|||
if (isMainMenu)
|
||||
{
|
||||
if (mButtons["loadgame"]->getVisible())
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mButtons["loadgame"]);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mButtons["loadgame"]);
|
||||
else
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mButtons["newgame"]);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mButtons["newgame"]);
|
||||
}
|
||||
else
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mButtons["return"]);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mButtons["return"]);
|
||||
}
|
||||
|
||||
Layout::setVisible (visible);
|
||||
|
|
|
@ -1123,7 +1123,7 @@ namespace MWGui
|
|||
{
|
||||
WindowModal::onOpen();
|
||||
center();
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTextEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||
}
|
||||
|
||||
void EditNoteDialog::onCancelButtonClicked(MyGUI::Widget *sender)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <MyGUI_ListBox.h>
|
||||
#include <MyGUI_ImageBox.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <osg/Texture2D>
|
||||
|
||||
|
@ -165,7 +166,7 @@ namespace MWGui
|
|||
mHeadRotate->setScrollPosition(initialPos);
|
||||
onHeadRotate(mHeadRotate, initialPos);
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mRaceList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mRaceList);
|
||||
}
|
||||
|
||||
void RaceDialog::setRaceId(const std::string &raceId)
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace MWGui
|
|||
MWBase::Environment::get().getStateManager()->deleteGame (mCurrentCharacter, mCurrentSlot);
|
||||
mSaveList->removeItemAt(mSaveList->getIndexSelected());
|
||||
onSlotSelected(mSaveList, mSaveList->getIndexSelected());
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mSaveList);
|
||||
|
||||
if (mSaveList->getItemCount() == 0)
|
||||
{
|
||||
|
@ -114,7 +114,7 @@ namespace MWGui
|
|||
|
||||
void SaveGameDialog::onDeleteSlotCancel()
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mSaveList);
|
||||
}
|
||||
|
||||
void SaveGameDialog::onSaveNameChanged(MyGUI::EditBox *sender)
|
||||
|
@ -138,9 +138,9 @@ namespace MWGui
|
|||
|
||||
mSaveNameEdit->setCaption ("");
|
||||
if (mSaving)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveNameEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mSaveNameEdit);
|
||||
else
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mSaveList);
|
||||
|
||||
center();
|
||||
|
||||
|
@ -244,14 +244,11 @@ namespace MWGui
|
|||
|
||||
void SaveGameDialog::onConfirmationCancel()
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mSaveList);
|
||||
}
|
||||
|
||||
void SaveGameDialog::accept(bool reallySure)
|
||||
{
|
||||
// Remove for MyGUI 3.2.2
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nullptr);
|
||||
|
||||
if (mSaving)
|
||||
{
|
||||
// If overwriting an existing slot, ask for confirmation first
|
||||
|
@ -334,7 +331,7 @@ namespace MWGui
|
|||
void SaveGameDialog::onCharacterAccept(MyGUI::ComboBox* sender, size_t pos)
|
||||
{
|
||||
// Give key focus to save list so we can confirm the selection with Enter
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mSaveList);
|
||||
}
|
||||
|
||||
void SaveGameDialog::fillSaveList()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "scrollwindow.hpp"
|
||||
|
||||
#include <MyGUI_ScrollView.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <components/esm/loadbook.hpp>
|
||||
#include <components/widgets/imagebutton.hpp>
|
||||
|
@ -66,7 +67,7 @@ namespace MWGui
|
|||
|
||||
setTakeButtonShow(showTakeButton);
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCloseButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mCloseButton);
|
||||
}
|
||||
|
||||
void ScrollWindow::onKeyButtonPressed(MyGUI::Widget *sender, MyGUI::KeyCode key, MyGUI::Char character)
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <MyGUI_ScrollView.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_TabControl.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
|
@ -615,7 +616,7 @@ namespace MWGui
|
|||
highlightCurrentResolution();
|
||||
updateControlsBox();
|
||||
resetScrollbars();
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mOkButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mOkButton);
|
||||
}
|
||||
|
||||
void SettingsWindow::onWindowResize(MyGUI::Window *_sender)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <MyGUI_ImageBox.h>
|
||||
#include <MyGUI_Gui.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
#include <components/esm/records.hpp>
|
||||
#include <components/widgets/list.hpp>
|
||||
|
@ -431,7 +432,7 @@ namespace MWGui
|
|||
void SpellCreationDialog::onOpen()
|
||||
{
|
||||
center();
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mNameEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mNameEdit);
|
||||
}
|
||||
|
||||
void SpellCreationDialog::onReferenceUnavailable ()
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace MWGui
|
|||
// Reset the filter focus when opening the window
|
||||
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
|
||||
if (focus == mFilterEdit)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nullptr);
|
||||
MyGUI::InputManager::getInstance().resetKeyFocusWidget();
|
||||
|
||||
updateSpells();
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <MyGUI_EditBox.h>
|
||||
#include <MyGUI_Button.h>
|
||||
#include <MyGUI_InputManager.h>
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
|
@ -23,7 +24,7 @@ namespace MWGui
|
|||
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
|
||||
|
||||
// Make sure the edit box has focus
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTextEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||
}
|
||||
|
||||
void TextInputDialog::setNextButtonShow(bool shown)
|
||||
|
@ -46,7 +47,7 @@ namespace MWGui
|
|||
{
|
||||
WindowModal::onOpen();
|
||||
// Make sure the edit box has focus
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTextEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
@ -56,7 +57,7 @@ namespace MWGui
|
|||
if (mTextEdit->getCaption() == "")
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage37}");
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget (mTextEdit);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||
}
|
||||
else
|
||||
eventDone(this);
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace MWGui
|
|||
|
||||
onFilterChanged(mFilterAll);
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTotalBalance);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTotalBalance);
|
||||
}
|
||||
|
||||
void TradeWindow::onFrame(float dt)
|
||||
|
|
|
@ -93,9 +93,9 @@ namespace MWGui
|
|||
}
|
||||
|
||||
if (mUntilHealedButton->getVisible())
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mUntilHealedButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mUntilHealedButton);
|
||||
else
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mWaitButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mWaitButton);
|
||||
}
|
||||
|
||||
bool WaitDialog::exit()
|
||||
|
@ -222,7 +222,7 @@ namespace MWGui
|
|||
{
|
||||
mHourText->setCaptionWithReplacing (MyGUI::utility::toString(position+1) + " #{sRestMenu2}");
|
||||
mManualHours = position+1;
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mWaitButton);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mWaitButton);
|
||||
}
|
||||
|
||||
void WaitDialog::onKeyButtonPressed(MyGUI::Widget *sender, MyGUI::KeyCode key, MyGUI::Char character)
|
||||
|
|
|
@ -55,18 +55,6 @@ void WindowBase::setVisible(bool visible)
|
|||
onOpen();
|
||||
else if (wasVisible)
|
||||
onClose();
|
||||
|
||||
// This is needed as invisible widgets can retain key focus.
|
||||
// Remove for MyGUI 3.2.2
|
||||
if (!visible)
|
||||
{
|
||||
MyGUI::Widget* keyFocus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
|
||||
while (keyFocus != mMainWidget && keyFocus != nullptr)
|
||||
keyFocus = keyFocus->getParent();
|
||||
|
||||
if (keyFocus == mMainWidget)
|
||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
bool WindowBase::isVisible()
|
||||
|
|
|
@ -698,7 +698,7 @@ namespace MWGui
|
|||
setCursorVisible(!gameMode);
|
||||
|
||||
if (gameMode)
|
||||
setKeyFocusWidget (nullptr);
|
||||
MyGUI::InputManager::getInstance().resetKeyFocusWidget();
|
||||
|
||||
// Icons of forced hidden windows are displayed
|
||||
setMinimapVisibility((mAllowed & GW_Map) && (!mMap->pinned() || (mForceHidden & GW_Map)));
|
||||
|
@ -1670,16 +1670,6 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
// Remove this method for MyGUI 3.2.2
|
||||
void WindowManager::setKeyFocusWidget(MyGUI::Widget *widget)
|
||||
{
|
||||
if (widget == nullptr)
|
||||
MyGUI::InputManager::getInstance().resetKeyFocusWidget();
|
||||
else
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(widget);
|
||||
onKeyFocusChanged(widget);
|
||||
}
|
||||
|
||||
void WindowManager::onKeyFocusChanged(MyGUI::Widget *widget)
|
||||
{
|
||||
if (widget && widget->castType<MyGUI::EditBox>(false))
|
||||
|
@ -1872,7 +1862,7 @@ namespace MWGui
|
|||
sizeVideo(screenSize.width, screenSize.height);
|
||||
|
||||
MyGUI::Widget* oldKeyFocus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
|
||||
setKeyFocusWidget(mVideoWidget);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mVideoWidget);
|
||||
|
||||
mVideoBackground->setVisible(true);
|
||||
|
||||
|
@ -1910,7 +1900,7 @@ namespace MWGui
|
|||
|
||||
MWBase::Environment::get().getSoundManager()->resumeSounds();
|
||||
|
||||
setKeyFocusWidget(oldKeyFocus);
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(oldKeyFocus);
|
||||
|
||||
setCursorVisible(cursorWasVisible);
|
||||
|
||||
|
|
|
@ -147,9 +147,6 @@ namespace MWGui
|
|||
/// (and will continually update the window while doing so)
|
||||
virtual void playVideo(const std::string& name, bool allowSkipping);
|
||||
|
||||
/// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
|
||||
virtual void setKeyFocusWidget (MyGUI::Widget* widget);
|
||||
|
||||
virtual void setNewGame(bool newgame);
|
||||
|
||||
virtual void pushGuiMode(GuiMode mode, const MWWorld::Ptr& arg);
|
||||
|
|
Loading…
Reference in a new issue