From 611210b1e0fd9cbaed38b229462e109d8f4be385 Mon Sep 17 00:00:00 2001 From: Forge Date: Fri, 9 Jan 2009 00:03:53 +0100 Subject: 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 --- src/gui/itemshortcutcontainer.cpp | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'src/gui/itemshortcutcontainer.cpp') 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; -} -- cgit v1.2.3-70-g09d2