]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/ogl/ogledit/view.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: contrib/samples/ogl/ogledit/view.h
3 // Purpose: View-related classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _OGLSAMPLE_VIEW_H_
13 #define _OGLSAMPLE_VIEW_H_
16 #include "wx/ogl/ogl.h"
18 class MyCanvas
: public wxShapeCanvas
20 // DECLARE_DYNAMIC_CLASS(wxShapeCanvas)
25 MyCanvas(wxView
*view
, wxWindow
*parent
= NULL
, wxWindowID id
= wxID_ANY
,
26 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
27 long style
= wxRETAINED
);
30 void OnMouseEvent(wxMouseEvent
& event
);
31 void OnPaint(wxPaintEvent
& event
);
33 virtual void OnLeftClick(double x
, double y
, int keys
= 0);
34 virtual void OnRightClick(double x
, double y
, int keys
= 0);
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);
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);
47 class DiagramView
: public wxView
49 DECLARE_DYNAMIC_CLASS(DiagramView
)
55 DiagramView(void) { canvas
= NULL
; frame
= NULL
; };
56 ~DiagramView(void) {};
58 bool OnCreate(wxDocument
*doc
, long flags
);
59 void OnDraw(wxDC
*dc
);
60 void OnUpdate(wxView
*sender
, wxObject
*hint
= NULL
);
61 bool OnClose(bool deleteWindow
= true);
63 wxShape
*FindSelectedShape(void);
65 void OnCut(wxCommandEvent
& event
);
66 void OnChangeBackgroundColour(wxCommandEvent
& event
);
67 void OnEditLabel(wxCommandEvent
& event
);