1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/radiobox.h
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_RADIOBOX_H_
11 #define _WX_GTK_RADIOBOX_H_
13 #include "wx/bitmap.h"
15 class WXDLLIMPEXP_FWD_CORE wxGTKRadioButtonInfo
;
19 WX_DECLARE_EXPORTED_LIST(wxGTKRadioButtonInfo
, wxRadioBoxButtonsInfoList
);
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
26 class WXDLLIMPEXP_CORE wxRadioBox
: public wxControl
,
32 wxRadioBox(wxWindow
*parent
,
34 const wxString
& title
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 const wxSize
& size
= wxDefaultSize
,
38 const wxString choices
[] = (const wxString
*) NULL
,
40 long style
= wxRA_SPECIFY_COLS
,
41 const wxValidator
& val
= wxDefaultValidator
,
42 const wxString
& name
= wxRadioBoxNameStr
)
44 Create( parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name
);
47 wxRadioBox(wxWindow
*parent
,
49 const wxString
& title
,
52 const wxArrayString
& choices
,
54 long style
= wxRA_SPECIFY_COLS
,
55 const wxValidator
& val
= wxDefaultValidator
,
56 const wxString
& name
= wxRadioBoxNameStr
)
58 Create( parent
, id
, title
, pos
, size
, choices
, majorDim
, style
, val
, name
);
61 bool Create(wxWindow
*parent
,
63 const wxString
& title
,
64 const wxPoint
& pos
= wxDefaultPosition
,
65 const wxSize
& size
= wxDefaultSize
,
67 const wxString choices
[] = (const wxString
*) NULL
,
69 long style
= wxRA_SPECIFY_COLS
,
70 const wxValidator
& val
= wxDefaultValidator
,
71 const wxString
& name
= wxRadioBoxNameStr
);
72 bool Create(wxWindow
*parent
,
74 const wxString
& title
,
77 const wxArrayString
& choices
,
79 long style
= wxRA_SPECIFY_COLS
,
80 const wxValidator
& val
= wxDefaultValidator
,
81 const wxString
& name
= wxRadioBoxNameStr
);
83 virtual ~wxRadioBox();
86 // implement wxItemContainerImmutable methods
87 virtual unsigned int GetCount() const;
89 virtual wxString
GetString(unsigned int n
) const;
90 virtual void SetString(unsigned int n
, const wxString
& s
);
92 virtual void SetSelection(int n
);
93 virtual int GetSelection() const;
96 // implement wxRadioBoxBase methods
97 virtual bool Show(unsigned int n
, bool show
= true);
98 virtual bool Enable(unsigned int n
, bool enable
= true);
100 virtual bool IsItemEnabled(unsigned int n
) const;
101 virtual bool IsItemShown(unsigned int n
) const;
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 );
108 virtual void SetLabel( const wxString
& label
);
110 static wxVisualAttributes
111 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
113 virtual int GetItemFromPoint( const wxPoint
& pt
) const;
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
120 return wxRadioBoxBase::DoGetHelpTextAtPoint( this, pt
, origin
);
127 void GtkDisableEvents();
128 void GtkEnableEvents();
130 virtual void GTKApplyToolTip(const char* tip
);
131 #endif // wxUSE_TOOLTIPS
133 wxRadioBoxButtonsInfoList m_buttonsInfo
;
136 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
139 virtual void DoSetItemToolTip(unsigned int n
, wxToolTip
*tooltip
);
142 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
143 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
145 virtual bool GTKNeedsToFilterSameWindowFocus() const { return true; }
147 virtual bool GTKWidgetNeedsMnemonic() const;
148 virtual void GTKWidgetDoSetMnemonic(GtkWidget
* w
);
151 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
154 #endif // _WX_GTK_RADIOBOX_H_