]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/radiobox.h
Remove sm_cocoaDelegate singleton. We need per-instance data anyway so we
[wxWidgets.git] / include / wx / gtk1 / 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 92
c8531822 93 // we have to override those to avoid virtual function name hiding
6b0d8a01
VZ
94 virtual wxString GetLabel() const { return wxControl::GetLabel(); }
95 virtual void SetLabel( const wxString& label );
b4efc9b9
WS
96 virtual bool Show( bool show = true );
97 virtual bool Enable( bool enable = true );
c8531822 98
9d522606
RD
99 static wxVisualAttributes
100 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
101
72a7edf0
RR
102 // implementation
103 // --------------
c8531822 104
72a7edf0
RR
105 void SetFocus();
106 void GtkDisableEvents();
107 void GtkEnableEvents();
b4071e91 108 bool IsOwnGtkWindow( GdkWindow *window );
f40fdaa3 109 void DoApplyWidgetStyle(GtkRcStyle *style);
72a7edf0
RR
110#if wxUSE_TOOLTIPS
111 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
112#endif // wxUSE_TOOLTIPS
c4ca49cd 113
f6bcfd97 114 virtual void OnInternalIdle();
c8531822 115
f6bcfd97
BP
116 bool m_hasFocus,
117 m_lostFocus;
d3b4d113 118 int m_majorDim;
d6d1892b 119 wxList m_boxes;
f6bcfd97
BP
120
121protected:
122 // common part of all ctors
123 void Init();
124
789f6795
WS
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(); }
128
54517652
RR
129private:
130 DECLARE_DYNAMIC_CLASS(wxRadioBox)
c801d85f
KB
131};
132
133#endif // __GTKRADIOBOXH__