]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/qt/listbox.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxListBox class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_LISTBOX_H_
13 #define _WX_LISTBOX_H_
16 #pragma interface "listbox.h"
19 #include "wx/control.h"
21 WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr
;
23 // forward decl for GetSelections()
24 class WXDLLEXPORT wxArrayInt
;
26 WXDLLEXPORT_DATA(extern const char*) wxEmptyString
;
29 class WXDLLEXPORT wxListBox
: public wxControl
31 DECLARE_DYNAMIC_CLASS(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
,
40 const wxValidator
& validator
= wxDefaultValidator
,
41 const wxString
& name
= wxListBoxNameStr
)
43 Create(parent
, id
, pos
, size
, n
, choices
, style
, validator
, name
);
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
,
51 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxListBoxNameStr
);
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 ;
61 virtual void SetSelection(int n
, bool select
= TRUE
);
63 virtual void Deselect(int n
);
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
);
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
);
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
) ;
83 virtual void InsertItems(int nItems
, const wxString items
[], int pos
);
85 virtual wxString
GetStringSelection() const ;
86 virtual bool SetStringSelection(const wxString
& s
, bool flag
= TRUE
);
87 virtual int Number() const ;
89 void Command(wxCommandEvent
& event
);