]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/listbox.h
xti streaming
[wxWidgets.git] / include / wx / motif / listbox.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: listbox.h
3// Purpose: wxListBox class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_LISTBOX_H_
13#define _WX_LISTBOX_H_
14
3399051e 15#if defined(__GNUG__) && !defined(__APPLE__)
9b6dbb09
JS
16#pragma interface "listbox.h"
17#endif
18
6adaedf0 19#include "wx/ctrlsub.h"
99ab3e3f 20#include "wx/clntdata.h"
9b6dbb09 21
9b6dbb09
JS
22// forward decl for GetSelections()
23class WXDLLEXPORT wxArrayInt;
24
9b6dbb09 25// List box item
d7d38ea4 26class WXDLLEXPORT wxListBox: public wxListBoxBase
9b6dbb09 27{
83df96d6
JS
28 DECLARE_DYNAMIC_CLASS(wxListBox)
29
bfc6fde4
VZ
30public:
31 wxListBox();
32 wxListBox(wxWindow *parent, wxWindowID id,
83df96d6
JS
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize,
35 int n = 0, const wxString choices[] = NULL,
36 long style = 0,
37 const wxValidator& validator = wxDefaultValidator,
99ab3e3f 38 const wxString& name = wxListBoxNameStr)
83df96d6
JS
39 {
40 Create(parent, id, pos, size, n, choices, style, validator, name);
41 }
42
bfc6fde4 43 bool Create(wxWindow *parent, wxWindowID id,
83df96d6
JS
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxDefaultSize,
46 int n = 0, const wxString choices[] = NULL,
47 long style = 0,
48 const wxValidator& validator = wxDefaultValidator,
49 const wxString& name = wxListBoxNameStr);
50
bfc6fde4 51 ~wxListBox();
83df96d6 52
ef41d80c 53 // implementation of wxControlWithItems
6adaedf0
JS
54 virtual int GetCount() const;
55 virtual int DoAppend(const wxString& item);
99ab3e3f
MB
56 virtual void DoSetItemClientData(int n, void* clientData);
57 virtual void* DoGetItemClientData(int n) const;
58 virtual void DoSetItemClientObject(int n, wxClientData* clientData);
59 virtual wxClientData* DoGetItemClientObject(int n) const;
ef41d80c
MB
60 virtual int GetSelection() const;
61 virtual void Delete(int n);
62 virtual int FindString(const wxString& s) const;
63 virtual void Clear();
64 virtual void SetString(int n, const wxString& s);
65 virtual wxString GetString(int n) const;
66
67 // implementation of wxListBoxbase
68 virtual void SetSelection(int n, bool select = TRUE);
6adaedf0
JS
69 virtual void DoInsertItems(const wxArrayString& items, int pos);
70 virtual void DoSetItems(const wxArrayString& items, void **clientData);
71 virtual void DoSetFirstItem(int n);
bfc6fde4 72 virtual int GetSelections(wxArrayInt& aSelections) const;
ef41d80c 73 virtual bool IsSelected(int n) const;
18128cbb 74
ef41d80c 75 // For single or multiple choice list item
bfc6fde4 76 void Command(wxCommandEvent& event);
83df96d6 77
bfc6fde4 78 // Implementation
bfc6fde4
VZ
79 virtual void ChangeBackgroundColour();
80 virtual void ChangeForegroundColour();
81 WXWidget GetTopWidget() const;
ef41d80c
MB
82
83#if wxUSE_CHECKLISTBOX
84 virtual void DoToggleItem(int item, int x) {};
85#endif
f97c9854 86protected:
e1aae528
MB
87 virtual wxSize DoGetBestSize() const;
88
bfc6fde4 89 int m_noItems;
83df96d6 90
bfc6fde4 91 // List mapping positions->client data
99ab3e3f
MB
92 wxClientDataDictionary m_clientDataDict;
93private:
94 void SetSelectionPolicy();
9b6dbb09
JS
95};
96
97#endif
83df96d6 98// _WX_LISTBOX_H_