textmeasure.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/generic/private/textmeasure.h
  3. // Purpose: Generic wxTextMeasure declaration.
  4. // Author: Vadim Zeitlin
  5. // Created: 2012-10-17
  6. // Copyright: (c) 1997-2012 wxWidgets team
  7. // Licence: wxWindows licence
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_GENERIC_PRIVATE_TEXTMEASURE_H_
  10. #define _WX_GENERIC_PRIVATE_TEXTMEASURE_H_
  11. // ----------------------------------------------------------------------------
  12. // wxTextMeasure for the platforms without native support.
  13. // ----------------------------------------------------------------------------
  14. class wxTextMeasure : public wxTextMeasureBase
  15. {
  16. public:
  17. wxEXPLICIT wxTextMeasure(const wxDC *dc, const wxFont *font = NULL)
  18. : wxTextMeasureBase(dc, font) {}
  19. wxEXPLICIT wxTextMeasure(const wxWindow *win, const wxFont *font = NULL)
  20. : wxTextMeasureBase(win, font) {}
  21. protected:
  22. virtual void DoGetTextExtent(const wxString& string,
  23. wxCoord *width,
  24. wxCoord *height,
  25. wxCoord *descent = NULL,
  26. wxCoord *externalLeading = NULL);
  27. virtual bool DoGetPartialTextExtents(const wxString& text,
  28. wxArrayInt& widths,
  29. double scaleX);
  30. wxDECLARE_NO_COPY_CLASS(wxTextMeasure);
  31. };
  32. #endif // _WX_GENERIC_PRIVATE_TEXTMEASURE_H_