fixed assertion failure if Ok or Cancel button is clicked in a modeless dialog (bug 973873)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -113,6 +113,9 @@ protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// end either modal or modeless dialog
|
||||
void EndDialog(int rc);
|
||||
|
||||
private:
|
||||
wxWindow* m_oldFocus;
|
||||
bool m_endModalCalled; // allow for closing within InitDialog
|
||||
|
@@ -368,7 +368,15 @@ void wxDialog::EndModal(int retCode)
|
||||
m_endModalCalled = true;
|
||||
SetReturnCode(retCode);
|
||||
|
||||
Show(false);
|
||||
Hide();
|
||||
}
|
||||
|
||||
void wxDialog::EndDialog(int rc)
|
||||
{
|
||||
if ( IsModal() )
|
||||
EndModal(rc);
|
||||
else
|
||||
Hide();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -380,7 +388,7 @@ void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if ( Validate() && TransferDataFromWindow() )
|
||||
{
|
||||
EndModal(wxID_OK);
|
||||
EndDialog(wxID_OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,7 +402,7 @@ void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
EndModal(wxID_CANCEL);
|
||||
EndDialog(wxID_CANCEL);
|
||||
}
|
||||
|
||||
void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
|
Reference in New Issue
Block a user