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