#undef new
#endif
-#if wxUSE_IOSTREAMH
-#include <iostream.h>
-#else
-#include <iostream>
-#endif
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
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;
// 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 ++;
}
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))
double y = (double)(i*char_height + yoffset);
line->SetX( x - xOffset ); line->SetY( y - yOffset );
- current = current->Next();
+ current = current->GetNext();
i ++;
}
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;
// 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 ++;
}
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;
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))
{
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 ++;
}
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
else
{
if (buffer.Length() != 0)
- buffer += " ";
+ buffer += wxT(" ");
buffer += s;
dc.GetTextExtent(buffer, &x, &y);
}
}
- node = node->Next();
+ node = node->GetNext();
}
if (buffer.Length() != 0)
string_list->Add(buffer);
(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();
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());
}
/*
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();
}
}