X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f54b065ea7323231fab3fec0f6160899ac132c2e..084db46c8b4f3f8d5e6a5f55e09e04f5a680c8a5:/contrib/src/ogl/oglmisc.cpp diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index 30deb1d87b..47c140bc95 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -24,7 +24,9 @@ #include #endif -#include +#if wxUSE_DEPRECATED +#include +#endif #include @@ -205,7 +207,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height, int formatMode) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) return; @@ -219,17 +221,17 @@ void oglCentreText(wxDC& dc, wxList *text_list, // Store text extents for speed double *widths = new double[n]; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); widths[i] = current_width; if (current_width > max_width) max_width = current_width; - current = current->Next(); + current = current->GetNext(); i ++; } @@ -262,12 +264,12 @@ void oglCentreText(wxDC& dc, wxList *text_list, xOffset = 0.0; } - current = text_list->First(); + current = text_list->GetFirst(); i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); double x; if ((formatMode & FORMAT_CENTRE_HORIZ) && (widths[i] < width)) @@ -277,7 +279,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, double y = (double)(i*char_height + yoffset); line->SetX( x - xOffset ); line->SetY( y - yOffset ); - current = current->Next(); + current = current->GetNext(); i ++; } @@ -288,7 +290,7 @@ void oglCentreText(wxDC& dc, wxList *text_list, void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) return; @@ -302,17 +304,17 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, // Store text extents for speed double *widths = new double[n]; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); widths[i] = current_width; if (current_width > max_width) max_width = current_width; - current = current->Next(); + current = current->GetNext(); i ++; } @@ -322,18 +324,18 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, double xoffset = (double)(m_xpos - width/2.0); - current = text_list->First(); + current = text_list->GetFirst(); i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); double x = (double)((width - widths[i])/2.0 + xoffset); double y = (double)(i*char_height + yoffset); line->SetX( x - m_xpos ); line->SetY( y - m_ypos ); - current = current->Next(); + current = current->GetNext(); i ++; } delete widths; @@ -343,7 +345,7 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, double m_xpos, double m_ypos, double width, double height, double *actual_width, double *actual_height) { - int n = text_list->Number(); + int n = text_list->GetCount(); if (!text_list || (n == 0)) { @@ -358,16 +360,16 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, long max_width = 0; long current_width = 0; - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); int i = 0; while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.GetTextExtent(line->GetText(), ¤t_width, &char_height); if (current_width > max_width) max_width = current_width; - current = current->Next(); + current = current->GetNext(); i ++; } @@ -445,14 +447,14 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double char buffer[400]; buffer[0] = 0; - wxNode *node = word_list.First(); + wxStringListNode *node = word_list.GetFirst(); long x, y; while (node) { wxString oldBuffer(buffer); - char *s = (char *)node->Data(); + char *s = (char *)node->GetData(); if (!s) { // FORCE NEW LINE @@ -481,7 +483,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double } } - node = node->Next(); + node = node->GetNext(); } if (buffer[0] != 0) string_list->Add(buffer); @@ -508,13 +510,13 @@ void oglDrawFormattedText(wxDC& dc, wxList *text_list, (long)(m_xpos - width/2.0), (long)(m_ypos - height/2.0), (long)width, (long)height); - wxNode *current = text_list->First(); + wxNode *current = text_list->GetFirst(); while (current) { - wxShapeTextLine *line = (wxShapeTextLine *)current->Data(); + wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); dc.DrawText(line->GetText(), WXROUND(xoffset + line->GetX()), WXROUND(yoffset + line->GetY())); - current = current->Next(); + current = current->GetNext(); } dc.DestroyClippingRegion(); @@ -530,17 +532,17 @@ void oglFindPolylineCentroid(wxList *points, double *x, double *y) double xcount = 0; double ycount = 0; - wxNode *node = points->First(); + wxNode *node = points->GetFirst(); while (node) { - wxRealPoint *point = (wxRealPoint *)node->Data(); + wxRealPoint *point = (wxRealPoint *)node->GetData(); xcount += point->x; ycount += point->y; - node = node->Next(); + node = node->GetNext(); } - *x = (xcount/points->Number()); - *y = (ycount/points->Number()); + *x = (xcount/points->GetCount()); + *y = (ycount/points->GetCount()); } /* @@ -808,12 +810,12 @@ void UpdateListBox(wxListBox *item, wxList *list) if (!list) return; - wxNode *node = list->First(); + wxNode *node = list->GetFirst(); while (node) { - char *s = (char *)node->Data(); + char *s = (char *)node->GetData(); item->Append(s); - node = node->Next(); + node = node->GetNext(); } }