1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/radiobox.h
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKRADIOBOXH__
11 #define __GTKRADIOBOXH__
13 #include "wx/bitmap.h"
15 //-----------------------------------------------------------------------------
17 //-----------------------------------------------------------------------------
19 class WXDLLIMPEXP_CORE wxRadioBox
: public wxControl
22 wxRadioBox() { Init(); }
23 wxRadioBox(wxWindow
*parent
,
25 const wxString
& title
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
,
29 const wxString choices
[] = (const wxString
*) NULL
,
31 long style
= wxRA_HORIZONTAL
,
32 const wxValidator
& val
= wxDefaultValidator
,
33 const wxString
& name
= wxRadioBoxNameStr
)
37 Create( parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name
);
39 wxRadioBox(wxWindow
*parent
,
41 const wxString
& title
,
44 const wxArrayString
& choices
,
46 long style
= wxRA_HORIZONTAL
,
47 const wxValidator
& val
= wxDefaultValidator
,
48 const wxString
& name
= wxRadioBoxNameStr
)
52 Create( parent
, id
, title
, pos
, size
, choices
, majorDim
, style
, val
, name
);
55 virtual ~wxRadioBox();
56 bool Create(wxWindow
*parent
,
58 const wxString
& title
,
59 const wxPoint
& pos
= wxDefaultPosition
,
60 const wxSize
& size
= wxDefaultSize
,
62 const wxString choices
[] = (const wxString
*) NULL
,
64 long style
= wxRA_HORIZONTAL
,
65 const wxValidator
& val
= wxDefaultValidator
,
66 const wxString
& name
= wxRadioBoxNameStr
);
67 bool Create(wxWindow
*parent
,
69 const wxString
& title
,
72 const wxArrayString
& choices
,
74 long style
= wxRA_HORIZONTAL
,
75 const wxValidator
& val
= wxDefaultValidator
,
76 const wxString
& name
= wxRadioBoxNameStr
);
78 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
79 void SetSelection( int n
);
80 int GetSelection() const;
82 wxString
GetString( int n
) const;
83 void SetString( int n
, const wxString
& label
);
85 virtual bool Show( int item
, bool show
= true );
86 virtual bool Enable( int item
, bool enable
= true );
88 virtual wxString
GetStringSelection() const;
89 virtual bool SetStringSelection( const wxString
& s
);
93 // we have to override those to avoid virtual function name hiding
94 virtual wxString
GetLabel() const { return wxControl::GetLabel(); }
95 virtual void SetLabel( const wxString
& label
);
96 virtual bool Show( bool show
= true );
97 virtual bool Enable( bool enable
= true );
99 static wxVisualAttributes
100 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
106 void GtkDisableEvents();
107 void GtkEnableEvents();
108 bool IsOwnGtkWindow( GdkWindow
*window
);
109 void DoApplyWidgetStyle(GtkRcStyle
*style
);
111 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
112 #endif // wxUSE_TOOLTIPS
114 virtual void OnInternalIdle();
122 // common part of all ctors
125 // check that the index is valid
126 // FIXME: remove once GTK will derive from wxRadioBoxBase
127 inline bool IsValid(int n
) const { return n
>= 0 && n
< GetCount(); }
130 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
133 #endif // __GTKRADIOBOXH__