#undef new
#endif
-#if wxUSE_IOSTREAMH
-#include <iostream.h>
-#else
-#include <iostream>
-#endif
-
#include <ctype.h>
#include <math.h>
// and make the three line regions.
ClearRegions();
wxShapeRegion *newRegion = new wxShapeRegion;
- newRegion->SetName("Middle");
+ newRegion->SetName(wxT("Middle"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion;
- newRegion->SetName("Start");
+ newRegion->SetName(wxT("Start"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion;
- newRegion->SetName("End");
+ newRegion->SetName(wxT("End"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
region->GetSize(&w, &h);
// Initialize the size if zero
- if (((w == 0) || (h == 0)) && (strlen(s) > 0))
+ if (((w == 0) || (h == 0)) && (s.Length() > 0))
{
w = 100; h = 50;
region->SetSize(w, h);
node = string_list->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s);
region->GetFormattedText().Append((wxObject *)line);
node = node->Next();
// First, clear a rectangle for the text IF there is any
if (region->GetFormattedText().Number() > 0)
{
- dc.SetPen(* g_oglWhiteBackgroundPen);
- dc.SetBrush(* g_oglWhiteBackgroundBrush);
+ dc.SetPen(GetBackgroundPen());
+ dc.SetBrush(GetBackgroundBrush());
// Now draw the text
if (region->GetFont()) dc.SetFont(* region->GetFont());
dc.SetTextForeground(* region->GetActualColourObject());
#ifdef __WXMSW__
- dc.SetTextBackground(g_oglWhiteBackgroundBrush->GetColour());
+ dc.SetTextBackground(GetBackgroundBrush().GetColour());
#endif
oglDrawFormattedText(dc, &(region->GetFormattedText()), xp, yp, w, h, region->GetFormatMode());
if (region->GetFormattedText().Number() > 0)
{
- dc.SetPen(* g_oglWhiteBackgroundPen);
- dc.SetBrush(* g_oglWhiteBackgroundBrush);
+ dc.SetPen(GetBackgroundPen());
+ dc.SetBrush(GetBackgroundBrush());
dc.DrawRectangle((long)(xp - w/2.0), (long)(yp - h/2.0), (long)w, (long)h);
}
else
{
- wxFatalError("Unknown arrowhead rotation case in lines.cc");
+ wxLogFatalError(wxT("Unknown arrowhead rotation case in lines.cc"));
}
// Rotate about the centre of the object, then place
{
wxPen *old_pen = m_pen;
wxBrush *old_brush = m_brush;
- SetPen(g_oglWhiteBackgroundPen);
- SetBrush(g_oglWhiteBackgroundBrush);
+ wxPen bg_pen = GetBackgroundPen();
+ wxBrush bg_brush = GetBackgroundBrush();
+ SetPen(&bg_pen);
+ SetBrush(&bg_brush);
double bound_x, bound_y;
GetBoundingBoxMax(&bound_x, &bound_y);
}
// Undraw line
- dc.SetPen(* g_oglWhiteBackgroundPen);
- dc.SetBrush(* g_oglWhiteBackgroundBrush);
+ dc.SetPen(GetBackgroundPen());
+ dc.SetBrush(GetBackgroundBrush());
// Drawing over the line only seems to work if the line has a thickness
// of 1.
}
}
-#ifdef PROLOGIO
+#if wxUSE_PROLOGIO
void wxLineShape::WriteAttributes(wxExpr *clause)
{
wxShape::WriteAttributes(clause);
wxShape::ReadAttributes(clause);
int iVal = (int) m_isSpline;
- clause->AssignAttributeValue("is_spline", &iVal);
+ clause->AssignAttributeValue(wxT("is_spline"), &iVal);
m_isSpline = (iVal != 0);
iVal = (int) m_maintainStraightLines;
- clause->AssignAttributeValue("keep_lines_straight", &iVal);
+ clause->AssignAttributeValue(wxT("keep_lines_straight"), &iVal);
m_maintainStraightLines = (iVal != 0);
- clause->AssignAttributeValue("align_start", &m_alignmentStart);
- clause->AssignAttributeValue("align_end", &m_alignmentEnd);
+ clause->AssignAttributeValue(wxT("align_start"), &m_alignmentStart);
+ clause->AssignAttributeValue(wxT("align_end"), &m_alignmentEnd);
// Compatibility: check for no regions.
if (m_regions.Number() == 0)
}
newRegion = new wxShapeRegion;
- newRegion->SetName("Start");
+ newRegion->SetName(wxT("Start"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
newRegion = new wxShapeRegion;
- newRegion->SetName("End");
+ newRegion->SetName(wxT("End"));
newRegion->SetSize(150, 50);
m_regions.Append((wxObject *)newRegion);
}
m_attachmentTo = 0;
m_attachmentFrom = 0;
- clause->AssignAttributeValue("attachment_to", &m_attachmentTo);
- clause->AssignAttributeValue("attachment_from", &m_attachmentFrom);
+ clause->AssignAttributeValue(wxT("attachment_to"), &m_attachmentTo);
+ clause->AssignAttributeValue(wxT("attachment_from"), &m_attachmentFrom);
wxExpr *line_list = NULL;
// When image is created, there are default control points. Override
// them if there are some in the file.
- clause->AssignAttributeValue("controls", &line_list);
+ clause->AssignAttributeValue(wxT("controls"), &line_list);
if (line_list)
{
// Read arrow list, for new OGL code
wxExpr *arrow_list = NULL;
- clause->AssignAttributeValue("arrows", &arrow_list);
+ clause->AssignAttributeValue(wxT("arrows"), &arrow_list);
if (arrow_list)
{
wxExpr *node = arrow_list->value.first;
int arrowEnd = 0;
double xOffset = 0.0;
double arrowSize = 0.0;
- wxString arrowName("");
+ wxString arrowName;
long arrowId = -1;
wxExpr *type_expr = node->Nth(0);
else
wxRegisterId(arrowId);
- wxArrowHead *arrowHead = AddArrow(arrowType, arrowEnd, arrowSize, xOffset, (char*) (const char*) arrowName, NULL, arrowId);
+ wxArrowHead *arrowHead = AddArrow(arrowType, arrowEnd, arrowSize, xOffset, arrowName, NULL, arrowId);
if (yOffsetExpr)
arrowHead->SetYOffset(yOffsetExpr->RealValue());
if (spacingExpr)
if (lpt->m_type == CONTROL_POINT_ENDPOINT_FROM || lpt->m_type == CONTROL_POINT_ENDPOINT_TO)
{
- m_canvas->SetCursor(* g_oglBullseyeCursor);
+ m_canvas->SetCursor(wxCursor(wxCURSOR_BULLSEYE));
lpt->m_oldCursor = wxSTANDARD_CURSOR;
}
}
lineShape->GetTo()->GetEventHandler()->OnDraw(dc);
lineShape->GetTo()->GetEventHandler()->OnDrawContents(dc);
}
- m_canvas->SetCursor(g_oglBullseyeCursor);
+ m_canvas->SetCursor(wxCursor(wxCURSOR_BULLSEYE));
m_oldCursor = wxSTANDARD_CURSOR;
}
}