m_useDCImpl = false;
}
+wxFont wxTextMeasureBase::GetFont() const
+{
+ return m_font ? *m_font
+ : m_win ? m_win->GetFont()
+ : m_dc->GetFont();
+}
+
void wxTextMeasureBase::CallGetTextExtent(const wxString& string,
wxCoord *width,
wxCoord *height,
*heightOneLine = heightLine;
}
-void wxTextMeasureBase::GetLargestStringExtent(const wxVector<wxString>& strings,
- wxCoord *width,
- wxCoord *height)
+wxSize wxTextMeasureBase::GetLargestStringExtent(size_t n,
+ const wxString* strings)
{
MeasuringGuard guard(*this);
wxCoord w, h, widthMax = 0, heightMax = 0;
- for ( wxVector<wxString>::const_iterator i = strings.begin();
- i != strings.end();
- ++i )
+ for ( size_t i = 0; i < n; ++i )
{
- CallGetTextExtent(*i, &w, &h);
+ CallGetTextExtent(strings[i], &w, &h);
if ( w > widthMax )
widthMax = w;
heightMax = h;
}
- if ( width )
- *width = widthMax;
- if ( height )
- *height = heightMax;
+ return wxSize(widthMax, heightMax);
}
bool wxTextMeasureBase::GetPartialTextExtents(const wxString& text,