- 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) ;
-
- wxEventLoopGuarantor ensureHasLoop;
- wxEventLoopBase * const loop = wxEventLoop::GetActive();
- while ( IsModal() )
- loop->Dispatch();