]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/radiobox.h
don't use a floating point value as a boolean flag; gcc4 (correctly) complains when...
[wxWidgets.git] / include / wx / gtk / radiobox.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
6b0d8a01 2// Name: wx/gtk/radiobox.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
58614078
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKRADIOBOXH__
11#define __GTKRADIOBOXH__
12
c801d85f
KB
13#include "wx/bitmap.h"
14
c801d85f
KB
15//-----------------------------------------------------------------------------
16// wxRadioBox
17//-----------------------------------------------------------------------------
18
20123d49 19class WXDLLIMPEXP_CORE wxRadioBox: public wxControl
c801d85f 20{
0de9b5b2 21public:
f6bcfd97
BP
22 wxRadioBox() { Init(); }
23 wxRadioBox(wxWindow *parent,
24 wxWindowID id,
25 const wxString& title,
26 const wxPoint& pos = wxDefaultPosition,
27 const wxSize& size = wxDefaultSize,
28 int n = 0,
29 const wxString choices[] = (const wxString *) NULL,
30 int majorDim = 1,
31 long style = wxRA_HORIZONTAL,
c8531822 32 const wxValidator& val = wxDefaultValidator,
f6bcfd97 33 const wxString& name = wxRadioBoxNameStr)
6de97a3b 34 {
f6bcfd97
BP
35 Init();
36
37 Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
6de97a3b 38 }
584ad2a3
MB
39 wxRadioBox(wxWindow *parent,
40 wxWindowID id,
41 const wxString& title,
42 const wxPoint& pos,
43 const wxSize& size,
44 const wxArrayString& choices,
45 int majorDim = 1,
46 long style = wxRA_HORIZONTAL,
47 const wxValidator& val = wxDefaultValidator,
48 const wxString& name = wxRadioBoxNameStr)
49 {
50 Init();
51
52 Create( parent, id, title, pos, size, choices, majorDim, style, val, name );
53 }
f6bcfd97 54
6b0d8a01 55 virtual ~wxRadioBox();
f6bcfd97
BP
56 bool Create(wxWindow *parent,
57 wxWindowID id,
58 const wxString& title,
59 const wxPoint& pos = wxDefaultPosition,
60 const wxSize& size = wxDefaultSize,
61 int n = 0,
62 const wxString choices[] = (const wxString *) NULL,
63 int majorDim = 0,
64 long style = wxRA_HORIZONTAL,
c8531822 65 const wxValidator& val = wxDefaultValidator,
f6bcfd97 66 const wxString& name = wxRadioBoxNameStr);
584ad2a3
MB
67 bool Create(wxWindow *parent,
68 wxWindowID id,
69 const wxString& title,
70 const wxPoint& pos,
71 const wxSize& size,
72 const wxArrayString& choices,
73 int majorDim = 0,
74 long style = wxRA_HORIZONTAL,
75 const wxValidator& val = wxDefaultValidator,
76 const wxString& name = wxRadioBoxNameStr);
f6bcfd97 77
853dcc57 78 virtual int FindString(const wxString& s, bool bCase = false) const;
debe6624 79 void SetSelection( int n );
0de9b5b2 80 int GetSelection() const;
c8531822 81
debe6624 82 wxString GetString( int n ) const;
0b06ac1f 83 void SetString( int n, const wxString& label );
c8531822 84
789f6795 85 virtual bool Show( int item, bool show = true );
1a87edf2 86 virtual bool Enable( int item, bool enable = true );
c8531822 87
0de9b5b2 88 virtual wxString GetStringSelection() const;
c801d85f 89 virtual bool SetStringSelection( const wxString& s );
c8531822
VZ
90
91 int GetCount() const;
c8531822
VZ
92
93 // for compatibility only, don't use these methods in new code!
94#if WXWIN_COMPATIBILITY_2_2
b4efc9b9
WS
95 wxDEPRECATED( int Number() const );
96 wxDEPRECATED( wxString GetLabel(int n) const );
97 wxDEPRECATED( void SetLabel( int item, const wxString& label ) );
c8531822
VZ
98#endif // WXWIN_COMPATIBILITY_2_2
99
100 // we have to override those to avoid virtual function name hiding
6b0d8a01
VZ
101 virtual wxString GetLabel() const { return wxControl::GetLabel(); }
102 virtual void SetLabel( const wxString& label );
b4efc9b9
WS
103 virtual bool Show( bool show = true );
104 virtual bool Enable( bool enable = true );
c8531822 105
9d522606
RD
106 static wxVisualAttributes
107 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
108
72a7edf0
RR
109 // implementation
110 // --------------
c8531822 111
72a7edf0
RR
112 void SetFocus();
113 void GtkDisableEvents();
114 void GtkEnableEvents();
b4071e91 115 bool IsOwnGtkWindow( GdkWindow *window );
f40fdaa3 116 void DoApplyWidgetStyle(GtkRcStyle *style);
72a7edf0
RR
117#if wxUSE_TOOLTIPS
118 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
119#endif // wxUSE_TOOLTIPS
c4ca49cd 120
f6bcfd97 121 virtual void OnInternalIdle();
c8531822 122
f6bcfd97
BP
123 bool m_hasFocus,
124 m_lostFocus;
d3b4d113 125 int m_majorDim;
d6d1892b 126 wxList m_boxes;
f6bcfd97
BP
127
128protected:
129 // common part of all ctors
130 void Init();
131
789f6795
WS
132 // check that the index is valid
133 // FIXME: remove once GTK will derive from wxRadioBoxBase
134 inline bool IsValid(int n) const { return n >= 0 && n < GetCount(); }
135
54517652
RR
136private:
137 DECLARE_DYNAMIC_CLASS(wxRadioBox)
c801d85f
KB
138};
139
140#endif // __GTKRADIOBOXH__