34 #include <wx/docview.h>
45 #if wxCHECK_VERSION(3, 0, 0)
46 #define wxSAVE wxFD_SAVE
47 #define wxOVERWRITE_PROMPT wxFD_OVERWRITE_PROMPT
77 wxView*
view = wxGetApp().docManager()->GetCurrentView();
82 wxString message = _T(
"Export processor figure.");
83 wxString defaultDir = _T(
".");
84 wxString defaultFile= _T(
"");
85 #if wxCHECK_VERSION(3, 0, 0)
86 wxString fileTypes = _T(
"Scalable Vector Graphics (.svg)|*.svg|");
88 wxString fileTypes = _T(
"Encapsulated Postscript (.eps)|*.eps;*.epsi|");
90 fileTypes.Append(_T(
"Portable Network Graphics (.png)|*.png"));
93 parentWindow(), message, defaultDir, defaultFile, fileTypes,
94 wxSAVE | wxOVERWRITE_PROMPT);
96 if (dialog.ShowModal() == wxID_CANCEL) {
102 std::string creator =
"TTA Processor Designer";
106 #if wxCHECK_VERSION(3, 0, 0)
107 if (extension ==
".svg") {
108 if (!canvas->saveSVG(filename)) {
110 if (extension ==
".eps" || extension ==
".epsi") {
111 if (!canvas->
saveEPS(filename, title, creator)) {
113 wxString message = _T(
"Error saving file '");
114 message.Append(dialog.GetPath());
115 message.Append(_T(
"'."));
117 errorDialog.ShowModal();
119 }
else if (extension ==
".png") {
120 if (!canvas->
savePNG(filename)) {
121 wxString message = _T(
"Error saving file '");
122 message.Append(dialog.GetPath());
123 message.Append(_T(
"'."));
125 errorDialog.ShowModal();
128 wxString message = _T(
"File type with extension '");
130 message.Append(_T(
"' is not supported."));
170 wxView*
view = wxGetApp().docManager()->GetCurrentView();