]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/proplist.cpp
\\param -> \param
[wxWidgets.git] / src / generic / proplist.cpp
index f78601ef000d94f5cb61e00d159dc0a2bb9e8161..6f7fdd1a388f27916b00a1b0939704d83d538b8f 100644 (file)
@@ -808,6 +808,7 @@ IMPLEMENT_CLASS(wxPropertyListDialog, wxDialog)
 
 BEGIN_EVENT_TABLE(wxPropertyListDialog, wxDialog)
     EVT_BUTTON(wxID_CANCEL,                            wxPropertyListDialog::OnCancel)
+    EVT_CLOSE(wxPropertyListDialog::OnCloseWindow)
 END_EVENT_TABLE()
 
 wxPropertyListDialog::wxPropertyListDialog(wxPropertyListView *v, wxWindow *parent,
@@ -821,17 +822,19 @@ wxPropertyListDialog::wxPropertyListDialog(wxPropertyListView *v, wxWindow *pare
   SetAutoLayout(TRUE);
 }
 
-bool wxPropertyListDialog::OnClose(void)
+void wxPropertyListDialog::OnCloseWindow(wxCloseEvent& event)
 {
   if (m_view)
   {
        SetReturnCode(wxID_CANCEL);
     m_view->OnClose();
        m_view = NULL;
-       return TRUE;
+       this->Destroy();
   }
   else
-    return FALSE;
+  {
+    event.Veto();
+  }
 }
 
 void wxPropertyListDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
@@ -899,7 +902,11 @@ void wxPropertyListPanel::OnSize(wxSizeEvent& WXUNUSED(event))
  
 IMPLEMENT_CLASS(wxPropertyListFrame, wxFrame)
 
-bool wxPropertyListFrame::OnClose(void)
+BEGIN_EVENT_TABLE(wxPropertyListFrame, wxFrame)
+    EVT_CLOSE(wxPropertyListFrame::OnCloseWindow)
+END_EVENT_TABLE()
+
+void wxPropertyListFrame::OnCloseWindow(wxCloseEvent& event)
 {
   if (m_view)
   {
@@ -907,10 +914,12 @@ bool wxPropertyListFrame::OnClose(void)
         m_propertyPanel->SetView(NULL);
     m_view->OnClose();
     m_view = NULL;
-    return TRUE;
+    this->Destroy();
   }
   else
-    return FALSE;
+  {
+    event.Veto();
+  }
 }
 
 wxPropertyListPanel *wxPropertyListFrame::OnCreatePanel(wxFrame *parent, wxPropertyListView *v)
@@ -1704,7 +1713,7 @@ class wxPropertyStringListEditorDialog: public wxDialog
       m_currentSelection = -1;
     }
     ~wxPropertyStringListEditorDialog(void) {}
-    bool OnClose(void);
+    void OnCloseWindow(wxCloseEvent& event);
     void SaveCurrentSelection(void);
     void ShowCurrentSelection(void);
 
@@ -1736,6 +1745,7 @@ BEGIN_EVENT_TABLE(wxPropertyStringListEditorDialog, wxDialog)
     EVT_BUTTON(wxID_PROP_SL_DELETE,            wxPropertyStringListEditorDialog::OnDelete)
     EVT_LISTBOX(wxID_PROP_SL_STRINGS,  wxPropertyStringListEditorDialog::OnStrings)
     EVT_TEXT_ENTER(wxID_PROP_SL_TEXT,                  wxPropertyStringListEditorDialog::OnText)
+    EVT_CLOSE(wxPropertyStringListEditorDialog::OnCloseWindow)
 END_EVENT_TABLE()
 
 class wxPropertyStringListEditorText: public wxTextCtrl
@@ -1896,14 +1906,16 @@ void wxPropertyStringListEditorDialog::OnOK(wxCommandEvent& WXUNUSED(event))
 {
   SaveCurrentSelection();
   EndModal(wxID_OK);
-  Close(TRUE);
+  // Close(TRUE);
+  this->Destroy();
 }
 
 void wxPropertyStringListEditorDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
 {
   sm_dialogCancelled = TRUE;
   EndModal(wxID_CANCEL);
-  Close(TRUE);
+//  Close(TRUE);
+  this->Destroy();
 }
 
 void wxPropertyStringListEditorDialog::OnText(wxCommandEvent& event)
@@ -1914,10 +1926,10 @@ void wxPropertyStringListEditorDialog::OnText(wxCommandEvent& event)
   }
 }
 
-bool wxPropertyStringListEditorDialog::OnClose(void)
+void wxPropertyStringListEditorDialog::OnCloseWindow(wxCloseEvent& event)
 {
   SaveCurrentSelection();
-  return TRUE;
+  this->Destroy();
 }
 
 void wxPropertyStringListEditorDialog::SaveCurrentSelection(void)