fixed showing busy cursor for disabled windows and during wxExecute()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-07-13 14:09:08 +00:00
parent d3c58c7ec0
commit 46753a7ce5
2 changed files with 40 additions and 47 deletions

View File

@@ -199,6 +199,7 @@ wxMSW:
- Added msw.font.no-proof-quality system option, see manual for description - Added msw.font.no-proof-quality system option, see manual for description
- Fix appearance of notebook with non-top tabs under Windows Vista - Fix appearance of notebook with non-top tabs under Windows Vista
- Fixed bug with symbol resolving in wxStackWalker (Axel Gembe) - Fixed bug with symbol resolving in wxStackWalker (Axel Gembe)
- Fixed showing busy cursor for disabled windows and during wxExecute()
wxGTK: wxGTK:

View File

@@ -3810,19 +3810,20 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
{ {
#ifndef __WXMICROWIN__ #ifndef __WXMICROWIN__
// the logic is as follows: // the logic is as follows:
// -1. don't set cursor for non client area, including but not limited to // 0. if we're busy, set the busy cursor (even for non client elements)
// the title bar, scrollbars, &c // 1. don't set custom cursor for non client area of enabled windows
// 0. allow the user to override default behaviour by using EVT_SET_CURSOR // 2. ask user EVT_SET_CURSOR handler for the cursor
// 1. if we have the cursor set it unless wxIsBusy() // 3. if still no cursor but we're in a TLW, set the global cursor
// 2. if we're a top level window, set some cursor anyhow
// 3. if wxIsBusy(), set the busy cursor, otherwise the global one
if ( nHitTest != HTCLIENT )
{
return false;
}
HCURSOR hcursor = 0; HCURSOR hcursor = 0;
if ( wxIsBusy() )
{
hcursor = wxGetCurrentBusyCursor();
}
else // not busy
{
if ( nHitTest != HTCLIENT )
return false;
// first ask the user code - it may wish to set the cursor in some very // first ask the user code - it may wish to set the cursor in some very
// specific way (for example, depending on the current position) // specific way (for example, depending on the current position)
@@ -3849,24 +3850,16 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
if ( !hcursor ) if ( !hcursor )
{ {
bool isBusy = wxIsBusy(); // the test for processedEvtSetCursor is here to prevent using
// m_cursor if the user code caught EVT_SET_CURSOR() and returned
// the test for processedEvtSetCursor is here to prevent using m_cursor // nothing from it - this is a way to say that our cursor shouldn't
// if the user code caught EVT_SET_CURSOR() and returned nothing from // be used for this point
// it - this is a way to say that our cursor shouldn't be used for this
// point
if ( !processedEvtSetCursor && m_cursor.Ok() ) if ( !processedEvtSetCursor && m_cursor.Ok() )
{ {
hcursor = GetHcursorOf(m_cursor); hcursor = GetHcursorOf(m_cursor);
} }
if ( !GetParent() ) if ( !hcursor && !GetParent() )
{
if ( isBusy )
{
hcursor = wxGetCurrentBusyCursor();
}
else if ( !hcursor )
{ {
const wxCursor *cursor = wxGetGlobalCursor(); const wxCursor *cursor = wxGetGlobalCursor();
if ( cursor && cursor->Ok() ) if ( cursor && cursor->Ok() )
@@ -3877,10 +3870,9 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
} }
} }
if ( hcursor ) if ( hcursor )
{ {
// wxLogDebug("HandleSetCursor: Setting cursor %ld", (long) hcursor);
::SetCursor(hcursor); ::SetCursor(hcursor);
// cursor set, stop here // cursor set, stop here