virtual void SetFilename(const wxString& name);
virtual void SetWildcard(const wxString& wildCard);
virtual void SetFilterIndex(int filterIndex);
-
+
+//private:
+ bool m_destroyed_by_delete;
+
void UpdateFromDialog();
-private:
void UpdateDialog();
DECLARE_DYNAMIC_CLASS(wxFileDialog)
virtual void SetFilename(const wxString& name);
virtual void SetWildcard(const wxString& wildCard);
virtual void SetFilterIndex(int filterIndex);
-
+
+//private:
+ bool m_destroyed_by_delete;
+
void UpdateFromDialog();
-private:
void UpdateDialog();
DECLARE_DYNAMIC_CLASS(wxFileDialog)
if (response == GTK_RESPONSE_ACCEPT)
gtk_filedialog_ok_callback(w, dialog);
- else
+ else if (response == GTK_RESPONSE_CANCEL)
+ gtk_filedialog_cancel_callback(w, dialog);
+ else // "delete"
+ {
gtk_filedialog_cancel_callback(w, dialog);
+ dialog->m_destroyed_by_delete = TRUE;
+ }
}
//-----------------------------------------------------------------------------
wildCard, style, pos)
{
m_needParent = FALSE;
+ m_destroyed_by_delete = FALSE;
if (!PreCreation(parent, pos, wxDefaultSize) ||
!CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,
wxFileDialog::~wxFileDialog()
{
+ if (m_destroyed_by_delete)
+ m_widget = NULL;
}
void wxFileDialog::GetFilenames(wxArrayString& files) const
if (response == GTK_RESPONSE_ACCEPT)
gtk_filedialog_ok_callback(w, dialog);
- else
+ else if (response == GTK_RESPONSE_CANCEL)
+ gtk_filedialog_cancel_callback(w, dialog);
+ else // "delete"
+ {
gtk_filedialog_cancel_callback(w, dialog);
+ dialog->m_destroyed_by_delete = TRUE;
+ }
}
//-----------------------------------------------------------------------------
wildCard, style, pos)
{
m_needParent = FALSE;
+ m_destroyed_by_delete = FALSE;
if (!PreCreation(parent, pos, wxDefaultSize) ||
!CreateBase(parent, wxID_ANY, pos, wxDefaultSize, style,
wxFileDialog::~wxFileDialog()
{
+ if (m_destroyed_by_delete)
+ m_widget = NULL;
}
void wxFileDialog::GetFilenames(wxArrayString& files) const