]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/radiobox.h
Added some missing STL-like wxArray/wxArrayString constructors.
[wxWidgets.git] / include / wx / gtk1 / radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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 wxRadioBox(wxWindow *parent,
45 wxWindowID id,
46 const wxString& title,
47 const wxPoint& pos,
48 const wxSize& size,
49 const wxArrayString& choices,
50 int majorDim = 1,
51 long style = wxRA_HORIZONTAL,
52 const wxValidator& val = wxDefaultValidator,
53 const wxString& name = wxRadioBoxNameStr)
54 {
55 Init();
56
57 Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
58 }
59
60 virtual ~wxRadioBox();
61 bool Create(wxWindow *parent,
62 wxWindowID id,
63 const wxString& title,
64 const wxPoint& pos = wxDefaultPosition,
65 const wxSize& size = wxDefaultSize,
66 int n = 0,
67 const wxString choices[] = (const wxString *) NULL,
68 int majorDim = 0,
69 long style = wxRA_HORIZONTAL,
70 const wxValidator& val = wxDefaultValidator,
71 const wxString& name = wxRadioBoxNameStr);
72 bool Create(wxWindow *parent,
73 wxWindowID id,
74 const wxString& title,
75 const wxPoint& pos,
76 const wxSize& size,
77 const wxArrayString& choices,
78 int majorDim = 0,
79 long style = wxRA_HORIZONTAL,
80 const wxValidator& val = wxDefaultValidator,
81 const wxString& name = wxRadioBoxNameStr);
82
83 int FindString( const wxString& s) const;
84 void SetSelection( int n );
85 int GetSelection() const;
86
87 wxString GetString( int n ) const;
88 void SetString( int n, const wxString& label );
89
90 void Show( int item, bool show );
91 void Enable( int item, bool enable );
92
93 virtual wxString GetStringSelection() const;
94 virtual bool SetStringSelection( const wxString& s );
95
96 int GetCount() const;
97 int GetNumberOfRowsOrCols() const;
98 void SetNumberOfRowsOrCols( int n );
99
100 // for compatibility only, don't use these methods in new code!
101 #if WXWIN_COMPATIBILITY_2_2
102 int Number() const { return GetCount(); }
103 wxString GetLabel(int n) const { return GetString(n); }
104 void SetLabel( int item, const wxString& label )
105 { SetString(item, label); }
106 #endif // WXWIN_COMPATIBILITY_2_2
107
108 // we have to override those to avoid virtual function name hiding
109 virtual wxString GetLabel() const { return wxControl::GetLabel(); }
110 virtual void SetLabel( const wxString& label );
111 virtual bool Show( bool show = TRUE );
112 virtual bool Enable( bool enable = TRUE );
113
114 // implementation
115 // --------------
116
117 void SetFocus();
118 void GtkDisableEvents();
119 void GtkEnableEvents();
120 bool IsOwnGtkWindow( GdkWindow *window );
121 void ApplyWidgetStyle();
122 #if wxUSE_TOOLTIPS
123 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
124 #endif // wxUSE_TOOLTIPS
125 wxSize LayoutItems();
126
127 virtual void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
128 virtual void OnInternalIdle();
129
130 bool m_hasFocus,
131 m_lostFocus;
132 int m_majorDim;
133 wxList m_boxes;
134
135 protected:
136 // common part of all ctors
137 void Init();
138
139 private:
140 DECLARE_DYNAMIC_CLASS(wxRadioBox)
141 };
142
143 #endif // __GTKRADIOBOXH__