]>
Commit | Line | Data |
---|---|---|
fb896a32 DE |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/cocoa/listbox.h | |
3 | // Purpose: wxListBox class | |
4 | // Author: David Elliott | |
5 | // Modified by: | |
6 | // Created: 2003/03/16 | |
7 | // RCS-ID: $Id: | |
8 | // Copyright: (c) 2003 David Elliott | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __WX_COCOA_LISTBOX_H__ | |
13 | #define __WX_COCOA_LISTBOX_H__ | |
14 | ||
15 | //#include "wx/cocoa/NSTableView.h" | |
16 | ||
17 | // ======================================================================== | |
18 | // wxListBox | |
19 | // ======================================================================== | |
20 | class WXDLLEXPORT wxListBox: public wxListBoxBase //, protected wxCocoaNSTableView | |
21 | { | |
22 | DECLARE_DYNAMIC_CLASS(wxListBox) | |
23 | DECLARE_EVENT_TABLE() | |
24 | WX_DECLARE_COCOA_OWNER(NSTableView,NSControl,NSView) | |
25 | // ------------------------------------------------------------------------ | |
26 | // initialization | |
27 | // ------------------------------------------------------------------------ | |
28 | public: | |
29 | wxListBox() { } | |
30 | wxListBox(wxWindow *parent, wxWindowID winid, | |
31 | const wxPoint& pos = wxDefaultPosition, | |
32 | const wxSize& size = wxDefaultSize, | |
33 | int n = 0, const wxString choices[] = NULL, | |
34 | long style = 0, | |
35 | const wxValidator& validator = wxDefaultValidator, | |
36 | const wxString& name = wxListBoxNameStr) | |
37 | { | |
38 | Create(parent, winid, pos, size, n, choices, style, validator, name); | |
39 | } | |
40 | ||
41 | bool Create(wxWindow *parent, wxWindowID winid, | |
42 | const wxPoint& pos = wxDefaultPosition, | |
43 | const wxSize& size = wxDefaultSize, | |
44 | int n = 0, const wxString choices[] = NULL, | |
45 | long style = 0, | |
46 | const wxValidator& validator = wxDefaultValidator, | |
47 | const wxString& name = wxListBoxNameStr); | |
48 | virtual ~wxListBox(); | |
49 | ||
50 | // ------------------------------------------------------------------------ | |
51 | // Cocoa callbacks | |
52 | // ------------------------------------------------------------------------ | |
53 | protected: | |
54 | // ------------------------------------------------------------------------ | |
55 | // Implementation | |
56 | // ------------------------------------------------------------------------ | |
57 | public: | |
58 | // pure virtuals from wxListBoxBase | |
59 | virtual bool IsSelected(int n) const; | |
60 | virtual void SetSelection(int n, bool select = TRUE); | |
61 | virtual int GetSelections(wxArrayInt& aSelections) const; | |
62 | protected: | |
63 | virtual void DoInsertItems(const wxArrayString& items, int pos); | |
64 | virtual void DoSetItems(const wxArrayString& items, void **clientData); | |
65 | virtual void DoSetFirstItem(int n); | |
66 | ||
67 | // pure virtuals from wxItemContainer | |
68 | public: | |
69 | // deleting items | |
70 | virtual void Clear(); | |
71 | virtual void Delete(int n); | |
72 | // accessing strings | |
73 | virtual int GetCount() const; | |
74 | virtual wxString GetString(int n) const; | |
75 | virtual void SetString(int n, const wxString& s); | |
76 | virtual int FindString(const wxString& s) const; | |
77 | // selection | |
78 | virtual void Select(int n); | |
79 | virtual int GetSelection() const; | |
80 | protected: | |
81 | virtual int DoAppend(const wxString& item); | |
82 | virtual void DoSetItemClientData(int n, void* clientData); | |
83 | virtual void* DoGetItemClientData(int n) const; | |
84 | virtual void DoSetItemClientObject(int n, wxClientData* clientData); | |
85 | virtual wxClientData* DoGetItemClientObject(int n) const; | |
86 | }; | |
87 | ||
88 | #endif // __WX_COCOA_LISTBOX_H__ |