X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/227869da8d090e2364530dd310e2d63ad18edecf..037267e1560a48434bd4e553389c679283500f1c:/src/generic/proplist.cpp diff --git a/src/generic/proplist.cpp b/src/generic/proplist.cpp index f78601ef00..6f7fdd1a38 100644 --- a/src/generic/proplist.cpp +++ b/src/generic/proplist.cpp @@ -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)