]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/listbox.h
Added test.xpm generated from horse.png, for compilation.
[wxWidgets.git] / include / wx / gtk / listbox.h
CommitLineData
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
27class wxListBox;
a3622daa 28class wxArrayInt;
c801d85f
KB
29
30//-----------------------------------------------------------------------------
31// global data
32//-----------------------------------------------------------------------------
33
34extern const char *wxListBoxNameStr;
35
36//-----------------------------------------------------------------------------
37// wxListBox
38//-----------------------------------------------------------------------------
39
40class wxListBox: public wxControl
41{
42 DECLARE_DYNAMIC_CLASS(wxListBox)
43
44 public:
45
46 wxListBox(void);
6de97a3b
RR
47 inline wxListBox( wxWindow *parent, wxWindowID id,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
c67daf87 50 int n = 0, const wxString choices[] = (const wxString *) NULL,
6de97a3b
RR
51 long style = 0,
52 const wxValidator& validator = wxDefaultValidator,
53 const wxString& name = wxListBoxNameStr )
54 {
55 Create(parent, id, pos, size, n, choices, style, validator, name);
56 }
debe6624 57 bool Create( wxWindow *parent, wxWindowID id,
6de97a3b
RR
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& size = wxDefaultSize,
c67daf87 60 int n = 0, const wxString choices[] = (const wxString *) NULL,
6de97a3b
RR
61 long style = 0,
62 const wxValidator& validator = wxDefaultValidator,
63 const wxString& name = wxListBoxNameStr );
c801d85f
KB
64 void Append( const wxString &item );
65 void Append( const wxString &item, char *clientData );
66 void Clear(void);
67 void Delete( int n );
68 void Deselect( int n );
69 int FindString( const wxString &item ) const;
debe6624 70 char *GetClientData( int n ) const;
c801d85f 71 int GetSelection(void) const;
f5bf3b95 72 int GetSelections( class wxArrayInt &) const;
c801d85f
KB
73 wxString GetString( int n ) const;
74 wxString GetStringSelection(void) const;
75 int Number(void);
debe6624
JS
76 bool Selected( int n );
77 void Set( int n, const wxString *choices );
78 void SetClientData( int n, char *clientData );
c801d85f
KB
79 void SetFirstItem( int n );
80 void SetFirstItem( const wxString &item );
debe6624
JS
81 void SetSelection( int n, bool select = TRUE );
82 void SetString( int n, const wxString &string );
83 void SetStringSelection( const wxString &string, bool select = TRUE );
a60c99e6 84
a60c99e6 85 void SetDropTarget( wxDropTarget *dropTarget );
debe6624 86
b4071e91
RR
87 // implementation
88
89 int GetIndex( GtkWidget *item ) const;
90 GtkWidget *GetConnectWidget(void);
c058d771 91 bool IsOwnGtkWindow( GdkWindow *window );
58614078 92 void ApplyWidgetStyle();
b4071e91 93
c801d85f 94 GtkList *m_list;
e2414cbe 95 wxList m_clientData;
c801d85f 96
c801d85f
KB
97};
98
99#endif // __GTKLISTBOXH__