summaryrefslogtreecommitdiff
path: root/src/gui/textdialog.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-21 19:02:01 -0600
committerJared Adams <jaxad0127@gmail.com>2010-03-21 19:15:25 -0600
commita8273ca217ee08f718e6acb3786f3197dff7915c (patch)
treee5a5ce0388d2dc3dca7493a76d1e232469620290 /src/gui/textdialog.cpp
parent7365f367e74a1353a6254d8e3adedf52f1b5bdb2 (diff)
downloadmana-a8273ca217ee08f718e6acb3786f3197dff7915c.tar.gz
mana-a8273ca217ee08f718e6acb3786f3197dff7915c.tar.bz2
mana-a8273ca217ee08f718e6acb3786f3197dff7915c.tar.xz
mana-a8273ca217ee08f718e6acb3786f3197dff7915c.zip
Make TextDialog use the layout system
Reviewed-by: Chuck Miller Reviewed-by: Philipp Sehmisch
Diffstat (limited to 'src/gui/textdialog.cpp')
-rw-r--r--src/gui/textdialog.cpp24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp
index 120780fe..3e3aafe2 100644
--- a/src/gui/textdialog.cpp
+++ b/src/gui/textdialog.cpp
@@ -38,26 +38,12 @@ TextDialog::TextDialog(const std::string &title, const std::string &msg,
mOkButton = new Button(_("OK"), "OK", this);
gcn::Button *cancelButton = new Button(_("Cancel"), "CANCEL", this);
- int w = textLabel->getWidth() + 20;
- int inWidth = mOkButton->getWidth() + cancelButton->getWidth() + 5;
- int h = textLabel->getHeight() + 25 + mOkButton->getHeight() + mTextField->getHeight();
+ place(0, 0, textLabel, 4);
+ place(0, 1, mTextField, 4);
+ place(2, 2, mOkButton);
+ place(3, 2, cancelButton);
- if (w < inWidth + 10)
- w = inWidth + 10;
-
- setContentSize(w, h);
- textLabel->setPosition(10, 10);
- mTextField->setWidth(85);
- mTextField->setPosition(10,20 + textLabel->getHeight());
- mOkButton->setPosition((w - inWidth) / 2,
- h - 5 - cancelButton->getHeight());
- cancelButton->setPosition(mOkButton->getX() + mOkButton->getWidth() + 5,
- h - 5 - cancelButton->getHeight());
-
- add(textLabel);
- add(mTextField);
- add(mOkButton);
- add(cancelButton);
+ reflowLayout(textLabel->getWidth() + 20);
if (getParent())
{