X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b9ac87bc5cbe46227195e32c44e25831f8206e3c..0f774befd17081958952ec0e8dd3a818a4407947:/contrib/src/ogl/divided.cpp diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index cb1de4fbaa..41e62564d3 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -24,14 +24,12 @@ #include #endif -#include +#if wxUSE_PROLOGIO +#include +#endif + +#include "wx/ogl/ogl.h" -#include -#include -#include -#include -#include -#include class wxDividedShapeControlPoint: public wxControlPoint { @@ -139,7 +137,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc) } } -void wxDividedShape::SetSize(double w, double h, bool recursive) +void wxDividedShape::SetSize(double w, double h, bool WXUNUSED(recursive)) { SetAttachmentSize(w, h); m_width = w; @@ -245,18 +243,8 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y, // Left or right. else { - int i = 0; - bool isLeft = FALSE; - if (attachment < (n+1)) - { - i = attachment-1; - isLeft = FALSE; - } - else - { - i = (totalNumberAttachments - attachment - 1); - isLeft = TRUE; - } + bool isLeft = !(attachment < (n+1)); + int i = (isLeft) ? (totalNumberAttachments - attachment - 1) : (attachment-1); wxNode *node = GetRegions().Item(i); if (node) { @@ -321,7 +309,7 @@ int wxDividedShape::GetNumberOfAttachments() const return maxN + 1; } -bool wxDividedShape::AttachmentIsValid(int attachment) +bool wxDividedShape::AttachmentIsValid(int attachment) const { int totalNumberAttachments = (GetRegions().GetCount() * 2) + 2; if (attachment >= totalNumberAttachments) @@ -591,7 +579,7 @@ wxDividedShapeControlPoint::~wxDividedShapeControlPoint() } // Implement resizing of divided object division -void wxDividedShapeControlPoint::OnDragLeft(bool draw, double x, double y, int keys, int attachment) +void wxDividedShapeControlPoint::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED(x), double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -609,7 +597,7 @@ void wxDividedShapeControlPoint::OnDragLeft(bool draw, double x, double y, int k dc.DrawLine(WXROUND(x1), WXROUND(y1), WXROUND(x2), WXROUND(y2)); } -void wxDividedShapeControlPoint::OnBeginDragLeft(double x, double y, int keys, int attachment) +void wxDividedShapeControlPoint::OnBeginDragLeft(double WXUNUSED(x), double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -628,7 +616,7 @@ void wxDividedShapeControlPoint::OnBeginDragLeft(double x, double y, int keys, i m_canvas->CaptureMouse(); } -void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int attachment) +void wxDividedShapeControlPoint::OnEndDragLeft(double WXUNUSED(x), double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -654,7 +642,10 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int // Save values double thisRegionTop = 0.0; + #if 0 + // this variable is not readed later double thisRegionBottom = 0.0; + #endif double nextRegionBottom = 0.0; node = dividedObject->GetRegions().GetFirst(); @@ -669,7 +660,10 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int if (region == thisRegion) { thisRegionTop = currentY; + #if 0 + // no need for assignment if value is not used later thisRegionBottom = actualY; + #endif if (node->GetNext()) nextRegion = (wxShapeRegion *)node->GetNext()->GetData(); }