Hi I have two small fixes to the bool cbEditor::SaveAs() function.
1. Wrong parent for the wxFileDialog.
2. Forgot to destroy it (allocated with new need to use wxWindow::Destroy()). :wink:
Proposed patch is below.
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 2388)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -882,12 +882,12 @@
{
wxFileName fname;
fname.Assign(m_Filename);
- wxFileDialog* dlg = new wxFileDialog(this,
- _("Save file"),
- fname.GetPath(),
- fname.GetFullName(),
- FileFilters::GetFilterString(),
- wxSAVE | wxOVERWRITE_PROMPT);
+ wxFileDialog* dlg = new wxFileDialog(Manager::Get()->GetAppWindow(),
+ _("Save file"),
+ fname.GetPath(),
+ fname.GetFullName(),
+ FileFilters::GetFilterString(),
+ wxSAVE | wxOVERWRITE_PROMPT);
PlaceWindow(dlg);
if (dlg->ShowModal() != wxID_OK)
@@ -901,6 +901,9 @@
m_IsOK = true;
SetModified(true);
SetLanguage( HL_AUTO );
+
+ dlg->Destroy();
+
return Save();
}
EDIT:
Posted at BerliOS
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1016&group_id=5358