#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);
- DECLARE_NO_COPY_CLASS(wxTextDocument)
+ void OnTextChange(wxCommandEvent& event);
+
+ wxDECLARE_NO_COPY_CLASS(wxTextDocument);
DECLARE_CLASS(wxTextDocument)
};
TextEditDocument() : wxTextDocument() { }
virtual wxTextCtrl* GetTextCtrl() const;
- DECLARE_NO_COPY_CLASS(TextEditDocument)
+ wxDECLARE_NO_COPY_CLASS(TextEditDocument);
DECLARE_DYNAMIC_CLASS(TextEditDocument)
};
+// ----------------------------------------------------------------------------
+// A basic image document class
+// ----------------------------------------------------------------------------
+
+class wxImageDocument : public wxDocument
+{
+protected:
+ wxImage m_image;
+public:
+ wxImageDocument();
+
+ wxImage* GetImage() { return &m_image; }
+ const wxImage& GetImage() const { return m_image; }
+
+ bool SaveFile(wxOutputStream*, wxBitmapType) const;
+
+public:
+ virtual ~wxImageDocument();
+ virtual bool DeleteContents();
+
+ virtual bool DoOpenDocument(const wxString& file);
+ virtual bool DoSaveDocument(const wxString& file);
+
+ virtual bool DoOpenDocument(wxInputStream*);
+ virtual bool DoSaveDocument(wxOutputStream*) const;
+
+ wxDECLARE_NO_COPY_CLASS(wxImageDocument);
+ DECLARE_DYNAMIC_CLASS(wxImageDocument)
+};
+
#endif // _WX_SAMPLES_DOCVIEW_DOC_H_