]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/radiobox.h
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKRADIOBOXH__
12 #define __GTKRADIOBOXH__
14 #if defined(__GNUG__) && !defined(__APPLE__)
18 #include "wx/bitmap.h"
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 class wxRadioBox
: public wxControl
27 wxRadioBox() { Init(); }
28 wxRadioBox(wxWindow
*parent
,
30 const wxString
& title
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
34 const wxString choices
[] = (const wxString
*) NULL
,
36 long style
= wxRA_HORIZONTAL
,
37 const wxValidator
& val
= wxDefaultValidator
,
38 const wxString
& name
= wxRadioBoxNameStr
)
42 Create( parent
, id
, title
, pos
, size
, n
, choices
, majorDim
, style
, val
, name
);
45 virtual ~wxRadioBox();
46 bool Create(wxWindow
*parent
,
48 const wxString
& title
,
49 const wxPoint
& pos
= wxDefaultPosition
,
50 const wxSize
& size
= wxDefaultSize
,
52 const wxString choices
[] = (const wxString
*) NULL
,
54 long style
= wxRA_HORIZONTAL
,
55 const wxValidator
& val
= wxDefaultValidator
,
56 const wxString
& name
= wxRadioBoxNameStr
);
58 int FindString( const wxString
& s
) const;
59 void SetSelection( int n
);
60 int GetSelection() const;
62 wxString
GetString( int n
) const;
63 void SetString( int n
, const wxString
& label
);
65 void Show( int item
, bool show
);
66 void Enable( int item
, bool enable
);
68 virtual wxString
GetStringSelection() const;
69 virtual bool SetStringSelection( const wxString
& s
);
72 int GetNumberOfRowsOrCols() const;
73 void SetNumberOfRowsOrCols( int n
);
75 // for compatibility only, don't use these methods in new code!
76 #if WXWIN_COMPATIBILITY_2_2
77 int Number() const { return GetCount(); }
78 wxString
GetLabel(int n
) const { return GetString(n
); }
79 void SetLabel( int item
, const wxString
& label
)
80 { SetString(item
, label
); }
81 #endif // WXWIN_COMPATIBILITY_2_2
83 // we have to override those to avoid virtual function name hiding
84 virtual wxString
GetLabel() const { return wxControl::GetLabel(); }
85 virtual void SetLabel( const wxString
& label
);
86 virtual bool Show( bool show
= TRUE
);
87 virtual bool Enable( bool enable
= TRUE
);
93 void GtkDisableEvents();
94 void GtkEnableEvents();
95 bool IsOwnGtkWindow( GdkWindow
*window
);
96 void ApplyWidgetStyle();
98 void ApplyToolTip( GtkTooltips
*tips
, const wxChar
*tip
);
99 #endif // wxUSE_TOOLTIPS
100 wxSize
LayoutItems();
102 virtual void DoSetSize( int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
103 virtual void OnInternalIdle();
111 // common part of all ctors
115 DECLARE_DYNAMIC_CLASS(wxRadioBox
)
118 #endif // __GTKRADIOBOXH__