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