]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: choice.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 __GTKCHOICEH__ | |
12 | #define __GTKCHOICEH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | #include "wx/object.h" | |
20 | #include "wx/list.h" | |
21 | #include "wx/control.h" | |
22 | ||
23 | //----------------------------------------------------------------------------- | |
24 | // classes | |
25 | //----------------------------------------------------------------------------- | |
26 | ||
27 | class wxChoice; | |
28 | ||
29 | //----------------------------------------------------------------------------- | |
30 | // global data | |
31 | //----------------------------------------------------------------------------- | |
32 | ||
33 | extern const char *wxChoiceNameStr; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // wxChoice | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
39 | class wxChoice: public wxControl | |
40 | { | |
41 | DECLARE_DYNAMIC_CLASS(wxChoice) | |
42 | ||
43 | public: | |
44 | ||
45 | wxChoice(void); | |
46 | inline wxChoice( wxWindow *parent, wxWindowID id, | |
47 | const wxPoint& pos = wxDefaultPosition, | |
48 | const wxSize& size = wxDefaultSize, | |
49 | int n = 0, const wxString choices[] = (const wxString *) NULL, | |
50 | long style = 0, | |
51 | const wxValidator& validator = wxDefaultValidator, | |
52 | const wxString& name = wxChoiceNameStr ) | |
53 | { | |
54 | Create(parent, id, pos, size, n, choices, style, validator, name); | |
55 | } | |
56 | bool Create( wxWindow *parent, wxWindowID id, | |
57 | const wxPoint& pos = wxDefaultPosition, | |
58 | const wxSize& size = wxDefaultSize, | |
59 | int n = 0, const wxString choices[] = (wxString *) NULL, | |
60 | long style = 0, | |
61 | const wxValidator& validator = wxDefaultValidator, | |
62 | const wxString& name = wxChoiceNameStr ); | |
63 | void Append( const wxString &item ); | |
64 | void Clear(void); | |
65 | void Delete(int n); | |
66 | int FindString( const wxString &string ) const; | |
67 | int GetColumns(void) const; | |
68 | int GetSelection(void); | |
69 | wxString GetString( int n ) const; | |
70 | wxString GetStringSelection(void) const; | |
71 | int Number(void) const; | |
72 | void SetColumns( int n = 1 ); | |
73 | void SetSelection( int n ); | |
74 | void SetStringSelection( const wxString &string ); | |
75 | ||
76 | // implementation | |
77 | ||
78 | void ApplyWidgetStyle(); | |
79 | }; | |
80 | ||
81 | #endif // __GTKCHOICEH__ |