Fix busy cursor handling in modal dialogs under MSW.
Modal dialogs shown during wxBusyCursor effect shouldn't show the busy cursor as they do accept input, but did in wxMSW (as could be seen in e.g. the widgets sample after enabling the "Global busy cursor" in the menu and showing the text entry dialog via "Text|Set Help Hint"). Fix this by explicitly checking for the special case of having a modal dialog as parent at wxWindow level as doing it in wxDialog simply didn't work as its WM_SETCURSOR handler wasn't called at all for determining the cursor to use for its children because they handled WM_SETCURSOR themselves in the global busy state, without letting DefWindowProc(), which propagates this message upwards the window hierarchy, to have it at all. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/dcmemory.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/layout.h"
|
||||
@@ -4198,7 +4199,20 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
|
||||
// 3. if still no cursor but we're in a TLW, set the global cursor
|
||||
|
||||
HCURSOR hcursor = 0;
|
||||
|
||||
// Check for "business" is complicated by the fact that modal dialogs shown
|
||||
// while busy cursor is in effect shouldn't show it as they are active and
|
||||
// accept input from the user, unlike all the other windows.
|
||||
bool isBusy = false;
|
||||
if ( wxIsBusy() )
|
||||
{
|
||||
wxDialog* const
|
||||
dlg = wxDynamicCast(wxGetTopLevelParent(this), wxDialog);
|
||||
if ( !dlg || !dlg->IsModal() )
|
||||
isBusy = true;
|
||||
}
|
||||
|
||||
if ( isBusy )
|
||||
{
|
||||
hcursor = wxGetCurrentBusyCursor();
|
||||
}
|
||||
|
Reference in New Issue
Block a user