+ filename = wxFileSelector(_T("Select image file"));
+ if ( !filename.empty() )
+ {
+ if ( !image.LoadFile(filename) )
+ {
+ wxLogError(_T("Couldn't load image from '%s'."), filename.c_str());
+
+ return wxEmptyString;
+ }
+ }
+#endif // wxUSE_FILEDLG
+
+ return filename;
+}
+
+void MyFrame::OnNewFrame( wxCommandEvent &WXUNUSED(event) )
+{
+ wxImage image;
+ wxString filename = LoadUserImage(image);
+ if ( !filename.empty() )
+ (new MyImageFrame(this, filename, wxBitmap(image)))->Show();
+}