Author: gschneider
Date: Thu Apr 21 21:25:30 2011
New Revision: 51416
URL:
http://svn.reactos.org/svn/reactos?rev=51416&view=rev
Log:
[cardlib] Install a button release callback
[spider] Use the button release callback instead of button click callbacks
See issue #6125 for more details.
Modified:
trunk/reactos/base/applications/games/spider/spigame.cpp
trunk/reactos/lib/3rdparty/cardlib/cardregion.cpp
trunk/reactos/lib/3rdparty/cardlib/cardregion.h
trunk/reactos/lib/3rdparty/cardlib/cardrgnmouse.cpp
trunk/reactos/lib/3rdparty/cardlib/cardwindow.cpp
Modified: trunk/reactos/base/applications/games/spider/spigame.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/sp…
==============================================================================
--- trunk/reactos/base/applications/games/spider/spigame.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/applications/games/spider/spigame.cpp [iso-8859-1] Thu Apr 21
21:25:30 2011
@@ -294,8 +294,7 @@
pDeck->SetPlacement(CS_XJUST_RIGHT, CS_YJUST_BOTTOM, - X_BORDER, - Y_BORDER);
pDeck->SetDragRule(CS_DRAG_NONE, 0);
pDeck->SetDropRule(CS_DROP_NONE, 0);
- pDeck->SetClickProc(DeckClickProc);
- pDeck->SetDblClickProc(DeckClickProc);
+ pDeck->SetClickReleaseProc(DeckClickProc);
/* Create the row stacks */
for (i = 0; i < NUM_STACKS; i++)
Modified: trunk/reactos/lib/3rdparty/cardlib/cardregion.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/cardlib/cardr…
==============================================================================
--- trunk/reactos/lib/3rdparty/cardlib/cardregion.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/3rdparty/cardlib/cardregion.cpp [iso-8859-1] Thu Apr 21 21:25:30
2011
@@ -46,6 +46,7 @@
AddCallback = 0;
RemoveCallback = 0;
ClickCallback = 0;
+ ClickReleaseCallback = 0;
DblClickCallback = 0;
uDragRule = CS_DRAG_ALL;
@@ -185,6 +186,11 @@
void CardRegion::SetClickProc(pClickProc proc)
{
ClickCallback = proc;
+}
+
+void CardRegion::SetClickReleaseProc(pClickProc proc)
+{
+ ClickReleaseCallback = proc;
}
void CardRegion::SetDblClickProc(pClickProc proc)
Modified: trunk/reactos/lib/3rdparty/cardlib/cardregion.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/cardlib/cardr…
==============================================================================
--- trunk/reactos/lib/3rdparty/cardlib/cardregion.h [iso-8859-1] (original)
+++ trunk/reactos/lib/3rdparty/cardlib/cardregion.h [iso-8859-1] Thu Apr 21 21:25:30 2011
@@ -40,6 +40,7 @@
bool SetDropRule(UINT uDropType, pCanDropProc proc = 0);
void SetClickProc (pClickProc proc);
+ void SetClickReleaseProc (pClickProc proc);
void SetDblClickProc (pClickProc proc);
void SetAddCardProc (pAddProc proc);
@@ -132,6 +133,7 @@
bool OnLButtonDblClk(int x, int y);
bool OnMouseMove(int x, int y);
bool OnLButtonUp(int x, int y);
+ void ClickRelease(int x, int y);
//
@@ -204,6 +206,7 @@
pCanDragProc CanDragCallback;
pCanDropProc CanDropCallback;
pClickProc ClickCallback;
+ pClickProc ClickReleaseCallback;
pClickProc DblClickCallback;
pAddProc AddCallback;
pRemoveProc RemoveCallback;
Modified: trunk/reactos/lib/3rdparty/cardlib/cardrgnmouse.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/cardlib/cardr…
==============================================================================
--- trunk/reactos/lib/3rdparty/cardlib/cardrgnmouse.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/3rdparty/cardlib/cardrgnmouse.cpp [iso-8859-1] Thu Apr 21 21:25:30
2011
@@ -277,6 +277,14 @@
}
return false;
+}
+
+void CardRegion::ClickRelease(int x, int y)
+{
+ iNumDragCards = GetNumDragCards(x, y);
+
+ if (ClickReleaseCallback)
+ ClickReleaseCallback(*this, iNumDragCards);
}
bool CardRegion::OnLButtonUp(int x, int y)
Modified: trunk/reactos/lib/3rdparty/cardlib/cardwindow.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/cardlib/cardw…
==============================================================================
--- trunk/reactos/lib/3rdparty/cardlib/cardwindow.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/3rdparty/cardlib/cardwindow.cpp [iso-8859-1] Thu Apr 21 21:25:30
2011
@@ -501,6 +501,12 @@
return 0;
}
+ if ((stackptr = CardRegionFromPoint(x, y)) != 0)
+ {
+ stackptr->ClickRelease(x, y);
+ stackptr = 0;
+ }
+
return 0;
case WM_MOUSEMOVE: