X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec157c8f95dfa40b19202a320e7a1d60995d2c8e..f94a81c084696210418b8709e8ab649a18465fa6:/src/cocoa/dialog.mm diff --git a/src/cocoa/dialog.mm b/src/cocoa/dialog.mm index e15c2937aa..d18483cc86 100644 --- a/src/cocoa/dialog.mm +++ b/src/cocoa/dialog.mm @@ -175,6 +175,14 @@ void wxDialog::EndModal(int retCode) Show(false); } +void wxDialog::EndDialog(int retCode) +{ + if(IsModal()) + EndModal(retCode); + else + Show(false); +} + void wxDialog::OnCloseWindow(wxCloseEvent& event) { // We'll send a Cancel message by default, @@ -216,7 +224,7 @@ void wxDialog::OnOK(wxCommandEvent& event) { if ( Validate() && TransferDataFromWindow() ) { - EndModal(wxID_OK); + EndDialog(wxID_OK); } } @@ -230,6 +238,6 @@ void wxDialog::OnApply(wxCommandEvent& event) void wxDialog::OnCancel(wxCommandEvent& event) { wxLogTrace(wxTRACE_COCOA,wxT("Cancelled!")); - EndModal(wxID_CANCEL); + EndDialog(wxID_CANCEL); }