summaryrefslogtreecommitdiff
path: root/src/gui/itemshortcutcontainer.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-08 16:38:22 -0700
committerIra Rice <irarice@gmail.com>2009-01-08 16:38:22 -0700
commita001775f8b0b992cc7c4c5863722d02e8606b175 (patch)
tree44dfa8ab01119022b7999b27c3031a39d9d3c186 /src/gui/itemshortcutcontainer.cpp
parent193ccbdba8031a351ea622f8842b6d9a0b6cfd43 (diff)
parent611210b1e0fd9cbaed38b229462e109d8f4be385 (diff)
downloadmana-client-a001775f8b0b992cc7c4c5863722d02e8606b175.tar.gz
mana-client-a001775f8b0b992cc7c4c5863722d02e8606b175.tar.bz2
mana-client-a001775f8b0b992cc7c4c5863722d02e8606b175.tar.xz
mana-client-a001775f8b0b992cc7c4c5863722d02e8606b175.zip
Fixed include order (pedantic change)
Conflicts: src/gui/smileycontainer.cpp Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/itemshortcutcontainer.cpp')
-rw-r--r--src/gui/itemshortcutcontainer.cpp36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/gui/itemshortcutcontainer.cpp b/src/gui/itemshortcutcontainer.cpp
index 77657169..f0ab8274 100644
--- a/src/gui/itemshortcutcontainer.cpp
+++ b/src/gui/itemshortcutcontainer.cpp
@@ -34,11 +34,11 @@
#include "../utils/tostring.h"
ItemShortcutContainer::ItemShortcutContainer():
- mGridWidth(1),
- mGridHeight(1),
mItemClicked(false),
mItemMoved(NULL)
{
+ mGridWidth=1;
+ mGridHeight=1;
addMouseListener(this);
addWidgetListener(this);
@@ -131,22 +131,6 @@ ItemShortcutContainer::draw(gcn::Graphics *graphics)
}
}
-void ItemShortcutContainer::widgetResized(const gcn::Event &event)
-{
- mGridWidth = getWidth() / mBoxWidth;
- if (mGridWidth < 1) {
- mGridWidth = 1;
- }
-
- setHeight((mMaxItems / mGridWidth +
- (mMaxItems % mGridWidth > 0 ? 1 : 0)) * mBoxHeight);
-
- mGridHeight = getHeight() / mBoxHeight;
- if (mGridHeight < 1) {
- mGridHeight = 1;
- }
-}
-
void
ItemShortcutContainer::mouseDragged(gcn::MouseEvent &event)
{
@@ -219,19 +203,3 @@ ItemShortcutContainer::mouseReleased(gcn::MouseEvent &event)
}
}
-int
-ItemShortcutContainer::getIndexFromGrid(int pointX, int pointY) const
-{
- const gcn::Rectangle tRect = gcn::Rectangle(
- 0, 0, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight);
- if (!tRect.isPointInRect(pointX, pointY)) {
- return -1;
- }
- const int index = ((pointY / mBoxHeight) * mGridWidth) +
- pointX / mBoxWidth;
- if (index >= mMaxItems)
- {
- return -1;
- }
- return index;
-}