- wxCHECK_RET( !IsModal(), wxT("DoShowModal() called twice") );
-
- wxModalDialogs.Append(this);
-
- SetFocus() ;
-
- WindowRef windowRef = (WindowRef) GetWXWindow();
- WindowGroupRef windowGroup = NULL;
- WindowGroupRef formerParentGroup = NULL;
- bool resetGroupParent = false;
-
- if ( GetParent() == NULL )
- {
- windowGroup = GetWindowGroup(windowRef) ;
- formerParentGroup = GetWindowGroupParent( windowGroup );
- SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
- resetGroupParent = true;
- }
- BeginAppModalStateForWindow(windowRef) ;
-
- wxEventLoop * const
- loop = static_cast<wxEventLoop *>(wxEventLoop::GetActive());
-
-
- wxASSERT_MSG( loop , wxT("No Event Loop in place") );
-
- if ( loop )
- {
- while ( IsModal() )
- loop->Dispatch();
- }