X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd657b8a5907c8584db84c85535ce281bdd65193..a0086878b09ea394de9f5746a5e8f066a3d12dec:/contrib/src/ogl/divided.cpp diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index 767bfa69e4..50737984c0 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -24,16 +24,12 @@ #include #endif -#if wxUSE_DEPRECATED +#if wxUSE_PROLOGIO #include #endif -#include -#include -#include -#include -#include -#include +#include "wx/ogl/ogl.h" + class wxDividedShapeControlPoint: public wxControlPoint { @@ -85,7 +81,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc) if (m_pen) dc.SetPen(* m_pen); - if (m_textColour) dc.SetTextForeground(* m_textColour); + dc.SetTextForeground(m_textColour); #ifdef __WXMSW__ // For efficiency, don't do this under X - doesn't make @@ -111,7 +107,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc) { wxShapeRegion *region = (wxShapeRegion *)node->GetData(); dc.SetFont(* region->GetFont()); - dc.SetTextForeground(* region->GetActualColourObject()); + dc.SetTextForeground(region->GetActualColourObject()); double proportion = region->m_regionProportionY < 0.0 ? defaultProportion : region->m_regionProportionY; @@ -141,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; @@ -247,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) { @@ -593,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); @@ -611,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); @@ -630,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); @@ -656,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(); @@ -671,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(); }