diff options
author | David Athay <ko2fan@gmail.com> | 2008-10-22 10:37:08 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-10-22 10:37:08 +0000 |
commit | d242b7ebd7927e8eb447ee866777cf48db15ae0c (patch) | |
tree | 4d2d5f9f9374f0036cda6e45665ccfedc9567756 /src/gui/ok_dialog.cpp | |
parent | 93b9bfd3bde24a76bf7ef58b71f0d8757d3b38e5 (diff) | |
download | mana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.tar.gz mana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.tar.bz2 mana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.tar.xz mana-client-d242b7ebd7927e8eb447ee866777cf48db15ae0c.zip |
Now displays ban time, if banned
Diffstat (limited to 'src/gui/ok_dialog.cpp')
-rw-r--r-- | src/gui/ok_dialog.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp index ca9d2a7b..90407d31 100644 --- a/src/gui/ok_dialog.cpp +++ b/src/gui/ok_dialog.cpp @@ -22,32 +22,33 @@ */ #include "ok_dialog.h" - -#include <guichan/widgets/label.hpp> - +#include "textbox.h" #include "button.h" - +#include "scrollarea.h" OkDialog::OkDialog(const std::string &title, const std::string &msg, Window *parent): Window(title, true, parent) { - gcn::Label *textLabel = new gcn::Label(msg); + TextBox *textBox = new TextBox(); + textBox->setEditable(false); + + gcn::ScrollArea *scrollArea = new ScrollArea(textBox); gcn::Button *okButton = new Button("Ok", "ok", this); - int w = textLabel->getWidth() + 20; - int h = textLabel->getHeight() + 25 + okButton->getHeight(); + setContentSize(260, 175); + scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); + scrollArea->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS); + scrollArea->setDimension(gcn::Rectangle( + 5, 5, 250, 160 - okButton->getHeight())); - if (okButton->getWidth() + 10 > w) { - w = okButton->getWidth() + 10; - } + textBox->setTextWrapped(msg); - setContentSize(w, h); - textLabel->setPosition(10, 10); - okButton->setPosition((w - okButton->getWidth()) / 2, - h - 5 - okButton->getHeight()); + okButton->setPosition( + 260 - 5 - okButton->getWidth(), + 175 - 5 - okButton->getHeight()); - add(textLabel); + add(scrollArea); add(okButton); setLocationRelativeTo(getParent()); |