Applied #10811: Image in docview sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#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
|
||||
@@ -196,4 +197,34 @@ public:
|
||||
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_
|
||||
|
Reference in New Issue
Block a user