]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
8ef94bfc | 2 | // Name: wx/gtk1/radiobox.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
58614078 | 5 | // Copyright: (c) 1998 Robert Roebling |
65571936 | 6 | // Licence: wxWindows licence |
c801d85f KB |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
27c78e45 VZ |
9 | #ifndef _WX_GTK_RADIOBOX_H_ |
10 | #define _WX_GTK_RADIOBOX_H_ | |
c801d85f | 11 | |
c801d85f KB |
12 | #include "wx/bitmap.h" |
13 | ||
c801d85f KB |
14 | //----------------------------------------------------------------------------- |
15 | // wxRadioBox | |
16 | //----------------------------------------------------------------------------- | |
17 | ||
27c78e45 VZ |
18 | class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, |
19 | public wxRadioBoxBase | |
c801d85f | 20 | { |
0de9b5b2 | 21 | public: |
27c78e45 | 22 | // ctors and dtor |
f6bcfd97 BP |
23 | wxRadioBox() { Init(); } |
24 | wxRadioBox(wxWindow *parent, | |
25 | wxWindowID id, | |
26 | const wxString& title, | |
27 | const wxPoint& pos = wxDefaultPosition, | |
28 | const wxSize& size = wxDefaultSize, | |
29 | int n = 0, | |
30 | const wxString choices[] = (const wxString *) NULL, | |
31 | int majorDim = 1, | |
3998c74b | 32 | long style = wxRA_SPECIFY_COLS, |
c8531822 | 33 | const wxValidator& val = wxDefaultValidator, |
f6bcfd97 | 34 | const wxString& name = wxRadioBoxNameStr) |
6de97a3b | 35 | { |
f6bcfd97 BP |
36 | Init(); |
37 | ||
38 | Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name ); | |
6de97a3b | 39 | } |
27c78e45 | 40 | |
584ad2a3 MB |
41 | wxRadioBox(wxWindow *parent, |
42 | wxWindowID id, | |
43 | const wxString& title, | |
44 | const wxPoint& pos, | |
45 | const wxSize& size, | |
46 | const wxArrayString& choices, | |
47 | int majorDim = 1, | |
3998c74b | 48 | long style = wxRA_SPECIFY_COLS, |
584ad2a3 MB |
49 | const wxValidator& val = wxDefaultValidator, |
50 | const wxString& name = wxRadioBoxNameStr) | |
51 | { | |
52 | Init(); | |
53 | ||
54 | Create( parent, id, title, pos, size, choices, majorDim, style, val, name ); | |
55 | } | |
f6bcfd97 | 56 | |
f6bcfd97 BP |
57 | bool Create(wxWindow *parent, |
58 | wxWindowID id, | |
59 | const wxString& title, | |
60 | const wxPoint& pos = wxDefaultPosition, | |
61 | const wxSize& size = wxDefaultSize, | |
62 | int n = 0, | |
63 | const wxString choices[] = (const wxString *) NULL, | |
64 | int majorDim = 0, | |
3998c74b | 65 | long style = wxRA_SPECIFY_COLS, |
c8531822 | 66 | const wxValidator& val = wxDefaultValidator, |
f6bcfd97 | 67 | const wxString& name = wxRadioBoxNameStr); |
584ad2a3 MB |
68 | bool Create(wxWindow *parent, |
69 | wxWindowID id, | |
70 | const wxString& title, | |
71 | const wxPoint& pos, | |
72 | const wxSize& size, | |
73 | const wxArrayString& choices, | |
74 | int majorDim = 0, | |
3998c74b | 75 | long style = wxRA_SPECIFY_COLS, |
584ad2a3 MB |
76 | const wxValidator& val = wxDefaultValidator, |
77 | const wxString& name = wxRadioBoxNameStr); | |
f6bcfd97 | 78 | |
27c78e45 VZ |
79 | virtual ~wxRadioBox(); |
80 | ||
c8531822 | 81 | |
27c78e45 | 82 | // implement wxItemContainerImmutable methods |
aa61d352 | 83 | virtual unsigned int GetCount() const; |
c8531822 | 84 | |
aa61d352 VZ |
85 | virtual wxString GetString(unsigned int n) const; |
86 | virtual void SetString(unsigned int n, const wxString& s); | |
c8531822 | 87 | |
27c78e45 VZ |
88 | virtual void SetSelection(int n); |
89 | virtual int GetSelection() const; | |
c8531822 | 90 | |
c8531822 | 91 | |
27c78e45 | 92 | // implement wxRadioBoxBase methods |
aa61d352 VZ |
93 | virtual bool Show(unsigned int n, bool show = true); |
94 | virtual bool Enable(unsigned int n, bool enable = true); | |
27c78e45 | 95 | |
aa61d352 VZ |
96 | virtual bool IsItemEnabled(unsigned int n) const; |
97 | virtual bool IsItemShown(unsigned int n) const; | |
27c78e45 VZ |
98 | |
99 | ||
100 | // override some base class methods to operate on radiobox itself too | |
b4efc9b9 WS |
101 | virtual bool Show( bool show = true ); |
102 | virtual bool Enable( bool enable = true ); | |
c8531822 | 103 | |
27c78e45 VZ |
104 | virtual void SetLabel( const wxString& label ); |
105 | ||
9d522606 RD |
106 | static wxVisualAttributes |
107 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
108 | ||
72a7edf0 RR |
109 | // implementation |
110 | // -------------- | |
c8531822 | 111 | |
72a7edf0 RR |
112 | void SetFocus(); |
113 | void GtkDisableEvents(); | |
114 | void GtkEnableEvents(); | |
b4071e91 | 115 | bool IsOwnGtkWindow( GdkWindow *window ); |
f40fdaa3 | 116 | void DoApplyWidgetStyle(GtkRcStyle *style); |
72a7edf0 RR |
117 | #if wxUSE_TOOLTIPS |
118 | void ApplyToolTip( GtkTooltips *tips, const wxChar *tip ); | |
119 | #endif // wxUSE_TOOLTIPS | |
c4ca49cd | 120 | |
f6bcfd97 | 121 | virtual void OnInternalIdle(); |
c8531822 | 122 | |
f6bcfd97 BP |
123 | bool m_hasFocus, |
124 | m_lostFocus; | |
d6d1892b | 125 | wxList m_boxes; |
f6bcfd97 BP |
126 | |
127 | protected: | |
128 | // common part of all ctors | |
129 | void Init(); | |
130 | ||
54517652 RR |
131 | private: |
132 | DECLARE_DYNAMIC_CLASS(wxRadioBox) | |
c801d85f KB |
133 | }; |
134 | ||
27c78e45 | 135 | #endif // _WX_GTK_RADIOBOX_H_ |