]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/radiobox.h
applied wxNativeFontInfo patch from Derry Bryson (with minor changes)
[wxWidgets.git] / include / wx / gtk / radiobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/defs.h"
19
20 #if wxUSE_RADIOBOX
21
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
31 class wxRadioBox;
32
33 //-----------------------------------------------------------------------------
34 // global data
35 //-----------------------------------------------------------------------------
36
37 extern const char *wxRadioBoxNameStr;
38
39 //-----------------------------------------------------------------------------
40 // wxRadioBox
41 //-----------------------------------------------------------------------------
42
43 class wxRadioBox: public wxControl
44 {
45 public:
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)
58 {
59 Init();
60
61 Create( parent, id, title, pos, size, n, choices, majorDim, style, val, name );
62 }
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
77 int FindString( const wxString& s) const;
78 void SetSelection( int n );
79 int GetSelection() const;
80
81 wxString GetString( int n ) const;
82
83 wxString GetLabel( int item ) const;
84 wxString GetLabel() const { return wxControl::GetLabel(); }
85 void SetLabel( const wxString& label );
86 void SetLabel( int item, const wxString& label );
87
88 /* doesn't work */
89 void SetLabel( int item, wxBitmap *bitmap );
90
91 bool Show( bool show );
92 void Show( int item, bool show );
93
94 bool Enable( bool enable );
95 void Enable( int item, bool enable );
96
97 virtual wxString GetStringSelection() const;
98 virtual bool SetStringSelection( const wxString& s );
99
100 virtual int Number() const;
101 int GetNumberOfRowsOrCols() const;
102 void SetNumberOfRowsOrCols( int n );
103
104 // implementation
105 // --------------
106
107 void SetFocus();
108 void GtkDisableEvents();
109 void GtkEnableEvents();
110 bool IsOwnGtkWindow( GdkWindow *window );
111 void ApplyWidgetStyle();
112 #if wxUSE_TOOLTIPS
113 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
114 #endif // wxUSE_TOOLTIPS
115 wxSize LayoutItems();
116
117 virtual void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
118 virtual void OnInternalIdle();
119
120 bool m_alreadySent;
121 bool m_hasFocus,
122 m_lostFocus;
123 int m_majorDim;
124 wxList m_boxes;
125
126 protected:
127 // common part of all ctors
128 void Init();
129
130 private:
131 DECLARE_DYNAMIC_CLASS(wxRadioBox)
132 };
133
134 #endif
135
136 #endif // __GTKRADIOBOXH__