X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c1fa2fda3c72886f62def1e650a7306c82e72f2f..51d5ec540813b54e5590cc473b0252d51754e152:/contrib/src/ogl/misc.cpp?ds=sidebyside diff --git a/contrib/src/ogl/misc.cpp b/contrib/src/ogl/misc.cpp index 76bf00cc4f..50cc5b9c7e 100644 --- a/contrib/src/ogl/misc.cpp +++ b/contrib/src/ogl/misc.cpp @@ -32,11 +32,6 @@ #undef new #endif -#if wxUSE_IOSTREAMH -#include -#else -#include -#endif #include #include #include @@ -177,7 +172,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; @@ -191,17 +186,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 ++; } @@ -234,12 +229,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)) @@ -249,7 +244,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 ++; } @@ -260,7 +255,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; @@ -274,17 +269,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 ++; } @@ -294,18 +289,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; @@ -315,7 +310,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)) { @@ -330,16 +325,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 ++; } @@ -416,14 +411,14 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double wxStringList *string_list = new wxStringList; wxString buffer; - wxNode *node = word_list.First(); + wxNode *node = (wxNode*)word_list.GetFirst(); long x, y; while (node) { wxString oldBuffer(buffer); - char *s = (char *)node->Data(); + wxChar *s = (wxChar *)node->GetData(); if (!s) { // FORCE NEW LINE @@ -435,7 +430,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double else { if (buffer.Length() != 0) - buffer += " "; + buffer += wxT(" "); buffer += s; dc.GetTextExtent(buffer, &x, &y); @@ -452,7 +447,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double } } - node = node->Next(); + node = node->GetNext(); } if (buffer.Length() != 0) string_list->Add(buffer); @@ -479,13 +474,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(); @@ -501,17 +496,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()); } /* @@ -779,12 +774,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(); + wxChar *s = (wxChar *)node->GetData(); item->Append(s); - node = node->Next(); + node = node->GetNext(); } }