]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/private/textmeasure.h
Add missing WXK constants for the control keys
[wxWidgets.git] / include / wx / msw / private / textmeasure.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/private/textmeasure.h
3 // Purpose: wxMSW-specific declaration of wxTextMeasure class
4 // Author: Manuel Martin
5 // Created: 2012-10-05
6 // Copyright: (c) 1997-2012 wxWidgets team
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_MSW_PRIVATE_TEXTMEASURE_H_
11 #define _WX_MSW_PRIVATE_TEXTMEASURE_H_
12
13 #include "wx/msw/wrapwin.h"
14
15 // ----------------------------------------------------------------------------
16 // wxTextMeasure for MSW.
17 // ----------------------------------------------------------------------------
18
19 class wxTextMeasure : public wxTextMeasureBase
20 {
21 public:
22 wxTextMeasure(const wxDC *dc, const wxFont *font)
23 : wxTextMeasureBase(dc, font)
24 {
25 Init();
26 }
27 wxTextMeasure(const wxWindow *win, const wxFont *font)
28 : wxTextMeasureBase(win, font)
29 {
30 Init();
31 }
32
33 protected:
34 void Init();
35
36 virtual void BeginMeasuring();
37 virtual void EndMeasuring();
38
39 virtual void DoGetTextExtent(const wxString& string,
40 wxCoord *width,
41 wxCoord *height,
42 wxCoord *descent = NULL,
43 wxCoord *externalLeading = NULL);
44
45 virtual bool DoGetPartialTextExtents(const wxString& text,
46 wxArrayInt& widths,
47 double scaleX);
48
49
50
51 // We use either the HDC of the provided wxDC or an HDC created for our
52 // window.
53 HDC m_hdc;
54
55 // If we change the font in BeginMeasuring(), we restore it to the old one
56 // in EndMeasuring().
57 HFONT m_hfontOld;
58
59 wxDECLARE_NO_COPY_CLASS(wxTextMeasure);
60 };
61
62 #endif // _WX_MSW_PRIVATE_TEXTMEASURE_H_