Move eventDone to WindowBase and make it tell which window is done

actorid
Jan-Peter Nilsson 14 years ago
parent 54fc64cb6a
commit f83c5327f3

@ -92,7 +92,7 @@ void BirthDialog::setBirthId(const std::string &birthId)
void BirthDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}
void BirthDialog::onBackClicked(MyGUI::Widget* _sender)

@ -39,11 +39,6 @@ namespace MWGui
*/
EventHandle_Void eventBack;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
protected:
void onSelectBirth(MyGUI::List* _sender, size_t _index);

@ -55,7 +55,7 @@ void GenerateClassResultDialog::setClassId(const std::string &classId)
void GenerateClassResultDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}
void GenerateClassResultDialog::onBackClicked(MyGUI::Widget* _sender)
@ -166,7 +166,7 @@ void PickClassDialog::setClassId(const std::string &classId)
void PickClassDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}
void PickClassDialog::onBackClicked(MyGUI::Widget* _sender)
@ -639,7 +639,7 @@ void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
descDialog->setVisible(true);
}
void CreateClassDialog::onDescriptionEntered()
void CreateClassDialog::onDescriptionEntered(WindowBase* parWindow)
{
description = descDialog->getTextInput();
mWindowManager.removeDialog(descDialog);
@ -647,7 +647,7 @@ void CreateClassDialog::onDescriptionEntered()
void CreateClassDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}
void CreateClassDialog::onBackClicked(MyGUI::Widget* _sender)
@ -858,5 +858,5 @@ DescriptionDialog::DescriptionDialog(WindowManager& parWindowManager)
void DescriptionDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}

@ -85,11 +85,6 @@ namespace MWGui
*/
EventHandle_Void eventBack;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
protected:
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);
@ -120,11 +115,6 @@ namespace MWGui
*/
EventHandle_Void eventBack;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
protected:
void onSelectClass(MyGUI::List* _sender, size_t _index);
@ -250,14 +240,6 @@ namespace MWGui
std::string getTextInput() const { return textEdit ? textEdit->getOnlyText() : ""; }
void setTextInput(const std::string &text) { if (textEdit) textEdit->setOnlyText(text); }
// Events
typedef delegates::CDelegate0 EventHandle_Void;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
protected:
void onOkClicked(MyGUI::Widget* _sender);
@ -289,11 +271,6 @@ namespace MWGui
*/
EventHandle_Void eventBack;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
protected:
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);
@ -305,7 +282,7 @@ namespace MWGui
void onSkillClicked(Widgets::MWSkillPtr _sender);
void onSkillSelected();
void onDescriptionClicked(MyGUI::Widget* _sender);
void onDescriptionEntered();
void onDescriptionEntered(WindowBase* parWindow);
void onDialogCancel();
private:

@ -149,7 +149,7 @@ int wrap(int index, int max)
void RaceDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}
void RaceDialog::onBackClicked(MyGUI::Widget* _sender)

@ -53,11 +53,6 @@ namespace MWGui
*/
EventHandle_Void eventBack;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
protected:
void onHeadRotate(MyGUI::VScroll* _sender, size_t _position);

@ -336,7 +336,7 @@ void ReviewDialog::updateScroller()
void ReviewDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}
void ReviewDialog::onBackClicked(MyGUI::Widget* _sender)

@ -57,11 +57,6 @@ namespace MWGui
*/
EventHandle_Void eventBack;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
EventHandle_Int eventActivateDialog;
protected:

@ -53,10 +53,10 @@ void TextInputDialog::open()
void TextInputDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone();
eventDone(this);
}
void TextInputDialog::onTextAccepted(MyGUI::Edit* _sender)
{
eventDone();
eventDone(this);
}

@ -27,14 +27,6 @@ namespace MWGui
void setTextLabel(const std::string &label);
void open();
// Events
typedef delegates::CDelegate0 EventHandle_Void;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventDone;
protected:
void onOkClicked(MyGUI::Widget* _sender);
void onTextAccepted(MyGUI::Edit* _sender);

