summaryrefslogtreecommitdiff
path: root/src/gui/itemshortcutcontainer.cpp
diff options
context:
space:
mode:
authorForge <jgrimbert@free.fr>2009-01-09 00:03:53 +0100
committerForge <jgrimbert@free.fr>2009-01-09 00:03:53 +0100
commit611210b1e0fd9cbaed38b229462e109d8f4be385 (patch)
treed2fc4f7465ccd611e918a8905d7478aacd458acb /src/gui/itemshortcutcontainer.cpp
parent0b2e6c53a158b820a3e3610372c98185a4dce30a (diff)
downloadmana-611210b1e0fd9cbaed38b229462e109d8f4be385.tar.gz
mana-611210b1e0fd9cbaed38b229462e109d8f4be385.tar.bz2
mana-611210b1e0fd9cbaed38b229462e109d8f4be385.tar.xz
mana-611210b1e0fd9cbaed38b229462e109d8f4be385.zip
Now, the real stage 2.0 of smiley window.
All is done, and all files are now in the tree. (ok, copyright of new files is still opened... do as you want, if you care) Signed-off-by: Forge <jgrimbert@free.fr>
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;
-}