Allow saving images under a different name in the image sample.

Also allow saving in XPM format.

See #13905.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-07-11 11:42:47 +00:00
parent 8b23d3b067
commit e3e7f6e573

View File

@@ -150,7 +150,7 @@ private:
m_zoom = 1.; m_zoom = 1.;
wxMenu *menu = new wxMenu; wxMenu *menu = new wxMenu;
menu->Append(wxID_SAVE); menu->Append(wxID_SAVEAS);
menu->AppendSeparator(); menu->AppendSeparator();
menu->AppendCheckItem(ID_PAINT_BG, wxT("&Paint background"), menu->AppendCheckItem(ID_PAINT_BG, wxT("&Paint background"),
"Uncheck this for transparent images"); "Uncheck this for transparent images");
@@ -214,7 +214,7 @@ private:
wxString savefilename = wxFileSelector( wxT("Save Image"), wxString savefilename = wxFileSelector( wxT("Save Image"),
wxEmptyString, wxEmptyString,
wxEmptyString, wxEmptyString,
(const wxChar *)NULL, wxEmptyString,
wxT("BMP files (*.bmp)|*.bmp|") wxT("BMP files (*.bmp)|*.bmp|")
#if wxUSE_LIBPNG #if wxUSE_LIBPNG
wxT("PNG files (*.png)|*.png|") wxT("PNG files (*.png)|*.png|")
@@ -230,10 +230,13 @@ private:
#endif #endif
#if wxUSE_PCX #if wxUSE_PCX
wxT("PCX files (*.pcx)|*.pcx|") wxT("PCX files (*.pcx)|*.pcx|")
#endif
#if wxUSE_XPM
wxT("X PixMap files (*.xpm)|*.xpm|")
#endif #endif
wxT("ICO files (*.ico)|*.ico|") wxT("ICO files (*.ico)|*.ico|")
wxT("CUR files (*.cur)|*.cur"), wxT("CUR files (*.cur)|*.cur"),
wxFD_SAVE, wxFD_SAVE | wxFD_OVERWRITE_PROMPT,
this); this);
if ( savefilename.empty() ) if ( savefilename.empty() )
@@ -590,7 +593,7 @@ BEGIN_EVENT_TABLE(MyImageFrame, wxFrame)
EVT_ERASE_BACKGROUND(MyImageFrame::OnEraseBackground) EVT_ERASE_BACKGROUND(MyImageFrame::OnEraseBackground)
EVT_PAINT(MyImageFrame::OnPaint) EVT_PAINT(MyImageFrame::OnPaint)
EVT_MENU(wxID_SAVE, MyImageFrame::OnSave) EVT_MENU(wxID_SAVEAS, MyImageFrame::OnSave)
EVT_MENU_RANGE(ID_ROTATE_LEFT, ID_ROTATE_RIGHT, MyImageFrame::OnRotate) EVT_MENU_RANGE(ID_ROTATE_LEFT, ID_ROTATE_RIGHT, MyImageFrame::OnRotate)
EVT_MENU(ID_RESIZE, MyImageFrame::OnResize) EVT_MENU(ID_RESIZE, MyImageFrame::OnResize)