]> git.saurik.com Git - wxWidgets.git/blame_incremental - samples/docview/view.h
fix Union(empty rect) bug
[wxWidgets.git] / samples / docview / view.h
... / ...
CommitLineData
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
9// Licence: wxWindows license
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{
23public:
24 wxView *view;
25
26 MyCanvas(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
27 virtual void OnDraw(wxDC& dc);
28 void OnMouseEvent(wxMouseEvent& event);
29
30 DECLARE_EVENT_TABLE()
31};
32
33class MyTextWindow: public wxTextCtrl
34{
35public:
36 wxView *view;
37
38 MyTextWindow(wxView *v, wxFrame *frame, const wxPoint& pos, const wxSize& size, const long style);
39};
40
41class DrawingView: public wxView
42{
43 DECLARE_DYNAMIC_CLASS(DrawingView)
44private:
45public:
46 wxFrame *frame;
47 MyCanvas *canvas;
48
49 DrawingView(void) { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; };
50 ~DrawingView(void) {};
51
52 bool OnCreate(wxDocument *doc, long flags);
53 void OnDraw(wxDC *dc);
54 void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
55 bool OnClose(bool deleteWindow = TRUE);
56
57 void OnCut(wxCommandEvent& event);
58
59 DECLARE_EVENT_TABLE()
60};
61
62class TextEditView: public wxView
63{
64 DECLARE_DYNAMIC_CLASS(TextEditView)
65private:
66public:
67 wxFrame *frame;
68 MyTextWindow *textsw;
69
70 TextEditView(): wxView() { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
71 ~TextEditView(void) {}
72
73 bool OnCreate(wxDocument *doc, long flags);
74 void OnDraw(wxDC *dc);
75 void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
76 bool OnClose(bool deleteWindow = TRUE);
77};
78
79#endif