Rename WindowBase's open/close to onOpen/onClose

new-script-api
scrawl 7 years ago
parent 5482ad0482
commit 01391b7eed

@ -101,7 +101,7 @@ namespace MWGui
update();
}
void AlchemyWindow::open()
void AlchemyWindow::onOpen()
{
mAlchemy->setAlchemist (MWMechanics::getPlayer());

@ -24,7 +24,7 @@ namespace MWGui
public:
AlchemyWindow();
virtual void open();
virtual void onOpen();
virtual void exit();
private:

@ -64,9 +64,9 @@ namespace MWGui
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
void BirthDialog::open()
void BirthDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
updateBirths();
updateSpells();
}

@ -20,7 +20,7 @@ namespace MWGui
void setBirthId(const std::string &raceId);
void setNextButtonShow(bool shown);
virtual void open();
virtual void onOpen();
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;

@ -125,9 +125,9 @@ namespace MWGui
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
void PickClassDialog::open()
void PickClassDialog::onOpen()
{
WindowModal::open ();
WindowModal::onOpen ();
updateClasses();
updateStats();
}
@ -341,9 +341,9 @@ namespace MWGui
}
}
void InfoBoxDialog::open()
void InfoBoxDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
// Fix layout
layoutVertically(mTextBox, 4);
layoutVertically(mButtonBar, 6);

@ -21,7 +21,7 @@ namespace MWGui
std::string getText() const;
void setButtons(ButtonList &buttons);
virtual void open();
virtual void onOpen();
// Events
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
@ -100,7 +100,7 @@ namespace MWGui
void setClassId(const std::string &classId);
void setNextButtonShow(bool shown);
virtual void open();
virtual void onOpen();
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;

@ -145,14 +145,14 @@ namespace MWGui
mCompilerContext.setExtensions (&mExtensions);
}
void Console::open()
void Console::onOpen()
{
// Give keyboard focus to the combo box whenever the console is
// turned on
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCommandLine);
}
void Console::close()
void Console::onClose()
{
// Apparently, hidden widgets can retain key focus
// Remove for MyGUI 3.2.2

@ -39,8 +39,8 @@ namespace MWGui
Console(int w, int h, bool consoleOnlyScripts);
virtual void open();
virtual void close();
virtual void onOpen();
virtual void onClose();
virtual void exit();

@ -172,9 +172,9 @@ namespace MWGui
mSortModel = NULL;
}
void ContainerWindow::close()
void ContainerWindow::onClose()
{
WindowBase::close();
WindowBase::onClose();
if (dynamic_cast<PickpocketItemModel*>(mModel)
// Make sure we were actually closed, rather than just temporarily hidden (e.g. console or main menu opened)

@ -34,7 +34,7 @@ namespace MWGui
ContainerWindow(DragAndDrop* dragAndDrop);
void openContainer(const MWWorld::Ptr& container, bool loot=false);
virtual void close();
virtual void onClose();
virtual void resetReference();

@ -73,9 +73,9 @@ namespace MWGui
setVisible(false);
}
void PersuasionDialog::open()
void PersuasionDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
center();
MWWorld::Ptr player = MWMechanics::getPlayer();

@ -28,7 +28,7 @@ namespace MWGui
public:
PersuasionDialog();
virtual void open();
virtual void onOpen();
virtual void exit();
private:

@ -60,7 +60,7 @@ namespace MWGui
delete mItemSelectionDialog;
}
void EnchantingDialog::open()
void EnchantingDialog::onOpen()
{
center();
}

@ -19,7 +19,7 @@ namespace MWGui
EnchantingDialog();
virtual ~EnchantingDialog();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -363,7 +363,7 @@ namespace MWGui
dirtyPreview();
}
void InventoryWindow::open()
void InventoryWindow::onOpen()
{
if (!mPtr.isEmpty())
{

@ -35,7 +35,7 @@ namespace MWGui
public:
InventoryWindow(DragAndDrop* dragAndDrop, osg::Group* parent, Resource::ResourceSystem* resourceSystem);
virtual void open();
virtual void onOpen();
/// start trading, disables item drag&drop
void setTrading(bool trading);

@ -211,7 +211,7 @@ namespace
button->setPosition(button->getPosition() + MyGUI::IntPoint(diff.width,0));
}
void open()
void onOpen()
{
if (!MWBase::Environment::get().getWindowManager ()->getJournalAllowed ())
{
@ -240,7 +240,7 @@ namespace
updateShowingPages();
}
void close()
void onClose()
{
mModel->unload ();

@ -128,7 +128,7 @@ namespace MWGui
setAttributeValues();
}
void LevelupDialog::open()
void LevelupDialog::onOpen()
{
MWBase::World *world = MWBase::Environment::get().getWorld();
MWWorld::Ptr player = world->getPlayerPtr();

@ -11,7 +11,7 @@ namespace MWGui
public:
LevelupDialog();
virtual void open();
virtual void onOpen();
private:
MyGUI::Button* mOkButton;

@ -943,7 +943,7 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->toggleVisible(GW_Map);
}
void MapWindow::open()
void MapWindow::onOpen()
{
ensureGlobalMapLoaded();
@ -1107,9 +1107,9 @@ namespace MWGui
return MyGUI::TextIterator::getOnlyText(mTextEdit->getCaption());
}
void EditNoteDialog::open()
void EditNoteDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
center();
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTextEdit);
}

