]>
git.saurik.com Git - wxWidgets.git/blob - src/generic/textmeasure.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/generic/textmeasure.cpp
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2012 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 // for compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
26 #include "wx/window.h"
30 #include "wx/private/textmeasure.h"
32 #if wxUSE_GENERIC_TEXTMEASURE
34 // ============================================================================
35 // wxTextMeasure generic implementation
36 // ============================================================================
38 // We assume that the ports not providing platform-specific wxTextMeasure
39 // implementation implement the corresponding functions in their wxDC and
40 // wxWindow classes, so forward back to them instead of using wxTextMeasure
41 // from there, as usual.
42 void wxTextMeasure::DoGetTextExtent(const wxString
& string
,
46 wxCoord
*externalLeading
)
50 m_dc
->GetTextExtent(string
, width
, height
,
51 descent
, externalLeading
, m_font
);
55 m_win
->GetTextExtent(string
, width
, height
,
56 descent
, externalLeading
, m_font
);
58 //else: we already asserted in the ctor, don't do it any more
61 bool wxTextMeasure::DoGetPartialTextExtents(const wxString
& text
,
65 return wxTextMeasureBase::DoGetPartialTextExtents(text
, widths
, scaleX
);
68 #endif // wxUSE_GENERIC_TEXTMEASURE