]> git.saurik.com Git - wxWidgets.git/blame - contrib/samples/ogl/ogledit/view.h
offset version by 1 to avoid having compatibility_version of 0.0.0 under Darwin:...
[wxWidgets.git] / contrib / samples / ogl / ogledit / view.h
CommitLineData
1fc25a89
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: view.h
3// Purpose: View-related classes
4// Author: Julian Smart
5// Modified by:
6// Created: 12/07/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
2ba06d5a 9// Licence: wxWindows licence
1fc25a89
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _OGLSAMPLE_VIEW_H_
13#define _OGLSAMPLE_VIEW_H_
14
1fc25a89
JS
15#include "doc.h"
16#include <wx/ogl/ogl.h>
17
18class MyCanvas: public wxShapeCanvas
19{
20// DECLARE_DYNAMIC_CLASS(wxShapeCanvas)
21 protected:
22 public:
23 wxView *view;
24
2ba06d5a 25 MyCanvas(wxView *view, wxWindow *parent = NULL, wxWindowID id = wxID_ANY,
1fc25a89
JS
26 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
27 long style = wxRETAINED);
28 ~MyCanvas(void);
29
30 void OnMouseEvent(wxMouseEvent& event);
31 void OnPaint(wxPaintEvent& event);
32
33 virtual void OnLeftClick(double x, double y, int keys = 0);
34 virtual void OnRightClick(double x, double y, int keys = 0);
35
36 virtual void OnDragLeft(bool draw, double x, double y, int keys=0); // Erase if draw false
37 virtual void OnBeginDragLeft(double x, double y, int keys=0);
38 virtual void OnEndDragLeft(double x, double y, int keys=0);
39
40 virtual void OnDragRight(bool draw, double x, double y, int keys=0); // Erase if draw false
41 virtual void OnBeginDragRight(double x, double y, int keys=0);
42 virtual void OnEndDragRight(double x, double y, int keys=0);
43
44DECLARE_EVENT_TABLE()
45};
46
47class DiagramView: public wxView
48{
49 DECLARE_DYNAMIC_CLASS(DiagramView)
50 private:
51 public:
52 wxFrame *frame;
53 MyCanvas *canvas;
54
55 DiagramView(void) { canvas = NULL; frame = NULL; };
56 ~DiagramView(void) {};
57
58 bool OnCreate(wxDocument *doc, long flags);
59 void OnDraw(wxDC *dc);
60 void OnUpdate(wxView *sender, wxObject *hint = NULL);
2ba06d5a 61 bool OnClose(bool deleteWindow = true);
1fc25a89
JS
62
63 wxShape *FindSelectedShape(void);
64
65// void OnMenuCommand(int cmd);
66
67 void OnCut(wxCommandEvent& event);
68 void OnChangeBackgroundColour(wxCommandEvent& event);
69 void OnEditLabel(wxCommandEvent& event);
70
71DECLARE_EVENT_TABLE()
72};
73
74#endif
75 // _OGLSAMPLE_VIEW_H_