]>
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 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __DOCSAMPLEH__
13 #define __DOCSAMPLEH__
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(void){};
35 DoodleSegment(const DoodleSegment
& seg
);
40 #if wxUSE_STD_IOSTREAM
41 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
42 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
44 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
45 wxInputStream
& LoadObject(wxInputStream
& stream
);
49 class DrawingDocument
: public wxDocument
51 DECLARE_DYNAMIC_CLASS(DrawingDocument
)
54 wxList doodleSegments
;
56 DrawingDocument(void){};
57 ~DrawingDocument(void);
59 #if wxUSE_STD_IOSTREAM
60 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
61 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
63 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
64 wxInputStream
& LoadObject(wxInputStream
& stream
);
67 inline wxList
& GetDoodleSegments(void) const { return (wxList
&) doodleSegments
; };
73 class DrawingCommand
: public wxCommand
76 DoodleSegment
*segment
;
80 DrawingCommand(const wxString
& name
, int cmd
, DrawingDocument
*ddoc
, DoodleSegment
*seg
);
81 ~DrawingCommand(void);
87 class TextEditDocument
: public wxDocument
89 DECLARE_DYNAMIC_CLASS(TextEditDocument
)
93 wxSTD ostream& SaveObject(wxSTD ostream& stream);
94 wxSTD istream& LoadObject(wxSTD istream& stream);
96 virtual bool OnSaveDocument(const wxString
& filename
);
97 virtual bool OnOpenDocument(const wxString
& filename
);
98 virtual bool IsModified(void) const;
99 virtual void Modify(bool mod
);
101 TextEditDocument(void) {}
102 ~TextEditDocument(void) {}