X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fc25a89ac1e6c5208db24bfc0abc8666b791dc6..31d7fc0f9cb3f5913ecd4a039a816487a6753a93:/contrib/src/ogl/canvas.cpp diff --git a/contrib/src/ogl/canvas.cpp b/contrib/src/ogl/canvas.cpp index 02bae38143..6c3bb4d561 100644 --- a/contrib/src/ogl/canvas.cpp +++ b/contrib/src/ogl/canvas.cpp @@ -14,7 +14,7 @@ #endif // For compilers that support precompilation, includes "wx.h". -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -24,25 +24,19 @@ #include #endif -#include +#if wxUSE_PROLOGIO +#include +#endif -#if wxUSE_IOSTREAMH -#include -#else -#include +#ifdef new +#undef new #endif #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" #define CONTROL_POINT_SIZE 6 @@ -57,8 +51,6 @@ #define CONTROL_POINT_ENDPOINT_FROM 5 #define CONTROL_POINT_LINE 6 -extern wxCursor *g_oglBullseyeCursor; - IMPLEMENT_DYNAMIC_CLASS(wxShapeCanvas, wxScrolledWindow) BEGIN_EVENT_TABLE(wxShapeCanvas, wxScrolledWindow) @@ -66,9 +58,15 @@ BEGIN_EVENT_TABLE(wxShapeCanvas, wxScrolledWindow) EVT_MOUSE_EVENTS(wxShapeCanvas::OnMouseEvent) END_EVENT_TABLE() +const wxChar* wxShapeCanvasNameStr = wxT("shapeCanvas"); + // Object canvas -wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): - wxScrolledWindow(parent, id, pos, size, style) +wxShapeCanvas::wxShapeCanvas(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name): + wxScrolledWindow(parent, id, pos, size, style, name) { m_shapeDiagram = NULL; m_dragState = NoDragging; @@ -84,16 +82,17 @@ wxShapeCanvas::~wxShapeCanvas() { } -void wxShapeCanvas::OnPaint(wxPaintEvent& event) +void wxShapeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); PrepareDC(dc); + dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID)); dc.Clear(); - if (GetDiagram()) - GetDiagram()->Redraw(dc); + if (GetDiagram()) + GetDiagram()->Redraw(dc); } void wxShapeCanvas::OnMouseEvent(wxMouseEvent& event) @@ -394,10 +393,10 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn // the other objects // (b) to find the control points FIRST if they exist - wxNode *current = GetDiagram()->GetShapeList()->Last(); + wxNode *current = GetDiagram()->GetShapeList()->GetLast(); while (current) { - wxShape *object = (wxShape *)current->Data(); + wxShape *object = (wxShape *)current->GetData(); double dist; int temp_attachment; @@ -427,13 +426,13 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn } } if (current) - current = current->Previous(); + current = current->GetPrevious(); } - current = GetDiagram()->GetShapeList()->Last(); + current = GetDiagram()->GetShapeList()->GetLast(); while (current) { - wxShape *object = (wxShape *)current->Data(); + wxShape *object = (wxShape *)current->GetData(); double dist; int temp_attachment; @@ -450,7 +449,6 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn // Check for division in case line straddles divisions (i.e. is not wholly contained). if (!nearest_object || !(object->IsKindOf(CLASSINFO(wxDivisionShape)) || WhollyContains(object, nearest_object))) { - nearest = dist; nearest_object = object; nearest_attachment = temp_attachment; current = NULL; @@ -458,7 +456,7 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn } } if (current) - current = current->Previous(); + current = current->GetPrevious(); } *attachment = nearest_attachment; @@ -470,35 +468,35 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn * */ -void wxShapeCanvas::OnLeftClick(double x, double y, int keys) +void wxShapeCanvas::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnRightClick(double x, double y, int keys) +void wxShapeCanvas::OnRightClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnDragLeft(bool draw, double x, double y, int keys) +void wxShapeCanvas::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnBeginDragLeft(double x, double y, int keys) +void wxShapeCanvas::OnBeginDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnEndDragLeft(double x, double y, int keys) +void wxShapeCanvas::OnEndDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnDragRight(bool draw, double x, double y, int keys) +void wxShapeCanvas::OnDragRight(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnBeginDragRight(double x, double y, int keys) +void wxShapeCanvas::OnBeginDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnEndDragRight(double x, double y, int keys) +void wxShapeCanvas::OnEndDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { }