]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: listbox.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling | |
c801d85f KB |
7 | // Licence: wxWindows licence |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | ||
11 | #ifndef __GTKLISTBOXH__ | |
12 | #define __GTKLISTBOXH__ | |
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 wxListBox; | |
a3622daa | 28 | class wxArrayInt; |
c801d85f KB |
29 | |
30 | //----------------------------------------------------------------------------- | |
31 | // global data | |
32 | //----------------------------------------------------------------------------- | |
33 | ||
34 | extern const char *wxListBoxNameStr; | |
35 | ||
36 | //----------------------------------------------------------------------------- | |
37 | // wxListBox | |
38 | //----------------------------------------------------------------------------- | |
39 | ||
fd0eed64 | 40 | class wxListBox : public wxControl |
c801d85f KB |
41 | { |
42 | DECLARE_DYNAMIC_CLASS(wxListBox) | |
43 | ||
fd0eed64 | 44 | public: |
c801d85f | 45 | |
fd0eed64 RR |
46 | wxListBox(); |
47 | inline wxListBox( wxWindow *parent, wxWindowID id, | |
48 | const wxPoint& pos = wxDefaultPosition, | |
49 | const wxSize& size = wxDefaultSize, | |
50 | int n = 0, const wxString choices[] = (const wxString *) NULL, | |
51 | long style = 0, | |
52 | const wxValidator& validator = wxDefaultValidator, | |
53 | const wxString& name = wxListBoxNameStr ) | |
54 | { | |
6de97a3b | 55 | Create(parent, id, pos, size, n, choices, style, validator, name); |
fd0eed64 RR |
56 | } |
57 | ~wxListBox(); | |
58 | bool Create( wxWindow *parent, wxWindowID id, | |
59 | const wxPoint& pos = wxDefaultPosition, | |
60 | const wxSize& size = wxDefaultSize, | |
61 | int n = 0, const wxString choices[] = (const wxString *) NULL, | |
62 | long style = 0, | |
63 | const wxValidator& validator = wxDefaultValidator, | |
64 | const wxString& name = wxListBoxNameStr ); | |
65 | ||
66 | void Append( const wxString &item ); | |
67 | void Append( const wxString &item, void* clientData ); | |
68 | void Append( const wxString &item, wxClientData* clientData ); | |
69 | ||
70 | void SetClientData( int n, void* clientData ); | |
71 | void* GetClientData( int n ); | |
72 | void SetClientObject( int n, wxClientData* clientData ); | |
73 | wxClientData* GetClientObject( int n ); | |
74 | ||
75 | void Clear(); | |
76 | void Delete( int n ); | |
77 | ||
78 | void Deselect( int n ); | |
79 | int FindString( const wxString &item ) const; | |
80 | int GetSelection(void) const; | |
81 | int GetSelections( class wxArrayInt &) const; | |
82 | wxString GetString( int n ) const; | |
83 | wxString GetStringSelection(void) const; | |
84 | int Number(); | |
85 | bool Selected( int n ); | |
86 | void Set( int n, const wxString *choices ); | |
87 | void SetFirstItem( int n ); | |
88 | void SetFirstItem( const wxString &item ); | |
89 | void SetSelection( int n, bool select = TRUE ); | |
90 | void SetString( int n, const wxString &string ); | |
91 | void SetStringSelection( const wxString &string, bool select = TRUE ); | |
a60c99e6 | 92 | |
fd0eed64 | 93 | void SetDropTarget( wxDropTarget *dropTarget ); |
debe6624 | 94 | |
fd0eed64 | 95 | // implementation |
b4071e91 | 96 | |
fd0eed64 RR |
97 | void AppendCommon( const wxString &item ); |
98 | int GetIndex( GtkWidget *item ) const; | |
99 | GtkWidget *GetConnectWidget(); | |
100 | bool IsOwnGtkWindow( GdkWindow *window ); | |
101 | void ApplyWidgetStyle(); | |
c801d85f | 102 | |
fd0eed64 | 103 | GtkList *m_list; |
f5e27805 RR |
104 | wxList m_clientDataList; |
105 | wxList m_clientObjectList; | |
c801d85f KB |
106 | }; |
107 | ||
108 | #endif // __GTKLISTBOXH__ |