]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/ogl/ogledit/view.h
f9c27952f3e0578ac923599d2d3009a294a1dba4
1 /////////////////////////////////////////////////////////////////////////////
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_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 // #pragma interface "view.h"
20 #include <wx/ogl/ogl.h>
22 class MyCanvas
: public wxShapeCanvas
24 // DECLARE_DYNAMIC_CLASS(wxShapeCanvas)
29 MyCanvas(wxView
*view
, wxWindow
*parent
= NULL
, wxWindowID id
= wxID_ANY
,
30 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
31 long style
= wxRETAINED
);
34 void OnMouseEvent(wxMouseEvent
& event
);
35 void OnPaint(wxPaintEvent
& event
);
37 virtual void OnLeftClick(double x
, double y
, int keys
= 0);
38 virtual void OnRightClick(double x
, double y
, int keys
= 0);
40 virtual void OnDragLeft(bool draw
, double x
, double y
, int keys
=0); // Erase if draw false
41 virtual void OnBeginDragLeft(double x
, double y
, int keys
=0);
42 virtual void OnEndDragLeft(double x
, double y
, int keys
=0);
44 virtual void OnDragRight(bool draw
, double x
, double y
, int keys
=0); // Erase if draw false
45 virtual void OnBeginDragRight(double x
, double y
, int keys
=0);
46 virtual void OnEndDragRight(double x
, double y
, int keys
=0);
51 class DiagramView
: public wxView
53 DECLARE_DYNAMIC_CLASS(DiagramView
)
59 DiagramView(void) { canvas
= NULL
; frame
= NULL
; };
60 ~DiagramView(void) {};
62 bool OnCreate(wxDocument
*doc
, long flags
);
63 void OnDraw(wxDC
*dc
);
64 void OnUpdate(wxView
*sender
, wxObject
*hint
= NULL
);
65 bool OnClose(bool deleteWindow
= true);
67 wxShape
*FindSelectedShape(void);
69 // void OnMenuCommand(int cmd);
71 void OnCut(wxCommandEvent
& event
);
72 void OnChangeBackgroundColour(wxCommandEvent
& event
);
73 void OnEditLabel(wxCommandEvent
& event
);