]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/dialog.mm
wxTinderbox build fix.
[wxWidgets.git] / src / cocoa / dialog.mm
index e15c2937aa8eaaf96ba5c66f16fde91958dbeba7..d18483cc868d4b17b052ff37b756fde1f448a4bf 100644 (file)
@@ -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);
 }