#include "wx/docview.h"
#include "wx/cmdproc.h"
#include "wx/vector.h"
+#include "wx/image.h"
// This sample is written to build both with wxUSE_STD_IOSTREAM==0 and 1, which
// somewhat complicates its code but is necessary in order to support building
{
public:
wxTextDocument() : wxDocument() { }
+
+ virtual bool OnCreate(const wxString& path, long flags);
+
virtual wxTextCtrl* GetTextCtrl() const = 0;
virtual bool IsModified() const;
virtual bool DoSaveDocument(const wxString& filename);
virtual bool DoOpenDocument(const wxString& filename);
+ void OnTextChange(wxCommandEvent& event);
+
wxDECLARE_NO_COPY_CLASS(wxTextDocument);
DECLARE_CLASS(wxTextDocument)
};
DECLARE_DYNAMIC_CLASS(TextEditDocument)
};
+// ----------------------------------------------------------------------------
+// A document class representing an image
+// ----------------------------------------------------------------------------
+
+class ImageDocument : public wxDocument
+{
+public:
+ ImageDocument() : wxDocument() { }
+
+ wxImage GetImage() const { return m_image; }
+
+protected:
+ virtual bool DoOpenDocument(const wxString& file);
+
+private:
+ wxImage m_image;
+
+ wxDECLARE_NO_COPY_CLASS(ImageDocument);
+ DECLARE_DYNAMIC_CLASS(ImageDocument)
+};
+
#endif // _WX_SAMPLES_DOCVIEW_DOC_H_