m_pen = g_oglBlackPen;
m_brush = wxWHITE_BRUSH;
m_font = g_oglNormalFont;
- m_textColour = wxBLACK;
+ m_textColour = wxT("BLACK");
m_textColourName = wxT("BLACK");
m_visible = FALSE;
m_selected = FALSE;
region->GetSize(&w, &h);
- wxStringList *stringList = oglFormatText(dc, s, (w-5), (h-5), region->GetFormatMode());
+ wxStringList *stringList = oglFormatText(dc, s, (w-2*m_textMarginX), (h-2*m_textMarginY), region->GetFormatMode());
node = (wxNode*)stringList->GetFirst();
while (node)
{
(m_regions.GetCount() == 1) && !GraphicsInSizeToContents)
{
oglGetCentredTextExtent(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w, h, &actualW, &actualH);
- if ((actualW+m_textMarginX != w ) || (actualH+m_textMarginY != h))
+ if ((actualW+2*m_textMarginX != w ) || (actualH+2*m_textMarginY != h))
{
// If we are a descendant of a composite, must make sure the composite gets
// resized properly
wxCompositeShape *composite = (wxCompositeShape *)topAncestor;
composite->Erase(dc);
- SetSize(actualW+m_textMarginX, actualH+m_textMarginY);
+ SetSize(actualW+2*m_textMarginX, actualH+2*m_textMarginY);
Move(dc, m_xpos, m_ypos);
composite->CalculateSize();
if (composite->Selected())
else
{
Erase(dc);
- SetSize(actualW+m_textMarginX, actualH+m_textMarginY);
+ SetSize(actualW+2*m_textMarginX, actualH+2*m_textMarginY);
Move(dc, m_xpos, m_ypos);
}
- SetSize(actualW+m_textMarginX, actualH+m_textMarginY);
+ SetSize(actualW+2*m_textMarginX, actualH+2*m_textMarginY);
Move(dc, m_xpos, m_ypos);
EraseContents(dc);
}
}
- oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, actualW, actualH, region->GetFormatMode());
+ oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, actualW-2*m_textMarginX, actualH-2*m_textMarginY, region->GetFormatMode());
m_formatted = TRUE;
}
if (node)
{
wxShapeRegion *region = (wxShapeRegion *)node->GetData();
- oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w, h, region->GetFormatMode());
+ oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w-2*m_textMarginX, h-2*m_textMarginY, region->GetFormatMode());
}
}
}
void wxShape::SetTextColour(const wxString& the_colour, int regionId)
{
- wxColour *wxcolour = wxTheColourDatabase->FindColour(the_colour);
- m_textColour = wxcolour;
+ m_textColour = wxTheColourDatabase->Find(the_colour);
m_textColourName = the_colour;
wxNode *node = m_regions.Item(regionId);
wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData();
if (region->GetFont()) dc.SetFont(* region->GetFont());
- dc.SetTextForeground(* (region->GetActualColourObject()));
+ dc.SetTextForeground(region->GetActualColourObject());
dc.SetBackgroundMode(wxTRANSPARENT);
if (!m_formatted)
{
- oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x, bound_y, region->GetFormatMode());
+ oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x-2*m_textMarginX, bound_y-2*m_textMarginY, region->GetFormatMode());
m_formatted = TRUE;
}
if (!GetDisableLabel())
{
- oglDrawFormattedText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x, bound_y, region->GetFormatMode());
+ oglDrawFormattedText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x-2*m_textMarginX, bound_y-2*m_textMarginY, region->GetFormatMode());
}
}