]> git.saurik.com Git - wxWidgets.git/blame - include/wx/qt/listbox.h
shows different SetCursor() calls
[wxWidgets.git] / include / wx / qt / listbox.h
CommitLineData
7c78e7c7
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: listbox.h
01b2eeec
KB
3// Purpose: wxListBox class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
7c78e7c7
RR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
01b2eeec
KB
12#ifndef _WX_LISTBOX_H_
13#define _WX_LISTBOX_H_
7c78e7c7
RR
14
15#ifdef __GNUG__
01b2eeec 16#pragma interface "listbox.h"
7c78e7c7
RR
17#endif
18
7c78e7c7
RR
19#include "wx/control.h"
20
01b2eeec 21WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
7c78e7c7 22
01b2eeec
KB
23// forward decl for GetSelections()
24class WXDLLEXPORT wxArrayInt;
7c78e7c7 25
01b2eeec 26WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
7c78e7c7 27
01b2eeec
KB
28// List box item
29class WXDLLEXPORT wxListBox: public wxControl
7c78e7c7
RR
30{
31 DECLARE_DYNAMIC_CLASS(wxListBox)
01b2eeec
KB
32 public:
33
34 wxListBox();
35 inline wxListBox(wxWindow *parent, wxWindowID id,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
38 int n = 0, const wxString choices[] = NULL,
39 long style = 0,
40 const wxValidator& validator = wxDefaultValidator,
41 const wxString& name = wxListBoxNameStr)
42 {
43 Create(parent, id, pos, size, n, choices, style, validator, name);
44 }
45
46 bool Create(wxWindow *parent, wxWindowID id,
47 const wxPoint& pos = wxDefaultPosition,
48 const wxSize& size = wxDefaultSize,
49 int n = 0, const wxString choices[] = NULL,
50 long style = 0,
51 const wxValidator& validator = wxDefaultValidator,
52 const wxString& name = wxListBoxNameStr);
53
54 ~wxListBox();
55
56 virtual void Append(const wxString& item);
57 virtual void Append(const wxString& item, char *clientData);
58 virtual void Set(int n, const wxString* choices, char **clientData = NULL);
59 virtual int FindString(const wxString& s) const ;
60 virtual void Clear();
61 virtual void SetSelection(int n, bool select = TRUE);
7c78e7c7 62
01b2eeec 63 virtual void Deselect(int n);
7c78e7c7 64
01b2eeec
KB
65 // For single choice list item only
66 virtual int GetSelection() const ;
67 virtual void Delete(int n);
68 virtual char *GetClientData(int n) const ;
69 virtual void SetClientData(int n, char *clientData);
70 virtual void SetString(int n, const wxString& s);
71
72 // For single or multiple choice list item
73 virtual int GetSelections(wxArrayInt& aSelections) const;
74 virtual bool Selected(int n) const ;
75 virtual wxString GetString(int n) const ;
76 virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
77
78 // Set the specified item at the first visible item
79 // or scroll to max range.
80 virtual void SetFirstItem(int n) ;
81 virtual void SetFirstItem(const wxString& s) ;
82
83 virtual void InsertItems(int nItems, const wxString items[], int pos);
84
85 virtual wxString GetStringSelection() const ;
86 virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
87 virtual int Number() const ;
88
89 void Command(wxCommandEvent& event);
90
91 protected:
92 int m_noItems;
93 int m_selected;
7c78e7c7
RR
94};
95
01b2eeec
KB
96#endif
97 // _WX_LISTBOX_H_