]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/radiobox.h
activating DrawRectangle optimization
[wxWidgets.git] / include / wx / gtk / radiobox.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
6b0d8a01 2// Name: wx/gtk/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
b5dbe15d 15class WXDLLIMPEXP_FWD_CORE wxGTKRadioButtonInfo;
dc26eeb3
VZ
16
17#include "wx/list.h"
18
a10a31ce 19WX_DECLARE_EXPORTED_LIST(wxGTKRadioButtonInfo, wxRadioBoxButtonsInfoList);
dc26eeb3
VZ
20
21
c801d85f
KB
22//-----------------------------------------------------------------------------
23// wxRadioBox
24//-----------------------------------------------------------------------------
25
27c78e45
VZ
26class WXDLLIMPEXP_CORE wxRadioBox : public wxControl,
27 public wxRadioBoxBase
c801d85f 28{
0de9b5b2 29public:
27c78e45 30 // ctors and dtor
ec373f2a 31 wxRadioBox() { }
f6bcfd97
BP
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,
e77669fc 39 int majorDim = 0,
3998c74b 40 long style = wxRA_SPECIFY_COLS,
c8531822 41 const wxValidator& val = wxDefaultValidator,
f6bcfd97 42 const wxString& name = wxRadioBoxNameStr)
6de97a3b 43 {
f6bcfd97 44 Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
6de97a3b 45 }
27c78e45 46
584ad2a3
MB
47 wxRadioBox(wxWindow *parent,
48 wxWindowID id,
49 const wxString& title,
50 const wxPoint& pos,
51 const wxSize& size,
52 const wxArrayString& choices,
e77669fc 53 int majorDim = 0,
3998c74b 54 long style = wxRA_SPECIFY_COLS,
584ad2a3
MB
55 const wxValidator& val = wxDefaultValidator,
56 const wxString& name = wxRadioBoxNameStr)
57 {
584ad2a3
MB
58 Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
59 }
f6bcfd97 60
f6bcfd97
BP
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,
3998c74b 69 long style = wxRA_SPECIFY_COLS,
c8531822 70 const wxValidator& val = wxDefaultValidator,
f6bcfd97 71 const wxString& name = wxRadioBoxNameStr);
584ad2a3
MB
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,
3998c74b 79 long style = wxRA_SPECIFY_COLS,
584ad2a3
MB
80 const wxValidator& val = wxDefaultValidator,
81 const wxString& name = wxRadioBoxNameStr);
f6bcfd97 82
27c78e45
VZ
83 virtual ~wxRadioBox();
84
c8531822 85
27c78e45 86 // implement wxItemContainerImmutable methods
aa61d352 87 virtual unsigned int GetCount() const;
c8531822 88
aa61d352
VZ
89 virtual wxString GetString(unsigned int n) const;
90 virtual void SetString(unsigned int n, const wxString& s);
c8531822 91
27c78e45
VZ
92 virtual void SetSelection(int n);
93 virtual int GetSelection() const;
c8531822 94
c8531822 95
27c78e45 96 // implement wxRadioBoxBase methods
aa61d352
VZ
97 virtual bool Show(unsigned int n, bool show = true);
98 virtual bool Enable(unsigned int n, bool enable = true);
27c78e45 99
aa61d352
VZ
100 virtual bool IsItemEnabled(unsigned int n) const;
101 virtual bool IsItemShown(unsigned int n) const;
27c78e45
VZ
102
103
104 // override some base class methods to operate on radiobox itself too
b4efc9b9
WS
105 virtual bool Show( bool show = true );
106 virtual bool Enable( bool enable = true );
c8531822 107
27c78e45
VZ
108 virtual void SetLabel( const wxString& label );
109
9d522606
RD
110 static wxVisualAttributes
111 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
112
dc26eeb3
VZ
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
72a7edf0
RR
124 // implementation
125 // --------------
c8531822 126
72a7edf0
RR
127 void GtkDisableEvents();
128 void GtkEnableEvents();
72a7edf0 129#if wxUSE_TOOLTIPS
558a94bd 130 virtual void GTKApplyToolTip(const char* tip);
72a7edf0 131#endif // wxUSE_TOOLTIPS
c4ca49cd 132
dc26eeb3 133 wxRadioBoxButtonsInfoList m_buttonsInfo;
f6bcfd97
BP
134
135protected:
677dc0ed
JS
136 virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
137
aa1e6de9
VZ
138#if wxUSE_TOOLTIPS
139 virtual void DoSetItemToolTip(unsigned int n, wxToolTip *tooltip);
140#endif
141
ef5c70f9
VZ
142 virtual void DoApplyWidgetStyle(GtkRcStyle *style);
143 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
6f02a879 144
bd2e08d0
VS
145 virtual bool GTKNeedsToFilterSameWindowFocus() const { return true; }
146
2e1f5012
VZ
147 virtual bool GTKWidgetNeedsMnemonic() const;
148 virtual void GTKWidgetDoSetMnemonic(GtkWidget* w);
149
54517652
RR
150private:
151 DECLARE_DYNAMIC_CLASS(wxRadioBox)
c801d85f
KB
152};
153
27c78e45 154#endif // _WX_GTK_RADIOBOX_H_