warning msgs
[wxWidgets.git] / include / wx / gtk / listbox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: listbox.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // Id:
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11
12 #ifndef __GTKLISTBOXH__
13 #define __GTKLISTBOXH__
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/object.h"
21 #include "wx/list.h"
22 #include "wx/control.h"
23
24 //-----------------------------------------------------------------------------
25 // classes
26 //-----------------------------------------------------------------------------
27
28 class wxListBox;
29
30 //-----------------------------------------------------------------------------
31 // global data
32 //-----------------------------------------------------------------------------
33
34 extern const char *wxListBoxNameStr;
35
36 //-----------------------------------------------------------------------------
37 // wxListBox
38 //-----------------------------------------------------------------------------
39
40 class wxListBox: public wxControl
41 {
42 DECLARE_DYNAMIC_CLASS(wxListBox)
43
44 public:
45
46 wxListBox(void);
47 wxListBox( wxWindow *parent, wxWindowID id,
48 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
49 int n = 0, const wxString choices[] = NULL,
50 long style = 0, const wxString &name = wxListBoxNameStr );
51 bool Create( wxWindow *parent, wxWindowID id,
52 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
53 int n = 0, const wxString choices[] = NULL,
54 long style = 0, const wxString &name = wxListBoxNameStr );
55 void Append( const wxString &item );
56 void Append( const wxString &item, char *clientData );
57 void Clear(void);
58 void Delete( int n );
59 void Deselect( int n );
60 int FindString( const wxString &item ) const;
61 char *GetClientData( int n ) const;
62 int GetSelection(void) const;
63 int GetSelections( class wxArrayInt &) const;
64 wxString GetString( int n ) const;
65 wxString GetStringSelection(void) const;
66 int Number(void);
67 bool Selected( int n );
68 void Set( int n, const wxString *choices );
69 void SetClientData( int n, char *clientData );
70 void SetFirstItem( int n );
71 void SetFirstItem( const wxString &item );
72 void SetSelection( int n, bool select = TRUE );
73 void SetString( int n, const wxString &string );
74 void SetStringSelection( const wxString &string, bool select = TRUE );
75
76 virtual GtkWidget *GetDropTargetWidget(void);
77
78 private:
79
80 GtkList *m_list;
81 wxList m_clientData;
82
83 public:
84
85 int GetIndex( GtkWidget *item ) const;
86 };
87
88 #endif // __GTKLISTBOXH__