1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/radiobox.h
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef _WX_GTK_RADIOBOX_H_
10 #define _WX_GTK_RADIOBOX_H_
12 #include "wx/bitmap.h"
14 class WXDLLIMPEXP_FWD_CORE wxGTKRadioButtonInfo
;
18 WX_DECLARE_EXPORTED_LIST(wxGTKRadioButtonInfo
, wxRadioBoxButtonsInfoList
);
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 class WXDLLIMPEXP_CORE wxRadioBox
: public wxControl
,
31 wxRadioBox(wxWindow
*parent
,
33 const wxString
& title
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
37 const wxString choices
[] = (const wxString
*) NULL
,
39 long style
= wxRA_SPECIFY_COLS
,
40 const wxValidator
& val
= wxDefaultValidator
,
41 const wxString
& name
= wxRadioBoxNameStr
)
43 Create( parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name
);
46 wxRadioBox(wxWindow
*parent
,
48 const wxString
& title
,
51 const wxArrayString
& choices
,
53 long style
= wxRA_SPECIFY_COLS
,
54 const wxValidator
& val
= wxDefaultValidator
,
55 const wxString
& name
= wxRadioBoxNameStr
)
57 Create( parent
, id
, title
, pos
, size
, choices
, majorDim
, style
, val
, name
);
60 bool Create(wxWindow
*parent
,
62 const wxString
& title
,
63 const wxPoint
& pos
= wxDefaultPosition
,
64 const wxSize
& size
= wxDefaultSize
,
66 const wxString choices
[] = (const wxString
*) NULL
,
68 long style
= wxRA_SPECIFY_COLS
,
69 const wxValidator
& val
= wxDefaultValidator
,
70 const wxString
& name
= wxRadioBoxNameStr
);
71 bool Create(wxWindow
*parent
,
73 const wxString
& title
,
76 const wxArrayString
& choices
,
78 long style
= wxRA_SPECIFY_COLS
,
79 const wxValidator
& val
= wxDefaultValidator
,
80 const wxString
& name
= wxRadioBoxNameStr
);
82 virtual ~wxRadioBox();
85 // implement wxItemContainerImmutable methods
86 virtual unsigned int GetCount() const;
88 virtual wxString
GetString(unsigned int n
) const;
89 virtual void SetString(unsigned int n
, const wxString
& s
);
91 virtual void SetSelection(int n
);
92 virtual int GetSelection() const;
95 // implement wxRadioBoxBase methods
96 virtual bool Show(unsigned int n
, bool show
= true);
97 virtual bool Enable(unsigned int n
, bool enable
= true);
99 virtual bool IsItemEnabled(unsigned int n
) const;
100 virtual bool IsItemShown(unsigned int n
) const;
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 );
107 virtual void SetLabel( const wxString
& label
);
109 static wxVisualAttributes
110 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
112 virtual int GetItemFromPoint( const wxPoint
& pt
) const;
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
119 return wxRadioBoxBase::DoGetHelpTextAtPoint( this, pt
, origin
);
126 void GtkDisableEvents();
127 void GtkEnableEvents();
129 virtual void GTKApplyToolTip(const char* tip
);
130 #endif // wxUSE_TOOLTIPS
132 wxRadioBoxButtonsInfoList m_buttonsInfo
;
135 virtual wxBorder
GetDefaultBorder() const { return wxBORDER_NONE
; }
138 virtual void DoSetItemToolTip(unsigned int n
, wxToolTip
*tooltip
);
141 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
142 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
144 virtual bool GTKNeedsToFilterSameWindowFocus() const { return true; }
146 virtual bool GTKWidgetNeedsMnemonic() const;
147 virtual void GTKWidgetDoSetMnemonic(GtkWidget
* w
);
150 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
153 #endif // _WX_GTK_RADIOBOX_H_