diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-21 19:02:01 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-21 19:15:25 -0600 |
commit | a8273ca217ee08f718e6acb3786f3197dff7915c (patch) | |
tree | e5a5ce0388d2dc3dca7493a76d1e232469620290 | |
parent | 7365f367e74a1353a6254d8e3adedf52f1b5bdb2 (diff) | |
download | Mana-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
-rw-r--r-- | src/gui/textdialog.cpp | 24 |
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()) { |