Ensure we don't reset the group parent if it wasn't set at the begining

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-10-31 23:31:35 +00:00
parent 256d6b81c5
commit 5cd9237f3a

View File

@@ -148,11 +148,14 @@ void wxDialog::DoShowModal()
WindowRef windowRef = (WindowRef) MacGetWindowRef(); WindowRef windowRef = (WindowRef) MacGetWindowRef();
WindowGroupRef windowGroup; WindowGroupRef windowGroup;
WindowGroupRef formerParentGroup; WindowGroupRef formerParentGroup;
bool resetGroupParent = false;
if ( GetParent() == NULL ) if ( GetParent() == NULL )
{ {
windowGroup = GetWindowGroup(windowRef) ; windowGroup = GetWindowGroup(windowRef) ;
formerParentGroup = GetWindowGroupParent( windowGroup ); formerParentGroup = GetWindowGroupParent( windowGroup );
SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) ); SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) );
resetGroupParent = true;
} }
BeginAppModalStateForWindow(windowRef) ; BeginAppModalStateForWindow(windowRef) ;
@@ -163,7 +166,7 @@ void wxDialog::DoShowModal()
} }
EndAppModalStateForWindow(windowRef) ; EndAppModalStateForWindow(windowRef) ;
if ( GetParent() == NULL ) if ( resetGroupParent )
{ {
SetWindowGroupParent( windowGroup , formerParentGroup ); SetWindowGroupParent( windowGroup , formerParentGroup );
} }