@ -12,9 +12,17 @@ namespace MWGui
public:
WindowBase(const std::string& parLayout, WindowManager& parWindowManager);
// Events
typedef MyGUI::delegates::CDelegate1<WindowBase*> EventHandle_WindowBase;
virtual void open();
void center();
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_WindowBase eventDone;
protected:
WindowManager& mWindowManager;
};

@ -464,7 +464,7 @@ const std::string &WindowManager::getGameSettingString(const std::string &id, co
return default_;
}
void WindowManager::onNameDialogDone()
void WindowManager::onNameDialogDone(WindowBase* parWindow)
{
if (nameDialog)
{
@ -485,7 +485,7 @@ void WindowManager::onNameDialogDone()
}
}
void WindowManager::onRaceDialogDone()
void WindowManager::onRaceDialogDone(WindowBase* parWindow)
{
if (raceDialog)
{
@ -764,7 +764,7 @@ void WindowManager::onGenerateClassBack()
setGuiMode(GM_Class);
}
void WindowManager::onGenerateClassDone()
void WindowManager::onGenerateClassDone(WindowBase* parWindow)
{
if (generateClassResultDialog)
removeDialog(generateClassResultDialog);
@ -783,7 +783,7 @@ void WindowManager::onGenerateClassDone()
}
void WindowManager::onPickClassDialogDone()
void WindowManager::onPickClassDialogDone(WindowBase* parWindow)
{
if (pickClassDialog)
{
@ -821,7 +821,7 @@ void WindowManager::onPickClassDialogBack()
setGuiMode(GM_Class);
}
void WindowManager::onCreateClassDialogDone()
void WindowManager::onCreateClassDialogDone(WindowBase* parWindow)
{
if (createClassDialog)
{
@ -871,7 +871,7 @@ void WindowManager::onCreateClassDialogBack()
setGuiMode(GM_Class);
}
void WindowManager::onBirthSignDialogDone()
void WindowManager::onBirthSignDialogDone(WindowBase* parWindow)
{
if (birthSignDialog)
{
@ -902,7 +902,7 @@ void WindowManager::onBirthSignDialogBack()
setGuiMode(GM_Class);
}
void WindowManager::onReviewDialogDone()
void WindowManager::onReviewDialogDone(WindowBase* parWindow)
{
if (reviewDialog)
removeDialog(reviewDialog);

@ -44,6 +44,7 @@ namespace OEngine
namespace MWGui
{
class WindowBase;
class HUD;
class MapWindow;
class MainMenu;
@ -263,10 +264,10 @@ namespace MWGui
void onDialogueWindowBye();
// Character generation: Name dialog
void onNameDialogDone();
void onNameDialogDone(WindowBase* parWindow);
// Character generation: Race dialog
void onRaceDialogDone();
void onRaceDialogDone(WindowBase* parWindow);
void onRaceDialogBack();
// Character generation: Choose class process
@ -276,22 +277,22 @@ namespace MWGui
void showClassQuestionDialog();
void onClassQuestionChosen(int _index);
void onGenerateClassBack();
void onGenerateClassDone();
void onGenerateClassDone(WindowBase* parWindow);
// Character generation: Pick Class dialog
void onPickClassDialogDone();
void onPickClassDialogDone(WindowBase* parWindow);
void onPickClassDialogBack();
// Character generation: Create Class dialog
void onCreateClassDialogDone();
void onCreateClassDialogDone(WindowBase* parWindow);
void onCreateClassDialogBack();
// Character generation: Birth sign dialog
void onBirthSignDialogDone();
void onBirthSignDialogDone(WindowBase* parWindow);
void onBirthSignDialogBack();
// Character generation: Review dialog
void onReviewDialogDone();
void onReviewDialogDone(WindowBase* parWindow);
void onReviewDialogBack();
void onReviewActivateDialog(int parDialog);

Loading…
Cancel
Save