]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/listbox.h
wxScrolledWindow inherits from wxPanel to
[wxWidgets.git] / include / wx / gtk / listbox.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: listbox.h
ff8bfdbb 3// Purpose: wxListBox class declaration
c801d85f 4// Author: Robert Roebling
58614078
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
ff8bfdbb 7// Licence: wxWindows licence
c801d85f
KB
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
fd0eed64 40class wxListBox : public wxControl
c801d85f 41{
ff8bfdbb 42DECLARE_DYNAMIC_CLASS(wxListBox)
c801d85f 43
fd0eed64 44public:
ff8bfdbb
VZ
45 wxListBox();
46 wxListBox( 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 = wxListBoxNameStr )
53 {
54 m_hasCheckBoxes = FALSE;
55 Create(parent, id, pos, size, n, choices, style, validator, name);
56 }
57 virtual ~wxListBox();
58
59 bool Create(wxWindow *parent, wxWindowID id,
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 int n = 0, const wxString choices[] = (const wxString *) NULL,
63 long style = 0,
64 const wxValidator& validator = wxDefaultValidator,
65 const wxString& name = wxListBoxNameStr);
66
67 void Append( const wxString &item );
68 void Append( const wxString &item, void* clientData );
69 void Append( const wxString &item, wxClientData* clientData );
70
a994f81b
VZ
71 void InsertItems(int nItems, const wxString items[], int pos);
72
ff8bfdbb
VZ
73 void SetClientData( int n, void* clientData );
74 void* GetClientData( int n );
75 void SetClientObject( int n, wxClientData* clientData );
76 wxClientData* GetClientObject( int n );
77
0de9b5b2
RR
78 void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); }
79 wxClientData *GetClientObject() const { return wxControl::GetClientObject(); }
80 void SetClientData( void *data ) { wxControl::SetClientData( data ); }
81 void *GetClientData() const { return wxControl::GetClientData(); }
82
ff8bfdbb
VZ
83 void Clear();
84 void Delete( int n );
85
86 void Deselect( int n );
87 int FindString( const wxString &item ) const;
88 int GetSelection(void) const;
89 int GetSelections( class wxArrayInt &) const;
90 wxString GetString( int n ) const;
91 wxString GetStringSelection(void) const;
92 int Number();
93 bool Selected( int n );
94 void Set( int n, const wxString *choices );
95 void SetFirstItem( int n );
96 void SetFirstItem( const wxString &item );
97 void SetSelection( int n, bool select = TRUE );
98 void SetString( int n, const wxString &string );
99 void SetStringSelection( const wxString &string, bool select = TRUE );
c801d85f 100
06cfab17 101#if wxUSE_DRAG_AND_DROP
ff8bfdbb 102 void SetDropTarget( wxDropTarget *dropTarget );
ac57418f 103#endif
debe6624 104
ff8bfdbb
VZ
105 // implementation
106
107 void AppendCommon( const wxString &item );
108 int GetIndex( GtkWidget *item ) const;
109 GtkWidget *GetConnectWidget();
110 bool IsOwnGtkWindow( GdkWindow *window );
111 void ApplyWidgetStyle();
112
113#if wxUSE_TOOLTIPS
4de6207a 114 void ApplyToolTip( GtkTooltips *tips, const wxChar *tip );
ff8bfdbb
VZ
115#endif // wxUSE_TOOLTIPS
116
117 GtkList *m_list;
118 wxList m_clientDataList;
119 wxList m_clientObjectList;
120 bool m_hasCheckBoxes;
c801d85f
KB
121};
122
123#endif // __GTKLISTBOXH__