]>
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 and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #ifndef __DOCSAMPLEH__
17 #define __DOCSAMPLEH__
19 #include "wx/docview.h"
21 // Plots a line from one point to the other
22 class DoodleLine
: public wxObject
31 // Contains a list of lines: represents a mouse-down doodle
32 class DoodleSegment
: public wxObject
38 DoodleSegment(DoodleSegment
& seg
);
43 #if wxUSE_STD_IOSTREAM
44 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
45 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
47 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
48 wxInputStream
& LoadObject(wxInputStream
& stream
);
52 class DrawingDocument
: public wxDocument
54 DECLARE_DYNAMIC_CLASS(DrawingDocument
)
57 wxList doodleSegments
;
59 DrawingDocument(void);
60 ~DrawingDocument(void);
62 #if wxUSE_STD_IOSTREAM
63 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
64 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
66 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
67 wxInputStream
& LoadObject(wxInputStream
& stream
);
70 inline wxList
& GetDoodleSegments(void) const { return (wxList
&) doodleSegments
; };
76 class DrawingCommand
: public wxCommand
79 DoodleSegment
*segment
;
83 DrawingCommand(const wxString
& name
, int cmd
, DrawingDocument
*ddoc
, DoodleSegment
*seg
);
84 ~DrawingCommand(void);
90 class TextEditDocument
: public wxDocument
92 DECLARE_DYNAMIC_CLASS(TextEditDocument
)
96 wxSTD ostream& SaveObject(wxSTD ostream& stream);
97 wxSTD istream& LoadObject(wxSTD istream& stream);
99 virtual bool OnSaveDocument(const wxString
& filename
);
100 virtual bool OnOpenDocument(const wxString
& filename
);
101 virtual bool IsModified(void) const;
102 virtual void Modify(bool mod
);
104 TextEditDocument(void) {}
105 ~TextEditDocument(void) {}