]>
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 /////////////////////////////////////////////////////////////////////////////
16 #ifndef __DOCSAMPLEH__
17 #define __DOCSAMPLEH__
19 #include "wx/docview.h"
20 #include "wx/cmdproc.h"
22 // Plots a line from one point to the other
23 class DoodleLine
: public wxObject
32 // Contains a list of lines: represents a mouse-down doodle
33 class DoodleSegment
: public wxObject
39 DoodleSegment(DoodleSegment
& seg
);
44 #if wxUSE_STD_IOSTREAM
45 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
46 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
48 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
49 wxInputStream
& LoadObject(wxInputStream
& stream
);
53 class DrawingDocument
: public wxDocument
55 DECLARE_DYNAMIC_CLASS(DrawingDocument
)
58 wxList doodleSegments
;
60 DrawingDocument(void);
61 ~DrawingDocument(void);
63 #if wxUSE_STD_IOSTREAM
64 wxSTD ostream
& SaveObject(wxSTD ostream
& text_stream
);
65 wxSTD istream
& LoadObject(wxSTD istream
& text_stream
);
67 wxOutputStream
& SaveObject(wxOutputStream
& stream
);
68 wxInputStream
& LoadObject(wxInputStream
& stream
);
71 inline wxList
& GetDoodleSegments(void) const { return (wxList
&) doodleSegments
; };
77 class DrawingCommand
: public wxCommand
80 DoodleSegment
*segment
;
84 DrawingCommand(const wxString
& name
, int cmd
, DrawingDocument
*ddoc
, DoodleSegment
*seg
);
85 ~DrawingCommand(void);
91 class TextEditDocument
: public wxDocument
93 DECLARE_DYNAMIC_CLASS(TextEditDocument
)
97 wxSTD ostream& SaveObject(wxSTD ostream& stream);
98 wxSTD istream& LoadObject(wxSTD istream& stream);
100 virtual bool OnSaveDocument(const wxString
& filename
);
101 virtual bool OnOpenDocument(const wxString
& filename
);
102 virtual bool IsModified(void) const;
103 virtual void Modify(bool mod
);
105 TextEditDocument(void) {}
106 ~TextEditDocument(void) {}