wxSetCursor() bug with splitters corrected

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-02-27 01:33:05 +00:00
parent ed93168bf9
commit f4621a09f0
3 changed files with 27 additions and 20 deletions

View File

@@ -169,6 +169,7 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, cons
m_leftCanvas = new MyCanvas(m_splitter, CANVAS1, 0, 0, 400, 400); m_leftCanvas = new MyCanvas(m_splitter, CANVAS1, 0, 0, 400, 400);
m_leftCanvas->SetBackgroundColour(*wxRED); m_leftCanvas->SetBackgroundColour(*wxRED);
m_leftCanvas->SetScrollbars(20, 20, 50, 50); m_leftCanvas->SetScrollbars(20, 20, 50, 50);
m_leftCanvas->SetCursor(wxCursor(wxCURSOR_MAGNIFIER));
m_rightCanvas = new MyCanvas(m_splitter, CANVAS2, 0, 0, 400, 400); m_rightCanvas = new MyCanvas(m_splitter, CANVAS2, 0, 0, 400, 400);
m_rightCanvas->SetBackgroundColour(*wxCYAN); m_rightCanvas->SetBackgroundColour(*wxCYAN);

View File

@@ -11,7 +11,6 @@
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "splitter.h" #pragma implementation "splitter.h"
// #pragma interface
#endif #endif
// For compilers that support precompilation, includes "wx.h". // For compilers that support precompilation, includes "wx.h".
@@ -146,6 +145,9 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
long x, y; long x, y;
event.Position(&x, &y); event.Position(&x, &y);
// reset the cursor
SetCursor(wxCursor());
if (event.LeftDown()) if (event.LeftDown())
{ {
if ( SashHitTest(x, y) ) if ( SashHitTest(x, y) )
@@ -243,10 +245,6 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
SetCursor(*m_sashCursorNS); SetCursor(*m_sashCursorNS);
} }
} }
else
{
SetCursor(*wxSTANDARD_CURSOR);
}
} }
else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING)) else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING))
{ {

View File

@@ -1495,16 +1495,24 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
hcursor = gs_wxBusyCursor; hcursor = gs_wxBusyCursor;
} }
else if ( m_windowCursor.Ok() ) else
{ {
hcursor = (HCURSOR)m_windowCursor.GetHCURSOR(); wxCursor *cursor = NULL;
if ( m_windowCursor.Ok() )
{
cursor = &m_windowCursor;
} }
else else
{ {
extern wxCursor *g_globalCursor; // from msw\data.cpp extern wxCursor *g_globalCursor; // from msw\data.cpp
if ( g_globalCursor && g_globalCursor->Ok() ) if ( g_globalCursor && g_globalCursor->Ok() )
hcursor = (HCURSOR)g_globalCursor->GetHCURSOR(); cursor = g_globalCursor;
}
if ( cursor )
hcursor = (HCURSOR)cursor->GetHCURSOR();
} }
if ( hcursor ) if ( hcursor )
@@ -1512,8 +1520,8 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
::SetCursor(hcursor); ::SetCursor(hcursor);
// returning TRUE stops the DefWindowProc() from further // returning TRUE stops the DefWindowProc() from further
// processing this message - exactly what we need because // processing this message - exactly what we need because we've
// we've just set the cursor // just set the cursor.
return TRUE; return TRUE;
} }
} }