Allow wxTextMeasure to work with non-native wxDC objects too.
Just forward back to wxDC itself in this case instead of using the platform-specific code in wxTextMeasure that only works with native DCs. See #14781. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -111,12 +111,32 @@ protected:
|
||||
wxArrayInt& widths,
|
||||
double scaleX) = 0;
|
||||
|
||||
// Call either DoGetTextExtent() or wxDC::GetTextExtent() depending on the
|
||||
// value of m_useDCImpl.
|
||||
//
|
||||
// This must be always used instead of calling DoGetTextExtent() directly!
|
||||
void CallGetTextExtent(const wxString& string,
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL);
|
||||
|
||||
|
||||
// Exactly one of m_dc and m_win is non-NULL for any given object of this
|
||||
// class.
|
||||
const wxDC* const m_dc;
|
||||
const wxWindow* const m_win;
|
||||
|
||||
// If this is true, simply forward to wxDC::GetTextExtent() from our
|
||||
// CallGetTextExtent() instead of calling our own DoGetTextExtent().
|
||||
//
|
||||
// We need this because our DoGetTextExtent() typically only works with
|
||||
// native DCs, i.e. those having an HDC under Windows or using Pango under
|
||||
// GTK+. However wxTextMeasure object can be constructed for any wxDC, not
|
||||
// necessarily a native one and in this case we must call back into the DC
|
||||
// implementation of text measuring itself.
|
||||
bool m_useDCImpl;
|
||||
|
||||
// This one can be NULL or not.
|
||||
const wxFont* const m_font;
|
||||
|
||||
|
Reference in New Issue
Block a user