X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/abceee76ea4d642ccfd3cf91cc139a3fe2b471b7..b0230a69bcf6db9a18bbdefb0c3027c6a438ed55:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index a9849ee218..480836f8f9 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -70,8 +70,6 @@ wxWindowList wxModelessWindows; // all modal dialogs currently shown static wxWindowList wxModalDialogs; -static wxWindow *m_oldFocus; - // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -100,6 +98,7 @@ END_EVENT_TABLE() wxDialog::wxDialog() { + m_oldFocus = (wxWindow *)NULL; m_isShown = FALSE; SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE)); @@ -531,13 +530,28 @@ long wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) case WM_SETCURSOR: // we want to override the busy cursor for modal dialogs: // typically, wxBeginBusyCursor() is called and then a modal dialog - // is shown, but the modal dialog shouldn't have this cursor - if ( wxIsBusy() ) + // is shown, but the modal dialog shouldn't have hourglass cursor + if ( IsModalShowing() && wxIsBusy() ) { - rc = TRUE; + // set our cursor for all windows (but see below) + wxCursor cursor = m_cursor; + if ( !cursor.Ok() ) + cursor = wxCURSOR_ARROW; + + ::SetCursor(GetHcursorOf(cursor)); + // in any case, stop here and don't let wxWindow process this + // message (it would set the busy cursor) processed = TRUE; + + // but return FALSE to tell the child window (if the event + // comes from one of them and not from ourselves) that it can + // set its own cursor if it has one: thus, standard controls + // (e.g. text ctrl) still have correct cursors in a dialog + // invoked while wxIsBusy() + rc = FALSE; } + break; } if ( !processed )