]>
git.saurik.com Git - wxWidgets.git/blob - samples/docvwmdi/doc.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Document classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/docview.h"
16 #include "wx/cmdproc.h"
18 // Plots a line from one point to the other
19 class DoodleLine
: public wxObject
28 // Contains a list of lines: represents a mouse-down doodle
29 class DoodleSegment
: public wxObject
34 DoodleSegment() : wxObject() {}
35 DoodleSegment(const DoodleSegment
&);
36 virtual ~DoodleSegment();
40 #if wxUSE_STD_IOSTREAM
41 wxSTD ostream
& SaveObject(wxSTD ostream
&);
42 wxSTD istream
& LoadObject(wxSTD istream
&);
44 wxOutputStream
& SaveObject(wxOutputStream
&);
45 wxInputStream
& LoadObject(wxInputStream
&);
49 class DrawingDocument
: public wxDocument
51 DECLARE_DYNAMIC_CLASS(DrawingDocument
)
53 wxList m_doodleSegments
;
55 DrawingDocument() : wxDocument() {}
56 virtual ~DrawingDocument();
58 #if wxUSE_STD_IOSTREAM
59 wxSTD ostream
& SaveObject(wxSTD ostream
&);
60 wxSTD istream
& LoadObject(wxSTD istream
&);
62 wxOutputStream
& SaveObject(wxOutputStream
&);
63 wxInputStream
& LoadObject(wxInputStream
&);
66 inline wxList
& GetDoodleSegments() const { return (wxList
&) m_doodleSegments
; };
72 class DrawingCommand
: public wxCommand
75 DoodleSegment
* m_segment
;
76 DrawingDocument
* m_doc
;
79 DrawingCommand(const wxString
& name
, int cmd
, DrawingDocument
*, DoodleSegment
*);
80 virtual ~DrawingCommand();
87 class TextEditDocument
: public wxDocument
89 DECLARE_DYNAMIC_CLASS(TextEditDocument
)
92 wxSTD ostream& SaveObject(wxSTD ostream&);
93 wxSTD istream& LoadObject(wxSTD istream&);
95 TextEditView
* GetFirstView() const;
97 virtual bool OnSaveDocument(const wxString
& filename
);
98 virtual bool OnOpenDocument(const wxString
& filename
);
99 virtual bool IsModified() const;
100 virtual void Modify(bool mod
);
102 TextEditDocument() {}
103 virtual ~TextEditDocument() {}