summaryrefslogtreecommitdiff
path: root/src/gui/char_server.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-19 00:06:24 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-19 00:06:24 +0000
commit75668f13e61ef137d1835b3d60e6de9a7a9ecb42 (patch)
treef3973b20dce7f0ed61b935305056c8e8d3735670 /src/gui/char_server.cpp
parent55372882029946d8193ca4414091b65abd64a6ae (diff)
downloadmana-75668f13e61ef137d1835b3d60e6de9a7a9ecb42.tar.gz
mana-75668f13e61ef137d1835b3d60e6de9a7a9ecb42.tar.bz2
mana-75668f13e61ef137d1835b3d60e6de9a7a9ecb42.tar.xz
mana-75668f13e61ef137d1835b3d60e6de9a7a9ecb42.zip
Implemented setLocationRelativeTo method on Window allowing the dialogs to be
centered on screen.
Diffstat (limited to 'src/gui/char_server.cpp')
-rw-r--r--src/gui/char_server.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index e71fdd00..342836e4 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -39,7 +39,7 @@ ServerSelectDialog::ServerSelectDialog():
okButton = new Button("OK");
cancelButton = new Button("Cancel");
- setDimension(gcn::Rectangle(300, 200, 200, 100));
+ setSize(200, 100);
scrollArea->setDimension(gcn::Rectangle(4, 4, 192, 55));
okButton->setPosition(120, 70);
cancelButton->setPosition(146, 70);
@@ -74,6 +74,11 @@ ServerSelectDialog::~ServerSelectDialog()
delete cancelButton;
}
+void ServerSelectDialog::init()
+{
+ setLocationRelativeTo(getParent());
+}
+
void ServerSelectDialog::action(const std::string& eventId)
{
if (eventId == "ok") {
@@ -99,8 +104,8 @@ std::string ServerListModel::getElementAt(int i) {
void char_server() {
ServerSelectDialog *dialog = new ServerSelectDialog();
-
guiTop->add(dialog);
+ dialog->init();
state = LOGIN;