// Author: Julian Smart
// Modified by: Vadim Zeitlin: merge with the MDI version and general cleanup
// Created: 04/01/98
-// RCS-ID: $Id$
// Copyright: (c) 1998 Julian Smart
// (c) 2008 Vadim Zeitlin
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SAMPLES_DOCVIEW_VIEW_H_
public:
// view may be NULL if we're not associated with one yet, but parent must
// be a valid pointer
- MyCanvas(wxView *view, wxWindow *parent);
+ MyCanvas(wxView *view, wxWindow *parent = NULL);
virtual ~MyCanvas();
virtual void OnDraw(wxDC& dc);
class DrawingView : public wxView
{
public:
- DrawingView() { m_canvas = NULL; m_frame = NULL; }
+ DrawingView() : wxView(), m_canvas(NULL) {}
virtual bool OnCreate(wxDocument *doc, long flags);
virtual void OnDraw(wxDC *dc);
private:
void OnCut(wxCommandEvent& event);
- wxFrame *m_frame;
MyCanvas *m_canvas;
DECLARE_EVENT_TABLE()
class TextEditView : public wxView
{
public:
- TextEditView() : wxView() { m_frame = NULL; m_text = NULL; }
+ TextEditView() : wxView(), m_text(NULL) {}
virtual bool OnCreate(wxDocument *doc, long flags);
virtual void OnDraw(wxDC *dc);
void OnPaste(wxCommandEvent& WXUNUSED(event)) { m_text->Paste(); }
void OnSelectAll(wxCommandEvent& WXUNUSED(event)) { m_text->SelectAll(); }
- wxFrame *m_frame;
wxTextCtrl *m_text;
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(TextEditView)
};
+// ----------------------------------------------------------------------------
+// ImageCanvas
+// ----------------------------------------------------------------------------
+
+class ImageCanvas : public wxScrolledWindow
+{
+public:
+ ImageCanvas(wxView*);
+
+ virtual void OnDraw(wxDC& dc);
+private:
+ wxView *m_view;
+};
+
+// ----------------------------------------------------------------------------
+// ImageView
+// ----------------------------------------------------------------------------
+
+class ImageView : public wxView
+{
+public:
+ ImageView() : wxView() {}
+
+ virtual bool OnCreate(wxDocument*, long flags);
+ virtual void OnDraw(wxDC*);
+ virtual bool OnClose(bool deleteWindow = true);
+ virtual void OnUpdate(wxView *sender, wxObject *hint = NULL);
+
+ ImageDocument* GetDocument();
+
+private:
+ ImageCanvas* m_canvas;
+
+ DECLARE_DYNAMIC_CLASS(ImageView)
+};
+
+// ----------------------------------------------------------------------------
+// ImageDetailsView
+// ----------------------------------------------------------------------------
+
+class ImageDetailsView : public wxView
+{
+public:
+ ImageDetailsView(ImageDetailsDocument *doc);
+
+ virtual void OnDraw(wxDC *dc);
+ virtual bool OnClose(bool deleteWindow);
+
+private:
+ wxFrame *m_frame;
+
+ wxDECLARE_NO_COPY_CLASS(ImageDetailsView);
+};
+
#endif // _WX_SAMPLES_DOCVIEW_VIEW_H_