diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-07 00:23:59 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-12-06 17:04:08 -0700 |
commit | b03435fd4ad3c19b96dd7ae960e0950fdd35392c (patch) | |
tree | d7c058f3383e6f212542409a5ecf7247aa1cd966 /src/gui/npclistdialog.cpp | |
parent | 1eaa9ddf23eefebd4e48d6019df3fe3ddc94dee0 (diff) | |
download | mana-b03435fd4ad3c19b96dd7ae960e0950fdd35392c.tar.gz mana-b03435fd4ad3c19b96dd7ae960e0950fdd35392c.tar.bz2 mana-b03435fd4ad3c19b96dd7ae960e0950fdd35392c.tar.xz mana-b03435fd4ad3c19b96dd7ae960e0950fdd35392c.zip |
Fixed wrapping in some cases, removed draw method
The 'draw' method was confusingly named, and was actually for updating
the GUI after a resize. Its functionality has been merged into
'widgetResized'.
The wrapping was broken in the case where text was added to the NPC
dialog, cause it was added to an already wrapped string, causing the
wrapping to become permanent.
Sorry for all the reformatting.
Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
Diffstat (limited to 'src/gui/npclistdialog.cpp')
-rw-r--r-- | src/gui/npclistdialog.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp index ba9e3d58..c17cd4aa 100644 --- a/src/gui/npclistdialog.cpp +++ b/src/gui/npclistdialog.cpp @@ -61,31 +61,26 @@ NpcListDialog::NpcListDialog(): setLocationRelativeTo(getParent()); } -int -NpcListDialog::getNumberOfElements() +int NpcListDialog::getNumberOfElements() { return mItems.size(); } -std::string -NpcListDialog::getElementAt(int i) +std::string NpcListDialog::getElementAt(int i) { return mItems[i]; } -void -NpcListDialog::parseItems(const std::string &itemString) +void NpcListDialog::parseItems(const std::string &itemString) { std::istringstream iss(itemString); std::string tmp; - while(getline(iss, tmp, ':')) { + while (getline(iss, tmp, ':')) mItems.push_back(tmp); - } } -void -NpcListDialog::reset() +void NpcListDialog::reset() { mItems.clear(); } @@ -93,11 +88,7 @@ NpcListDialog::reset() void NpcListDialog::widgetResized(const gcn::Event &event) { Window::widgetResized(event); - draw(); -} -void NpcListDialog::draw() -{ const gcn::Rectangle &area = getChildrenArea(); const int width = area.width; const int height = area.height; @@ -112,8 +103,7 @@ void NpcListDialog::draw() cancelButton->getY()); } -void -NpcListDialog::action(const gcn::ActionEvent &event) +void NpcListDialog::action(const gcn::ActionEvent &event) { int choice = 0; |