[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : luke
Repository : xara
Revision : 1646
Date : Wed Aug 2 16:32:51 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/csrstack.cpp
M /Trunk/XaraLX/Kernel/csrstack.h
M /Trunk/XaraLX/wxOil/cursor.cpp
M /Trunk/XaraLX/wxOil/cursor.h
Fix some cursor issues
Diff:
Index: Trunk/XaraLX/Kernel/csrstack.cpp
===================================================================
--- Trunk/XaraLX/Kernel/csrstack.cpp (revision 1645)
+++ Trunk/XaraLX/Kernel/csrstack.cpp (revision 1646)
@@ -357,7 +357,8 @@
// Now the gap has been closed, let's decrement the nextfree counter
nNextFreeSlot--;
- if (nNextFreeSlot > 0) SetActive();
+ if (nNextFreeSlot > 0)
+ SetActive();
// Finally, return the pointer to the cursor we've just removed from the stack
return pc;
@@ -463,7 +464,7 @@
SeeAlso: Cursor::SetActive
********************************************************************************************/
-void CursorStack::SetActive() const
+void CursorStack::SetActive( bool fOnlyRendWnd /*= true*/ ) const
{
if (nNextFreeSlot <= 0)
{
@@ -475,7 +476,7 @@
if (BusyCount > 0)
Cursor::Busy->SetActive();
else
- pcStack[nNextFreeSlot - 1].pCursor->SetActive();
+ pcStack[nNextFreeSlot - 1].pCursor->SetActive( fOnlyRendWnd );
}
Cursor* CursorStack::GetActive()
Index: Trunk/XaraLX/Kernel/csrstack.h
===================================================================
--- Trunk/XaraLX/Kernel/csrstack.h (revision 1645)
+++ Trunk/XaraLX/Kernel/csrstack.h (revision 1646)
@@ -180,7 +180,7 @@
Cursor* Pop(INT32 cursorID = 0);
Cursor* SetTop(Cursor* pCursor, INT32 cursorID = 0);
- void SetActive() const;
+ void SetActive( bool fOnlyRendWnd = true ) const;
BOOL IsActive(const Cursor* pCursor) const;
// IMPORTANT: DONT USE THIS VAR IN NEW CODE - IT IS DUE TO DIE SOON
Index: Trunk/XaraLX/wxOil/cursor.h
===================================================================
--- Trunk/XaraLX/wxOil/cursor.h (revision 1645)
+++ Trunk/XaraLX/wxOil/cursor.h (revision 1646)
@@ -137,7 +137,7 @@
virtual ~Cursor(); // destroy a cursor
BOOL IsValid() const; // TRUE if cursor constructed OK
- void SetActive() const; // set the system's cursor to this
+ void SetActive( bool fOnlyRendWnd = false ) const; // set the system's cursor to this
wxCursor *Handle() {return &hCursor;} // returns the (wxWindows) handle of the cursor
// static BOOL Show(); // show the cursor, if invisible
Index: Trunk/XaraLX/wxOil/cursor.cpp
===================================================================
--- Trunk/XaraLX/wxOil/cursor.cpp (revision 1645)
+++ Trunk/XaraLX/wxOil/cursor.cpp (revision 1646)
@@ -571,7 +571,7 @@
********************************************************************************************/
-void Cursor::SetActive() const
+void Cursor::SetActive( bool fOnlyRendWnd /*= true*/ ) const
{
// If we have captured the mouse then release it
wxWindow* pCaptureWnd = wxWindow::GetCapture();
@@ -579,11 +579,18 @@
pCaptureWnd->ReleaseMouse();
// Set the global cursor (but only if we have a Render window to
- // control its scope)
- wxWindow* pRenderWnd = DocView::GetCurrentRenderWindow();
+ // control its scope). Also make sure we're in the Render window,
+ // this stops the cursor being hijacked when we pop.
+ wxWindow* pRenderWnd = DocView::GetCurrentRenderWindow();
+ wxPoint ptDontCare;
if( NULL != pRenderWnd )
- wxSetCursor(hCursor);
-
+ {
+ if( !fOnlyRendWnd || wxFindWindowAtPointer( ptDontCare ) == pRenderWnd )
+ wxSetCursor(hCursor);
+ else
+ wxSetCursor( *wxSTANDARD_CURSOR );
+ }
+
// If we have a RenderWindow and it doesn't have the capture then set its cursor
if( pRenderWnd != NULL && pCaptureWnd != pRenderWnd)
pRenderWnd->SetCursor(hCursor);
Xara