]>
Commit | Line | Data |
---|---|---|
916eabe6 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/generic/stattextg.h | |
3 | // Purpose: wxGenericStaticText header | |
4 | // Author: Marcin Wojdyr | |
5 | // Created: 2008-06-26 | |
916eabe6 VZ |
6 | // Copyright: Marcin Wojdyr |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_GENERIC_STATTEXTG_H_ | |
11 | #define _WX_GENERIC_STATTEXTG_H_ | |
12 | ||
bce49490 VZ |
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 | |
16 | // with other ports) | |
17 | #define wxNO_PORT_STATTEXT_INCLUDE | |
916eabe6 | 18 | #include "wx/stattext.h" |
bce49490 | 19 | #undef wxNO_PORT_STATTEXT_INCLUDE |
916eabe6 VZ |
20 | |
21 | class WXDLLIMPEXP_CORE wxGenericStaticText : public wxStaticTextBase | |
22 | { | |
23 | public: | |
2814e718 | 24 | wxGenericStaticText() { Init(); } |
916eabe6 VZ |
25 | |
26 | wxGenericStaticText(wxWindow *parent, | |
27 | wxWindowID id, | |
28 | const wxString& label, | |
29 | const wxPoint& pos = wxDefaultPosition, | |
30 | const wxSize& size = wxDefaultSize, | |
31 | long style = 0, | |
32 | const wxString& name = wxStaticTextNameStr) | |
33 | { | |
2814e718 VZ |
34 | Init(); |
35 | ||
916eabe6 VZ |
36 | Create(parent, id, label, pos, size, style, name); |
37 | } | |
38 | ||
39 | bool Create(wxWindow *parent, | |
40 | wxWindowID id, | |
41 | const wxString& label, | |
42 | const wxPoint& pos = wxDefaultPosition, | |
43 | const wxSize& size = wxDefaultSize, | |
44 | long style = 0, | |
45 | const wxString& name = wxStaticTextNameStr); | |
46 | ||
2814e718 VZ |
47 | virtual ~wxGenericStaticText(); |
48 | ||
916eabe6 | 49 | |
5851e640 | 50 | // overridden base class virtual methods |
916eabe6 VZ |
51 | virtual void SetLabel(const wxString& label); |
52 | virtual bool SetFont(const wxFont &font); | |
53 | ||
5851e640 VZ |
54 | protected: |
55 | virtual wxSize DoGetBestClientSize() const; | |
56 | ||
916eabe6 VZ |
57 | virtual wxString DoGetLabel() const { return m_label; } |
58 | virtual void DoSetLabel(const wxString& label); | |
59 | ||
916eabe6 VZ |
60 | void DoSetSize(int x, int y, int width, int height, int sizeFlags); |
61 | ||
2814e718 VZ |
62 | #if wxUSE_MARKUP |
63 | virtual bool DoSetLabelMarkup(const wxString& markup); | |
64 | #endif // wxUSE_MARKUP | |
65 | ||
916eabe6 | 66 | private: |
2814e718 VZ |
67 | void Init() |
68 | { | |
69 | #if wxUSE_MARKUP | |
70 | m_markupText = NULL; | |
71 | #endif // wxUSE_MARKUP | |
72 | } | |
73 | ||
f26c1c3e VZ |
74 | void OnPaint(wxPaintEvent& event); |
75 | ||
2814e718 VZ |
76 | void DoDrawLabel(wxDC& dc, const wxRect& rect); |
77 | ||
78 | // These fields are only used if m_markupText == NULL. | |
916eabe6 VZ |
79 | wxString m_label; |
80 | int m_mnemonic; | |
81 | ||
2814e718 VZ |
82 | #if wxUSE_MARKUP |
83 | class wxMarkupText *m_markupText; | |
84 | #endif // wxUSE_MARKUP | |
85 | ||
916eabe6 VZ |
86 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText) |
87 | }; | |
88 | ||
89 | #endif // _WX_GENERIC_STATTEXTG_H_ | |
90 |