+}
+
+void ImageView::OnDraw(wxDC* dc)
+{
+ wxImage image = GetDocument()->GetImage();
+ if ( image.IsOk() )
+ {
+ dc->DrawBitmap(wxBitmap(image), 0, 0, true /* use mask */);
+ }
+}
+
+bool ImageView::OnClose(bool deleteWindow)
+{
+ if ( !wxView::OnClose(deleteWindow) )
+ return false;
+
+ Activate(false);
+
+ if ( wxGetApp().GetMode() == MyApp::Mode_Single )
+ {
+ GetDocument()->DeleteContents();
+ }
+ else // not single window mode
+ {
+ if ( deleteWindow )
+ {
+ GetFrame()->Destroy();
+ SetFrame(NULL);
+ }
+ }
+ return true;
+}
+
+// ----------------------------------------------------------------------------
+// ImageDetailsView
+// ----------------------------------------------------------------------------
+
+ImageDetailsView::ImageDetailsView(ImageDetailsDocument *doc)
+ : wxView()
+{
+ SetDocument(doc);
+
+ m_frame = wxGetApp().CreateChildFrame(this, false);
+ m_frame->SetTitle("Image Details");
+
+ wxPanel * const panel = new wxPanel(m_frame);
+ wxFlexGridSizer * const sizer = new wxFlexGridSizer(2, wxSize(5, 5));
+ const wxSizerFlags
+ flags = wxSizerFlags().Align(wxALIGN_CENTRE_VERTICAL).Border();
+
+ sizer->Add(new wxStaticText(panel, wxID_ANY, "Image &file:"), flags);
+ sizer->Add(new wxStaticText(panel, wxID_ANY, doc->GetFilename()), flags);
+
+ sizer->Add(new wxStaticText(panel, wxID_ANY, "Image &type:"), flags);
+ wxString typeStr;
+ switch ( doc->GetType() )