From ceb3ff6bba5a4133000142920a21899114e91cd1 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 7 Dec 2008 02:00:41 +0100 Subject: Fixed wrapping in some cases, removed draw method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from eAthena commit 43eb6ba950dd8bf978e539c7c7460ef5096438de) Conflicts: src/gui/npclistdialog.cpp src/gui/npclistdialog.h --- src/gui/npclistdialog.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/gui/npclistdialog.cpp') diff --git a/src/gui/npclistdialog.cpp b/src/gui/npclistdialog.cpp index e896778c..57783d96 100644 --- a/src/gui/npclistdialog.cpp +++ b/src/gui/npclistdialog.cpp @@ -66,14 +66,12 @@ 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]; } @@ -83,8 +81,7 @@ void NpcListDialog::addItem(std::string const &item) mItems.push_back(item); } -void -NpcListDialog::reset() +void NpcListDialog::reset() { mItems.clear(); } @@ -92,11 +89,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; @@ -111,8 +104,7 @@ void NpcListDialog::draw() cancelButton->getY()); } -void -NpcListDialog::action(const gcn::ActionEvent &event) +void NpcListDialog::action(const gcn::ActionEvent &event) { int choice = 0; -- cgit v1.2.3-70-g09d2