1998-07-28 09:33:23 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: view.h
|
|
|
|
// Purpose: View classes
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 04/01/98
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 06:55:54 -05:00
|
|
|
// Copyright: (c) Julian Smart
|
2002-03-17 09:16:03 -05:00
|
|
|
// Licence: wxWindows license
|
1998-07-28 09:33:23 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
// #pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __VIEWSAMPLEH__
|
|
|
|
#define __VIEWSAMPLEH__
|
|
|
|
|
|
|
|
#include "wx/docview.h"
|
|
|
|
|
|
|
|
class MyCanvas: public wxScrolledWindow
|
|
|
|
{
|
1999-10-30 11:08:33 -04:00
|
|
|
public:
|
1998-07-28 09:33:23 -04:00
|
|
|
wxView *view;
|
|
|
|
|
2002-08-20 05:09:55 -04:00
|
|
|
MyCanvas(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style);
|
1998-07-28 09:33:23 -04:00
|
|
|
virtual void OnDraw(wxDC& dc);
|
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
|
|
|
|
1999-10-30 11:08:33 -04:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-07-28 09:33:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class MyTextWindow: public wxTextCtrl
|
|
|
|
{
|
1999-10-30 11:08:33 -04:00
|
|
|
public:
|
1998-07-28 09:33:23 -04:00
|
|
|
wxView *view;
|
|
|
|
|
2002-08-20 05:09:55 -04:00
|
|
|
MyTextWindow(wxView *v, wxMDIChildFrame *frame, const wxPoint& pos, const wxSize& size, long style);
|
1998-07-28 09:33:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class DrawingView: public wxView
|
|
|
|
{
|
1999-10-30 11:08:33 -04:00
|
|
|
public:
|
2002-08-20 05:09:55 -04:00
|
|
|
wxMDIChildFrame *frame;
|
1999-10-30 11:08:33 -04:00
|
|
|
MyCanvas *canvas;
|
1998-07-28 09:33:23 -04:00
|
|
|
|
2002-08-20 05:09:55 -04:00
|
|
|
DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxMDIChildFrame *) NULL; }
|
1999-10-30 11:08:33 -04:00
|
|
|
~DrawingView() {}
|
1998-07-28 09:33:23 -04:00
|
|
|
|
1999-10-30 11:08:33 -04:00
|
|
|
bool OnCreate(wxDocument *doc, long flags);
|
|
|
|
void OnDraw(wxDC *dc);
|
|
|
|
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
2004-05-27 14:17:50 -04:00
|
|
|
bool OnClose(bool deleteWindow = true);
|
1998-07-28 09:33:23 -04:00
|
|
|
|
1999-10-30 11:08:33 -04:00
|
|
|
void OnCut(wxCommandEvent& event);
|
1998-07-28 09:33:23 -04:00
|
|
|
|
1999-10-30 11:08:33 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(DrawingView)
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-07-28 09:33:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextEditView: public wxView
|
|
|
|
{
|
1999-10-30 11:08:33 -04:00
|
|
|
public:
|
2002-08-20 05:09:55 -04:00
|
|
|
wxMDIChildFrame *frame;
|
1999-10-30 11:08:33 -04:00
|
|
|
MyTextWindow *textsw;
|
1998-07-28 09:33:23 -04:00
|
|
|
|
2002-08-20 05:09:55 -04:00
|
|
|
TextEditView(): wxView() { frame = (wxMDIChildFrame *) NULL; textsw = (MyTextWindow *) NULL; }
|
1999-10-30 11:08:33 -04:00
|
|
|
~TextEditView() {}
|
1998-07-28 09:33:23 -04:00
|
|
|
|
1999-10-30 11:08:33 -04:00
|
|
|
bool OnCreate(wxDocument *doc, long flags);
|
|
|
|
void OnDraw(wxDC *dc);
|
|
|
|
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
2004-05-27 14:17:50 -04:00
|
|
|
bool OnClose(bool deleteWindow = true);
|
1999-10-30 11:08:33 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(TextEditView)
|
1998-07-28 09:33:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|