]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/radiobox.h
added SetString(), deprecated SetLabel()
[wxWidgets.git] / include / wx / gtk / radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: radiobox.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __GTKRADIOBOXH__
12 #define __GTKRADIOBOXH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/bitmap.h"
19
20 //-----------------------------------------------------------------------------
21 // wxRadioBox
22 //-----------------------------------------------------------------------------
23
24 class wxRadioBox: public wxControl
25 {
26 public:
27 wxRadioBox() { Init(); }
28 wxRadioBox(wxWindow *parent,
29 wxWindowID id,
30 const wxString& title,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize,
33 int n = 0,
34 const wxString choices[] = (const wxString *) NULL,
35 int majorDim = 1,
36 long style = wxRA_HORIZONTAL,
37 const wxValidator& val = wxDefaultValidator,
38 const wxString& name = wxRadioBoxNameStr)
39 {
40 Init();
41
42 Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
43 }
44
45 ~wxRadioBox();
46 bool Create(wxWindow *parent,
47 wxWindowID id,
48 const wxString& title,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
51 int n = 0,
52 const wxString choices[] = (const wxString *) NULL,
53 int majorDim = 0,
54 long style = wxRA_HORIZONTAL,
55 const wxValidator& val = wxDefaultValidator,
56 const wxString& name = wxRadioBoxNameStr);
57
58 int FindString( const wxString& s) const;
59 void SetSelection( int n );
60 int GetSelection() const;
61
62 wxString GetString( int n ) const;
63 void SetLabel( const wxString& label );
64
65 void Show( int item, bool show );
66 void Enable( int item, bool enable );
67
68 virtual wxString GetStringSelection() const;
69 virtual bool SetStringSelection( const wxString& s );
70
71 int GetCount() const;
72 int GetNumberOfRowsOrCols() const;
73 void SetNumberOfRowsOrCols( int n );
74
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 #endif // WXWIN_COMPATIBILITY_2_2
81
82 // we have to override those to avoid virtual function name hiding
83 wxString GetLabel() const { return wxControl::GetLabel(); }
84 bool Show( bool show );
85 bool Enable( bool enable );
86
87 // implementation
88 // --------------
89
90 void SetFocus();
91 void GtkDisableEvents();
92 void GtkEnableEvents();
93 bool IsOwnGtkWindow( GdkWindow *window );
94 void ApplyWidgetStyle();
95 #if wxUSE_TOOLTIPS
96 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
97 #endif // wxUSE_TOOLTIPS
98 wxSize LayoutItems();
99
100 virtual void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
101 virtual void OnInternalIdle();
102
103 bool m_hasFocus,
104 m_lostFocus;
105 int m_majorDim;
106 wxList m_boxes;
107
108 protected:
109 // common part of all ctors
110 void Init();
111
112 private:
113 DECLARE_DYNAMIC_CLASS(wxRadioBox)
114 };
115
116 #endif // __GTKRADIOBOXH__