- wxModalDialogs.Append(this);
- if (pOldFocus)
- hWndOldFocus = (HWND)pOldFocus->GetHWND();
-
- //
- // Remember where the focus was
- //
- if (!pOldFocus)
- {
- pOldFocus = pParent;
- if (pParent)
- hWndOldFocus = GetHwndOf(pParent);
- }
-
- //
- // Disable all other app windows
- //
- wxASSERT_MSG(!m_pWindowDisabler, _T("disabling windows twice?"));
-
- m_pWindowDisabler = new wxWindowDisabler(this);
-
- //
- // Enter the modal loop
- //
- while ( IsModalShowing() )
- {
-#if wxUSE_THREADS
- wxMutexGuiLeaveOrEnter();
-#endif // wxUSE_THREADS
-
- while ( !wxTheApp->Pending() && wxTheApp->ProcessIdle() )
- ;
-
- // a message came or no more idle processing to do
- wxTheApp->DoMessage();
- }
-
- //
- // Snd restore focus
- // Note that this code MUST NOT access the dialog object's data
- // in case the object has been deleted (which will be the case
- // for a modal dialog that has been destroyed before calling EndModal).
- //
- if (pOldFocus && (pOldFocus != this) && ::WinIsWindow(vHabmain, hWndOldFocus))
- {
- //
- // This is likely to prove that the object still exists
- //
- if (wxFindWinFromHandle((WXHWND) hWndOldFocus) == pOldFocus)
- pOldFocus->SetFocus();
- }
-} // end of wxDialog::DoShowModal
-
-bool wxDialog::Show(
- bool bShow
-)