@ -169,7 +169,7 @@ namespace MWGui
public:
EditNoteDialog();
virtual void open();
virtual void onOpen();
virtual void exit();
void showDeleteButton(bool show);
@ -218,7 +218,7 @@ namespace MWGui
void ensureGlobalMapLoaded();
virtual void open();
virtual void onOpen();
void onFrame(float dt);

@ -111,7 +111,7 @@ void MerchantRepair::onMouseWheel(MyGUI::Widget* _sender, int _rel)
mList->setViewOffset(MyGUI::IntPoint(0, static_cast<int>(mList->getViewOffset().top + _rel*0.3f)));
}
void MerchantRepair::open()
void MerchantRepair::onOpen()
{
center();
// Reset scrollbars

@ -12,7 +12,7 @@ class MerchantRepair : public WindowBase
public:
MerchantRepair();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -200,7 +200,7 @@ namespace MWGui
, mMessageBoxManager(parMessageBoxManager)
, mButtonPressed(-1)
{
WindowModal::open();
WindowModal::onOpen();
int textPadding = 10; // padding between text-widget and main-widget
int textButtonPadding = 10; // padding between the text-widget und the button-widget

@ -590,9 +590,9 @@ namespace MWGui
mParent->onAssignMagicCancel();
}
void MagicSelectionDialog::open ()
void MagicSelectionDialog::onOpen ()
{
WindowModal::open();
WindowModal::onOpen();
mMagicList->setModel(new SpellModel(MWMechanics::getPlayer()));
mMagicList->resetScrollbars();

@ -94,7 +94,7 @@ namespace MWGui
public:
MagicSelectionDialog(QuickKeysMenu* parent);
virtual void open();
virtual void onOpen();
virtual void exit();
private:

@ -120,9 +120,9 @@ namespace MWGui
okButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sOK", ""));
}
void RaceDialog::open()
void RaceDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
updateRaces();
updateSkills();
@ -183,7 +183,7 @@ namespace MWGui
updateSpellPowers();
}
void RaceDialog::close()
void RaceDialog::onClose()
{
mPreviewImage->setRenderItemTexture(NULL);

@ -51,8 +51,8 @@ namespace MWGui
void setGender(Gender gender) { mGenderIndex = gender == GM_Male ? 0 : 1; }
void setNextButtonShow(bool shown);
virtual void open();
virtual void close();
virtual void onOpen();
virtual void onClose();
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;

@ -50,7 +50,7 @@ Recharge::Recharge()
setVisible(false);
}
void Recharge::open()
void Recharge::onOpen()
{
center();

@ -22,7 +22,7 @@ class Recharge : public WindowBase
public:
Recharge();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -46,7 +46,7 @@ Repair::Repair()
mToolIcon->eventMouseButtonClick += MyGUI::newDelegate(this, &Repair::onSelectItem);
}
void Repair::open()
void Repair::onOpen()
{
center();

@ -19,7 +19,7 @@ class Repair : public WindowBase
public:
Repair();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -101,9 +101,9 @@ namespace MWGui
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onOkClicked);
}
void ReviewDialog::open()
void ReviewDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
mUpdateSkillArea = true;
}

@ -45,7 +45,7 @@ namespace MWGui
void configureSkills(const SkillList& major, const SkillList& minor);
void setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::SkillValue& value);
virtual void open();
virtual void onOpen();
void onFrame(float duration);

@ -118,9 +118,9 @@ namespace MWGui
accept();
}
void SaveGameDialog::open()
void SaveGameDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
mSaveNameEdit->setCaption ("");
if (mSaving)

