]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/radiobox.h
use XPMs in wxMGL
[wxWidgets.git] / include / wx / gtk / 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
c801d85f
KB
18#include "wx/bitmap.h"
19
c801d85f
KB
20//-----------------------------------------------------------------------------
21// wxRadioBox
22//-----------------------------------------------------------------------------
23
24class wxRadioBox: public wxControl
25{
0de9b5b2 26public:
f6bcfd97
BP
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)
6de97a3b 39 {
f6bcfd97
BP
40 Init();
41
42 Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
6de97a3b 43 }
f6bcfd97
BP
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
c801d85f 58 int FindString( const wxString& s) const;
debe6624 59 void SetSelection( int n );
0de9b5b2
RR
60 int GetSelection() const;
61
debe6624 62 wxString GetString( int n ) const;
0de9b5b2
RR
63
64 wxString GetLabel( int item ) const;
65 wxString GetLabel() const { return wxControl::GetLabel(); }
c801d85f 66 void SetLabel( const wxString& label );
debe6624 67 void SetLabel( int item, const wxString& label );
0de9b5b2
RR
68
69 /* doesn't work */
debe6624 70 void SetLabel( int item, wxBitmap *bitmap );
0de9b5b2 71
debe6624 72 bool Show( bool show );
0de9b5b2
RR
73 void Show( int item, bool show );
74
f03fc89f 75 bool Enable( bool enable );
debe6624 76 void Enable( int item, bool enable );
0de9b5b2
RR
77
78 virtual wxString GetStringSelection() const;
c801d85f 79 virtual bool SetStringSelection( const wxString& s );
0de9b5b2 80
1e6feb95
VZ
81 int Number() const;
82 int GetCount() const { return Number(); }
0de9b5b2 83 int GetNumberOfRowsOrCols() const;
debe6624 84 void SetNumberOfRowsOrCols( int n );
d3904ceb 85
72a7edf0
RR
86 // implementation
87 // --------------
868a2826 88
72a7edf0
RR
89 void SetFocus();
90 void GtkDisableEvents();
91 void GtkEnableEvents();
b4071e91 92 bool IsOwnGtkWindow( GdkWindow *window );
58614078 93 void ApplyWidgetStyle();
72a7edf0
RR
94#if wxUSE_TOOLTIPS
95 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
96#endif // wxUSE_TOOLTIPS
d3b4d113 97 wxSize LayoutItems();
f6bcfd97
BP
98
99 virtual void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
100 virtual void OnInternalIdle();
b4071e91 101
f6bcfd97
BP
102 bool m_hasFocus,
103 m_lostFocus;
d3b4d113 104 int m_majorDim;
d6d1892b 105 wxList m_boxes;
f6bcfd97
BP
106
107protected:
108 // common part of all ctors
109 void Init();
110
54517652
RR
111private:
112 DECLARE_DYNAMIC_CLASS(wxRadioBox)
c801d85f
KB
113};
114
115#endif // __GTKRADIOBOXH__