]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk/radiobox.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Copyright: (c) 1998 Robert Roebling | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #ifndef _WX_GTK_RADIOBOX_H_ | |
10 | #define _WX_GTK_RADIOBOX_H_ | |
11 | ||
12 | #include "wx/bitmap.h" | |
13 | ||
14 | class WXDLLIMPEXP_FWD_CORE wxGTKRadioButtonInfo; | |
15 | ||
16 | #include "wx/list.h" | |
17 | ||
18 | WX_DECLARE_EXPORTED_LIST(wxGTKRadioButtonInfo, wxRadioBoxButtonsInfoList); | |
19 | ||
20 | ||
21 | //----------------------------------------------------------------------------- | |
22 | // wxRadioBox | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
25 | class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, | |
26 | public wxRadioBoxBase | |
27 | { | |
28 | public: | |
29 | // ctors and dtor | |
30 | wxRadioBox() { } | |
31 | wxRadioBox(wxWindow *parent, | |
32 | wxWindowID id, | |
33 | const wxString& title, | |
34 | const wxPoint& pos = wxDefaultPosition, | |
35 | const wxSize& size = wxDefaultSize, | |
36 | int n = 0, | |
37 | const wxString choices[] = (const wxString *) NULL, | |
38 | int majorDim = 0, | |
39 | long style = wxRA_SPECIFY_COLS, | |
40 | const wxValidator& val = wxDefaultValidator, | |
41 | const wxString& name = wxRadioBoxNameStr) | |
42 | { | |
43 | Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name ); | |
44 | } | |
45 | ||
46 | wxRadioBox(wxWindow *parent, | |
47 | wxWindowID id, | |
48 | const wxString& title, | |
49 | const wxPoint& pos, | |
50 | const wxSize& size, | |
51 | const wxArrayString& choices, | |
52 | int majorDim = 0, | |
53 | long style = wxRA_SPECIFY_COLS, | |
54 | const wxValidator& val = wxDefaultValidator, | |
55 | const wxString& name = wxRadioBoxNameStr) | |
56 | { | |
57 | Create( parent, id, title, pos, size, choices, majorDim, style, val, name ); | |
58 | } | |
59 | ||
60 | bool Create(wxWindow *parent, | |
61 | wxWindowID id, | |
62 | const wxString& title, | |
63 | const wxPoint& pos = wxDefaultPosition, | |
64 | const wxSize& size = wxDefaultSize, | |
65 | int n = 0, | |
66 | const wxString choices[] = (const wxString *) NULL, | |
67 | int majorDim = 0, | |
68 | long style = wxRA_SPECIFY_COLS, | |
69 | const wxValidator& val = wxDefaultValidator, | |
70 | const wxString& name = wxRadioBoxNameStr); | |
71 | bool Create(wxWindow *parent, | |
72 | wxWindowID id, | |
73 | const wxString& title, | |
74 | const wxPoint& pos, | |
75 | const wxSize& size, | |
76 | const wxArrayString& choices, | |
77 | int majorDim = 0, | |
78 | long style = wxRA_SPECIFY_COLS, | |
79 | const wxValidator& val = wxDefaultValidator, | |
80 | const wxString& name = wxRadioBoxNameStr); | |
81 | ||
82 | virtual ~wxRadioBox(); | |
83 | ||
84 | ||
85 | // implement wxItemContainerImmutable methods | |
86 | virtual unsigned int GetCount() const; | |
87 | ||
88 | virtual wxString GetString(unsigned int n) const; | |
89 | virtual void SetString(unsigned int n, const wxString& s); | |
90 | ||
91 | virtual void SetSelection(int n); | |
92 | virtual int GetSelection() const; | |
93 | ||
94 | ||
95 | // implement wxRadioBoxBase methods | |
96 | virtual bool Show(unsigned int n, bool show = true); | |
97 | virtual bool Enable(unsigned int n, bool enable = true); | |
98 | ||
99 | virtual bool IsItemEnabled(unsigned int n) const; | |
100 | virtual bool IsItemShown(unsigned int n) const; | |
101 | ||
102 | ||
103 | // override some base class methods to operate on radiobox itself too | |
104 | virtual bool Show( bool show = true ); | |
105 | virtual bool Enable( bool enable = true ); | |
106 | ||
107 | virtual void SetLabel( const wxString& label ); | |
108 | ||
109 | static wxVisualAttributes | |
110 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
111 | ||
112 | virtual int GetItemFromPoint( const wxPoint& pt ) const; | |
113 | #if wxUSE_HELP | |
114 | // override virtual wxWindow::GetHelpTextAtPoint to use common platform independent | |
115 | // wxRadioBoxBase::DoGetHelpTextAtPoint from the platform independent | |
116 | // base class-interface wxRadioBoxBase. | |
117 | virtual wxString GetHelpTextAtPoint(const wxPoint & pt, wxHelpEvent::Origin origin) const | |
118 | { | |
119 | return wxRadioBoxBase::DoGetHelpTextAtPoint( this, pt, origin ); | |
120 | } | |
121 | #endif // wxUSE_HELP | |
122 | ||
123 | // implementation | |
124 | // -------------- | |
125 | ||
126 | void GtkDisableEvents(); | |
127 | void GtkEnableEvents(); | |
128 | #if wxUSE_TOOLTIPS | |
129 | virtual void GTKApplyToolTip(const char* tip); | |
130 | #endif // wxUSE_TOOLTIPS | |
131 | ||
132 | wxRadioBoxButtonsInfoList m_buttonsInfo; | |
133 | ||
134 | protected: | |
135 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } | |
136 | ||
137 | #if wxUSE_TOOLTIPS | |
138 | virtual void DoSetItemToolTip(unsigned int n, wxToolTip *tooltip); | |
139 | #endif | |
140 | ||
141 | virtual void DoApplyWidgetStyle(GtkRcStyle *style); | |
142 | virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const; | |
143 | ||
144 | virtual bool GTKNeedsToFilterSameWindowFocus() const { return true; } | |
145 | ||
146 | virtual bool GTKWidgetNeedsMnemonic() const; | |
147 | virtual void GTKWidgetDoSetMnemonic(GtkWidget* w); | |
148 | ||
149 | private: | |
150 | DECLARE_DYNAMIC_CLASS(wxRadioBox) | |
151 | }; | |
152 | ||
153 | #endif // _WX_GTK_RADIOBOX_H_ |