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