summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-01-10 21:14:37 +0000
committerJared Adams <jaxad0127@gmail.com>2010-01-10 21:14:37 +0000
commit34917f8ff44b0224f7199e7f1ffd55ba588a9cf7 (patch)
tree731bc31b53ceda93010e4fd26cfe0bf594cb70e3 /src/gui
parent4c6165ece76dff406d324c240a7fc099a3e0c42b (diff)
downloadmana-34917f8ff44b0224f7199e7f1ffd55ba588a9cf7.tar.gz
mana-34917f8ff44b0224f7199e7f1ffd55ba588a9cf7.tar.bz2
mana-34917f8ff44b0224f7199e7f1ffd55ba588a9cf7.tar.xz
mana-34917f8ff44b0224f7199e7f1ffd55ba588a9cf7.zip
Make sure TextDialogs get input precedence
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/textdialog.cpp9
-rw-r--r--src/gui/textdialog.h7
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp
index 326954e2..6cd066cc 100644
--- a/src/gui/textdialog.cpp
+++ b/src/gui/textdialog.cpp
@@ -27,6 +27,8 @@
#include "utils/gettext.h"
+int TextDialog::instances = 0;
+
TextDialog::TextDialog(const std::string &title, const std::string &msg,
Window *parent):
Window(title, true, parent),
@@ -64,6 +66,13 @@ TextDialog::TextDialog(const std::string &title, const std::string &msg,
}
setVisible(true);
mTextField->requestFocus();
+
+ instances++;
+}
+
+TextDialog::~TextDialog()
+{
+ instances--;
}
void TextDialog::action(const gcn::ActionEvent &event)
diff --git a/src/gui/textdialog.h b/src/gui/textdialog.h
index edfe85b6..b04851ac 100644
--- a/src/gui/textdialog.h
+++ b/src/gui/textdialog.h
@@ -43,6 +43,9 @@ public:
*/
TextDialog(const std::string &title, const std::string &msg,
Window *parent = NULL);
+
+
+ ~TextDialog();
/**
* Called when receiving actions from the widgets.
@@ -58,8 +61,12 @@ public:
* Set the OK button action id
*/
void setOKButtonActionId(const std::string &name);
+
+ static const bool isActive() { return instances > 0; }
private:
+ static int instances;
+
TextField *mTextField;
gcn::Button *mOkButton;
};