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