summaryrefslogtreecommitdiff
path: root/src/gui/ok_dialog.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-30 02:04:39 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-30 02:04:39 +0000
commit093d95683bfcbbff6e0ddd87414e2cd723f17dc9 (patch)
treec6d07ce0bb312c7e4d7e165ee5c1cb348a6e44fa /src/gui/ok_dialog.cpp
parent69ccb03b44f324f17d02b9e27e71c34850f71139 (diff)
downloadmana-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.tar.gz
mana-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.tar.bz2
mana-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.tar.xz
mana-093d95683bfcbbff6e0ddd87414e2cd723f17dc9.zip
A few cleanups and simplifications.
Diffstat (limited to 'src/gui/ok_dialog.cpp')
-rw-r--r--src/gui/ok_dialog.cpp27
1 files changed, 6 insertions, 21 deletions
diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp
index aca42972..2e2594d1 100644
--- a/src/gui/ok_dialog.cpp
+++ b/src/gui/ok_dialog.cpp
@@ -26,30 +26,14 @@
#include <guichan/widgets/label.hpp>
#include "button.h"
-#include "windowcontainer.h"
-OkDialog::OkDialog(const std::string &title, const std::string &msg,
- gcn::ActionListener *listener):
- Window(title, true)
-{
- init(msg, listener);
-}
-OkDialog::OkDialog(Window *parent, const std::string &title,
- const std::string &msg, gcn::ActionListener *listener):
+OkDialog::OkDialog(const std::string &title, const std::string &msg,
+ gcn::ActionListener *listener, Window *parent):
Window(title, true, parent)
{
- init(msg, listener);
-}
-
-OkDialog::~OkDialog()
-{
-}
-
-void OkDialog::init(const std::string &msg, gcn::ActionListener *listener)
-{
- textLabel = new gcn::Label(msg);
- okButton = new Button("Ok");
+ gcn::Label *textLabel = new gcn::Label(msg);
+ gcn::Button *okButton = new Button("Ok");
int w = textLabel->getWidth() + 20;
int h = textLabel->getHeight() + 25 + okButton->getHeight();
@@ -78,7 +62,8 @@ void OkDialog::init(const std::string &msg, gcn::ActionListener *listener)
void OkDialog::action(const std::string &eventId)
{
+ // Can we receive anything else anyway?
if (eventId == "ok") {
- windowContainer->scheduleDelete(this);
+ scheduleDelete();
}
}