wxDialog::~wxDialog()
{
+ m_isBeingDeleted = true;
+
+ // if the dialog is modal, this will end its event loop
+ Show(false);
+
delete m_eventLoop;
}
void wxDialog::OnApply(wxCommandEvent &WXUNUSED(event))
{
- if ( Validate() )
+ if ( Validate() )
TransferDataFromWindow();
}
EndModal(wxID_CANCEL);
}
+ if (show && CanDoLayoutAdaptation())
+ DoLayoutAdaptation();
+
bool ret = wxDialogBase::Show(show);
- if ( show )
+ if ( show )
InitDialog();
return ret;
// forbidden
if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
{
- wxWindow *parent = wxTheApp->GetTopWindow();
+ wxWindow * const parent = GetParentForModalDialog();
if ( parent && parent != this )
{
m_parent = parent;