]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/radiobox.h
compilation fixes and some cleanup
[wxWidgets.git] / include / wx / gtk1 / radiobox.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: radiobox.h
3// Purpose:
4// Author: Robert Roebling
58614078
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
f03fc89f 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
10
11#ifndef __GTKRADIOBOXH__
12#define __GTKRADIOBOXH__
13
14#ifdef __GNUG__
15#pragma interface
16#endif
17
18#include "wx/defs.h"
dcf924a3
RR
19
20#if wxUSE_RADIOBOX
21
c801d85f
KB
22#include "wx/object.h"
23#include "wx/list.h"
24#include "wx/control.h"
25#include "wx/bitmap.h"
26
27//-----------------------------------------------------------------------------
28// classes
29//-----------------------------------------------------------------------------
30
31class wxRadioBox;
32
33//-----------------------------------------------------------------------------
34// global data
35//-----------------------------------------------------------------------------
36
37extern const char *wxRadioBoxNameStr;
38
39//-----------------------------------------------------------------------------
40// wxRadioBox
41//-----------------------------------------------------------------------------
42
43class wxRadioBox: public wxControl
44{
0de9b5b2 45public:
f6bcfd97
BP
46 wxRadioBox() { Init(); }
47 wxRadioBox(wxWindow *parent,
48 wxWindowID id,
49 const wxString& title,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize,
52 int n = 0,
53 const wxString choices[] = (const wxString *) NULL,
54 int majorDim = 1,
55 long style = wxRA_HORIZONTAL,
56 const wxValidator& val = wxDefaultValidator,
57 const wxString& name = wxRadioBoxNameStr)
6de97a3b 58 {
f6bcfd97
BP
59 Init();
60
61 Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
6de97a3b 62 }
f6bcfd97
BP
63
64 ~wxRadioBox();
65 bool Create(wxWindow *parent,
66 wxWindowID id,
67 const wxString& title,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize,
70 int n = 0,
71 const wxString choices[] = (const wxString *) NULL,
72 int majorDim = 0,
73 long style = wxRA_HORIZONTAL,
74 const wxValidator& val = wxDefaultValidator,
75 const wxString& name = wxRadioBoxNameStr);
76
c801d85f 77 int FindString( const wxString& s) const;
debe6624 78 void SetSelection( int n );
0de9b5b2
RR
79 int GetSelection() const;
80
debe6624 81 wxString GetString( int n ) const;
0de9b5b2
RR
82
83 wxString GetLabel( int item ) const;
84 wxString GetLabel() const { return wxControl::GetLabel(); }
c801d85f 85 void SetLabel( const wxString& label );
debe6624 86 void SetLabel( int item, const wxString& label );
0de9b5b2
RR
87
88 /* doesn't work */
debe6624 89 void SetLabel( int item, wxBitmap *bitmap );
0de9b5b2 90
debe6624 91 bool Show( bool show );
0de9b5b2
RR
92 void Show( int item, bool show );
93
f03fc89f 94 bool Enable( bool enable );
debe6624 95 void Enable( int item, bool enable );
0de9b5b2
RR
96
97 virtual wxString GetStringSelection() const;
c801d85f 98 virtual bool SetStringSelection( const wxString& s );
0de9b5b2
RR
99
100 virtual int Number() const;
101 int GetNumberOfRowsOrCols() const;
debe6624 102 void SetNumberOfRowsOrCols( int n );
d3904ceb 103
72a7edf0
RR
104 // implementation
105 // --------------
868a2826 106
72a7edf0
RR
107 void SetFocus();
108 void GtkDisableEvents();
109 void GtkEnableEvents();
b4071e91 110 bool IsOwnGtkWindow( GdkWindow *window );
58614078 111 void ApplyWidgetStyle();
72a7edf0
RR
112#if wxUSE_TOOLTIPS
113 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
114#endif // wxUSE_TOOLTIPS
d3b4d113 115 wxSize LayoutItems();
f6bcfd97
BP
116
117 virtual void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
118 virtual void OnInternalIdle();
b4071e91 119
d6d1892b 120 bool m_alreadySent;
f6bcfd97
BP
121 bool m_hasFocus,
122 m_lostFocus;
d3b4d113 123 int m_majorDim;
d6d1892b 124 wxList m_boxes;
f6bcfd97
BP
125
126protected:
127 // common part of all ctors
128 void Init();
129
54517652
RR
130private:
131 DECLARE_DYNAMIC_CLASS(wxRadioBox)
c801d85f
KB
132};
133
dcf924a3
RR
134#endif
135
c801d85f 136#endif // __GTKRADIOBOXH__