diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-19 00:06:24 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2004-12-19 00:06:24 +0000 |
commit | 75668f13e61ef137d1835b3d60e6de9a7a9ecb42 (patch) | |
tree | f3973b20dce7f0ed61b935305056c8e8d3735670 /src/gui/char_server.cpp | |
parent | 55372882029946d8193ca4414091b65abd64a6ae (diff) | |
download | mana-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.cpp | 9 |
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; |