diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-09 14:25:42 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-04-09 14:25:42 +0000 |
commit | aca696b5c784bfbb426c50ac58e93e3d61944b39 (patch) | |
tree | c316560d66e3f0f1bfd06fee672aea4399c50ada | |
parent | 271374e1b887d92f2a10b564e33a6781065c3d6f (diff) | |
download | mana-client-aca696b5c784bfbb426c50ac58e93e3d61944b39.tar.gz mana-client-aca696b5c784bfbb426c50ac58e93e3d61944b39.tar.bz2 mana-client-aca696b5c784bfbb426c50ac58e93e3d61944b39.tar.xz mana-client-aca696b5c784bfbb426c50ac58e93e3d61944b39.zip |
Fixed problem with row height in shop list box.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/gui/shoplistbox.cpp | 29 | ||||
-rw-r--r-- | src/gui/shoplistbox.h | 7 |
3 files changed, 11 insertions, 30 deletions
@@ -1,3 +1,8 @@ +2008-04-09 Bjørn Lindeijer <bjorn@lindeijer.nl> + + * src/gui/shoplistbox.cpp, src/gui/shoplistbox.h: Fixed problem with + row height in shop list box. + 2008-04-07 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/winver.h, README, configure.ac, data/help/changes.txt, diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp index 026c4aef..f3f98062 100644 --- a/src/gui/shoplistbox.cpp +++ b/src/gui/shoplistbox.cpp @@ -99,35 +99,6 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) } } -/* TODO: - * This method is no longer virtual, needed to be able to change row height... - * -void ShopListBox::setSelected(int selected) -{ - if (!mListModel) - { - mSelected = -1; - } - else - { - // Update mSelected with bounds checking - mSelected = std::min(mListModel->getNumberOfElements() - 1, - std::max(-1, selected)); - - gcn::Widget *parent = getParent(); - if (parent && mSelected >= 0) - { - gcn::Rectangle scroll; - scroll.y = mRowHeight * mSelected; - scroll.height = mRowHeight; - parent->showWidgetPart(this, scroll); - } - } - - distributeValueChangedEvent(); -} -*/ - void ShopListBox::mousePressed(gcn::MouseEvent &event) { if (event.getButton() == gcn::MouseEvent::LEFT) diff --git a/src/gui/shoplistbox.h b/src/gui/shoplistbox.h index aeceab1b..837f745f 100644 --- a/src/gui/shoplistbox.h +++ b/src/gui/shoplistbox.h @@ -52,6 +52,11 @@ class ShopListBox : public ListBox */ void draw(gcn::Graphics *graphics); + /** + * Returns the height of a row. + */ + unsigned int getRowHeight() const { return mRowHeight; } + void mousePressed(gcn::MouseEvent &event); /** @@ -79,7 +84,7 @@ class ShopListBox : public ListBox */ ShopItems *mShopItems; - int mRowHeight; /**< Row Height */ + unsigned int mRowHeight; /**< Row Height */ bool mPriceCheck; }; |