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