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