X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ba06d5a8ccf8c224fcfbd52fa01a55abf7befbd..3030ae493df7500fd5da7555f141c0c8a690bd8a:/contrib/src/ogl/basic.cpp diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 02bf4c429b..ab9c5a8334 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -9,10 +9,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "basic.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -21,11 +17,11 @@ #endif #ifndef WX_PRECOMP -#include +#include "wx/wx.h" #endif #if wxUSE_PROLOGIO -#include +#include "wx/deprecated/wxexpr.h" #endif #ifdef new @@ -34,7 +30,6 @@ #include #include -#include #include "wx/ogl/ogl.h" @@ -689,12 +684,12 @@ bool wxShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), return false; } -void wxShape::SetPen(wxPen *the_pen) +void wxShape::SetPen(const wxPen *the_pen) { m_pen = the_pen; } -void wxShape::SetBrush(wxBrush *the_brush) +void wxShape::SetBrush(const wxBrush *the_brush) { m_brush = the_brush; } @@ -1313,7 +1308,7 @@ void wxShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush(* wxTRANSPARENT_BRUSH); @@ -1358,7 +1353,7 @@ void wxShape::OnBeginDragLeft(double x, double y, int keys, int attachment) // m_xpos = xx; m_ypos = yy; dc.SetLogicalFunction(OGLRBLF); - wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); + wxPen dottedPen(*wxBLACK, 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); @@ -1370,6 +1365,8 @@ void wxShape::OnBeginDragLeft(double x, double y, int keys, int attachment) void wxShape::OnEndDragLeft(double x, double y, int keys, int attachment) { + if (!m_draggable) + return; m_canvas->ReleaseMouse(); if ((m_sensitivity & OP_DRAG_LEFT) != OP_DRAG_LEFT) { @@ -2712,7 +2709,9 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, double left = (double)(m_xpos - w/2.0); double right = (double)(m_xpos + w/2.0); +#if 0 /* bool isEnd = */ (line && line->IsEnd(this)); +#endif int physicalAttachment = LogicalToPhysicalAttachment(attachment); @@ -3190,7 +3189,7 @@ bool wxShape::GetAttachmentPositionEdge(int attachment, double *x, double *y, // to logical (0 -> 1 if rotated by 90 degrees) int wxShape::PhysicalToLogicalAttachment(int physicalAttachment) const { - const double pi = 3.1415926535897932384626433832795 ; + const double pi = M_PI ; int i; if (oglRoughlyEqual(GetRotation(), 0.0)) { @@ -3222,7 +3221,7 @@ int wxShape::PhysicalToLogicalAttachment(int physicalAttachment) const // to physical (0 is always North) int wxShape::LogicalToPhysicalAttachment(int logicalAttachment) const { - const double pi = 3.1415926535897932384626433832795 ; + const double pi = M_PI ; int i; if (oglRoughlyEqual(GetRotation(), 0.0)) { @@ -3252,7 +3251,7 @@ int wxShape::LogicalToPhysicalAttachment(int logicalAttachment) const void wxShape::Rotate(double WXUNUSED(x), double WXUNUSED(y), double theta) { - const double pi = 3.1415926535897932384626433832795 ; + const double pi = M_PI ; m_rotation = theta; if (m_rotation < 0.0) { @@ -3285,4 +3284,3 @@ wxBrush wxShape::GetBackgroundBrush() } return * g_oglWhiteBackgroundBrush; } -