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$
|
|
|
|
// Copyright: (c) Julian Smart and Markus Holzem
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
1999-02-04 11:14:41 +00:00
|
|
|
MyCanvas(wxView *v, wxFrame *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;
|
|
|
|
|
1999-02-04 11:14:41 +00:00
|
|
|
MyTextWindow(wxView *v, wxFrame *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:
|
|
|
|
wxFrame *frame;
|
|
|
|
MyCanvas *canvas;
|
1998-07-28 13:33:23 +00:00
|
|
|
|
1999-10-30 15:08:33 +00:00
|
|
|
DrawingView() { canvas = (MyCanvas *) NULL; frame = (wxFrame *) NULL; }
|
|
|
|
~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:
|
|
|
|
wxFrame *frame;
|
|
|
|
MyTextWindow *textsw;
|
1998-07-28 13:33:23 +00:00
|
|
|
|
1999-10-30 15:08:33 +00:00
|
|
|
TextEditView(): wxView() { frame = (wxFrame *) NULL; textsw = (MyTextWindow *) NULL; }
|
|
|
|
~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
|