@ -17,7 +17,7 @@ namespace MWGui
public:
SaveGameDialog();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -553,7 +553,7 @@ namespace MWGui
updateControlsBox ();
}
void SettingsWindow::open()
void SettingsWindow::onOpen()
{
updateControlsBox ();
resetScrollbars();

@ -15,7 +15,7 @@ namespace MWGui
public:
SettingsWindow();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -96,9 +96,9 @@ namespace MWGui
mConstantEffect = constant;
}
void EditEffectDialog::open()
void EditEffectDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
center();
}
@ -415,7 +415,7 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->removeGuiMode (GM_SpellCreation);
}
void SpellCreationDialog::open()
void SpellCreationDialog::onOpen()
{
center();
}

@ -23,7 +23,7 @@ namespace MWGui
public:
EditEffectDialog();
virtual void open();
virtual void onOpen();
virtual void exit();
void setConstantEffect(bool constant);
@ -150,7 +150,7 @@ namespace MWGui
public:
SpellCreationDialog();
virtual void open();
virtual void onOpen();
virtual void exit();
void startSpellMaking(MWWorld::Ptr actor);

@ -62,7 +62,7 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->toggleVisible(GW_Magic);
}
void SpellWindow::open()
void SpellWindow::onOpen()
{
updateSpells();
}

@ -37,7 +37,7 @@ namespace MWGui
virtual void onPinToggled();
virtual void onTitleDoubleClicked();
virtual void open();
virtual void onOpen();
SpellView* mSpellView;
SpellIcons* mSpellIcons;

@ -37,7 +37,7 @@ namespace MWGui
void setBounty (int bounty) { if (bounty != mBounty) mChanged = true; this->mBounty = bounty; }
void updateSkillArea();
virtual void open() { onWindowResize(mMainWidget->castType<MyGUI::Window>()); }
virtual void onOpen() { onWindowResize(mMainWidget->castType<MyGUI::Window>()); }
private:
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);

@ -42,9 +42,9 @@ namespace MWGui
setText("LabelT", label);
}
void TextInputDialog::open()
void TextInputDialog::onOpen()
{
WindowModal::open();
WindowModal::onOpen();
// Make sure the edit box has focus
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mTextEdit);
}

@ -20,7 +20,7 @@ namespace MWGui
void setNextButtonShow(bool shown);
void setTextLabel(const std::string &label);
virtual void open();
virtual void onOpen();
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n

@ -55,7 +55,7 @@ namespace MWGui
mProgressBar.setVisible(false);
}
void TrainingWindow::open()
void TrainingWindow::onOpen()
{
center();
}

@ -14,7 +14,7 @@ namespace MWGui
public:
TrainingWindow();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -35,7 +35,7 @@ namespace MWGui
getWidget(mProgressText, "ProgressText");
}
void WaitDialogProgressBar::open()
void WaitDialogProgressBar::onOpen()
{
center();
}
@ -85,7 +85,7 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
void WaitDialog::open()
void WaitDialog::onOpen()
{
if (!MWBase::Environment::get().getWindowManager ()->getRestEnabled ())
{

@ -13,7 +13,7 @@ namespace MWGui
public:
WaitDialogProgressBar();
virtual void open();
virtual void onOpen();
void setProgress(int cur, int total);
@ -27,7 +27,7 @@ namespace MWGui
public:
WaitDialog();
virtual void open();
virtual void onOpen();
virtual void exit();

@ -23,9 +23,9 @@ void WindowBase::setVisible(bool visible)
mMainWidget->setVisible(visible);
if (visible)
open();
onOpen();
else if (wasVisible && !visible)
close();
onClose();
// This is needed as invisible widgets can retain key focus.
// Remove for MyGUI 3.2.2
@ -64,13 +64,13 @@ WindowModal::WindowModal(const std::string& parLayout)
{
}
void WindowModal::open()
void WindowModal::onOpen()
{
MyGUI::InputManager::getInstance ().addWidgetModal (mMainWidget);
MWBase::Environment::get().getWindowManager()->addCurrentModal(this); //Set so we can escape it if needed
}
void WindowModal::close()
void WindowModal::onClose()
{
MyGUI::InputManager::getInstance ().removeWidgetModal (mMainWidget);
MWBase::Environment::get().getWindowManager()->removeCurrentModal(this);

@ -22,9 +22,9 @@ namespace MWGui
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
/// Notify that window has been made visible
virtual void open() {}
virtual void onOpen() {}
/// Notify that window has been hidden
virtual void close () {}
virtual void onClose () {}
/// Gracefully exits the window
virtual void exit() {}
/// Sets the visibility of the window
@ -42,8 +42,8 @@ namespace MWGui
{
public:
WindowModal(const std::string& parLayout);
virtual void open();
virtual void close();
virtual void onOpen();
virtual void onClose();
virtual void exit() {}
};

Loading…
Cancel
Save