]> git.saurik.com Git - wxWidgets.git/blob - include/wx/generic/stattextg.h
CanSetTransparent needs to be virtual
[wxWidgets.git] / include / wx / generic / stattextg.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/stattextg.h
3 // Purpose: wxGenericStaticText header
4 // Author: Marcin Wojdyr
5 // Created: 2008-06-26
6 // Id: $Id$
7 // Copyright: Marcin Wojdyr
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_GENERIC_STATTEXTG_H_
12 #define _WX_GENERIC_STATTEXTG_H_
13
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
19 #include "wx/stattext.h"
20 #undef wxNO_PORT_STATTEXT_INCLUDE
21
22 class WXDLLIMPEXP_CORE wxGenericStaticText : public wxStaticTextBase
23 {
24 public:
25 wxGenericStaticText() { }
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 {
35 Create(parent, id, label, pos, size, style, name);
36 }
37
38 bool Create(wxWindow *parent,
39 wxWindowID id,
40 const wxString& label,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 long style = 0,
44 const wxString& name = wxStaticTextNameStr);
45
46
47 // overridden base class virtual methods
48 virtual void SetLabel(const wxString& label);
49 virtual bool SetFont(const wxFont &font);
50
51 protected:
52 virtual wxSize DoGetBestClientSize() const;
53
54 virtual wxString DoGetLabel() const { return m_label; }
55 virtual void DoSetLabel(const wxString& label);
56
57 void DoSetSize(int x, int y, int width, int height, int sizeFlags);
58
59 private:
60 void OnPaint(wxPaintEvent& event);
61
62 wxString m_label;
63 int m_mnemonic;
64
65 DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText)
66 };
67
68 #endif // _WX_GENERIC_STATTEXTG_H_
69