BEGIN_EVENT_TABLE(wxPropertyListDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, wxPropertyListDialog::OnCancel)
+ EVT_CLOSE(wxPropertyListDialog::OnCloseWindow)
END_EVENT_TABLE()
wxPropertyListDialog::wxPropertyListDialog(wxPropertyListView *v, wxWindow *parent,
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))
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)
{
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)
if (!view->GetValueText())
return;
- char *s = wxFileSelector(
+ wxString s = wxFileSelector(
m_filenameMessage.GetData(),
wxPathOnly(property->GetValue().StringValue()),
wxFileNameFromPath(property->GetValue().StringValue()),
m_filenameWildCard.GetData(),
0,
parentWindow);
- if (s)
+ if (s != "")
{
- property->GetValue() = wxString(s);
+ property->GetValue() = s;
view->DisplayProperty(property);
view->UpdatePropertyDisplayInList(property);
view->OnPropertyChanged(property);
m_currentSelection = -1;
}
~wxPropertyStringListEditorDialog(void) {}
- bool OnClose(void);
+ void OnCloseWindow(wxCloseEvent& event);
void SaveCurrentSelection(void);
void ShowCurrentSelection(void);
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
{
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)
{
- if (event.GetEventType() == wxEVENT_TYPE_TEXT_ENTER_COMMAND)
+ if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER)
{
SaveCurrentSelection();
}
}
-bool wxPropertyStringListEditorDialog::OnClose(void)
+void wxPropertyStringListEditorDialog::OnCloseWindow(wxCloseEvent& event)
{
SaveCurrentSelection();
- return TRUE;
+ this->Destroy();
}
void wxPropertyStringListEditorDialog::SaveCurrentSelection(void)