]> git.saurik.com Git - wxWidgets.git/blame - samples/docvwmdi/view.h
Allow building with wxUSE_CALENDARCTRL=0
[wxWidgets.git] / samples / docvwmdi / view.h
CommitLineData
2108f33a
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: view.h
3// Purpose: View classes
4// Author: Julian Smart
5// Modified by:
6// Created: 04/01/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart and Markus Holzem
2f6c54eb 9// Licence: wxWindows license
2108f33a
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13// #pragma interface
14#endif
15
16#ifndef __VIEWSAMPLEH__
17#define __VIEWSAMPLEH__
18
19#include "wx/docview.h"
20
21class MyCanvas: public wxScrolledWindow
22{
354aa1e3 23public:
2108f33a
JS
24 wxView *view;
25
acbd13a3 26 MyCanvas(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style);
2108f33a
JS
27 virtual void OnDraw(wxDC& dc);
28 void OnMouseEvent(wxMouseEvent& event);
29
354aa1e3
RR
30private:
31 DECLARE_EVENT_TABLE()
2108f33a
JS
32};
33
34class MyTextWindow: public wxTextCtrl
35{
354aa1e3 36public:
2108f33a
JS
37 wxView *view;
38
acbd13a3 39 MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, long style);
2108f33a
JS
40};
41
42class DrawingView: public wxView
43{
354aa1e3
RR
44public:
45 wxFrame *frame;
46 MyCanvas *canvas;
2108f33a 47
354aa1e3
RR
48 DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; }
49 ~DrawingView() {}
2108f33a 50
354aa1e3
RR
51 bool OnCreate(wxDocument *doc, long flags);
52 void OnDraw(wxDC *dc);
53 void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
54 bool OnClose(bool deleteWindow = TRUE);
2108f33a 55
354aa1e3 56 void OnCut(wxCommandEvent& event);
2108f33a 57
354aa1e3
RR
58private:
59 DECLARE_DYNAMIC_CLASS(DrawingView)
60 DECLARE_EVENT_TABLE()
2108f33a
JS
61};
62
63class TextEditView: public wxView
64{
354aa1e3
RR
65public:
66 wxFrame *frame;
67 MyTextWindow *textsw;
2108f33a 68
354aa1e3
RR
69 TextEditView(): wxView() { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
70 ~TextEditView() {}
2108f33a 71
354aa1e3
RR
72 bool OnCreate(wxDocument *doc, long flags);
73 void OnDraw(wxDC *dc);
74 void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
75 bool OnClose(bool deleteWindow = TRUE);
76
77private:
78 DECLARE_DYNAMIC_CLASS(TextEditView)
2108f33a
JS
79};
80
81#endif