1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/stattextg.h
3 // Purpose: wxGenericStaticText header
4 // Author: Marcin Wojdyr
6 // Copyright: Marcin Wojdyr
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GENERIC_STATTEXTG_H_
11 #define _WX_GENERIC_STATTEXTG_H_
13 // prevent it from including the platform-specific wxStaticText declaration as
14 // this is not going to compile if it derives from wxGenericStaticText defined
15 // below (currently this is only the case in wxUniv but it could also happen
17 #define wxNO_PORT_STATTEXT_INCLUDE
18 #include "wx/stattext.h"
19 #undef wxNO_PORT_STATTEXT_INCLUDE
21 class WXDLLIMPEXP_CORE wxGenericStaticText
: public wxStaticTextBase
24 wxGenericStaticText() { Init(); }
26 wxGenericStaticText(wxWindow
*parent
,
28 const wxString
& label
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
32 const wxString
& name
= wxStaticTextNameStr
)
36 Create(parent
, id
, label
, pos
, size
, style
, name
);
39 bool Create(wxWindow
*parent
,
41 const wxString
& label
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
45 const wxString
& name
= wxStaticTextNameStr
);
47 virtual ~wxGenericStaticText();
50 // overridden base class virtual methods
51 virtual void SetLabel(const wxString
& label
);
52 virtual bool SetFont(const wxFont
&font
);
55 virtual wxSize
DoGetBestClientSize() const;
57 virtual wxString
DoGetLabel() const { return m_label
; }
58 virtual void DoSetLabel(const wxString
& label
);
60 void DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
);
63 virtual bool DoSetLabelMarkup(const wxString
& markup
);
64 #endif // wxUSE_MARKUP
71 #endif // wxUSE_MARKUP
74 void OnPaint(wxPaintEvent
& event
);
76 void DoDrawLabel(wxDC
& dc
, const wxRect
& rect
);
78 // These fields are only used if m_markupText == NULL.
83 class wxMarkupText
*m_markupText
;
84 #endif // wxUSE_MARKUP
86 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText
)
89 #endif // _WX_GENERIC_STATTEXTG_H_