]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/listbox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/listbox.h
3 // Purpose: wxListBox class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_LISTBOX_H_
13 #define _WX_LISTBOX_H_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
18 #include "wx/dynarray.h"
19 #include "wx/arrstr.h"
21 // forward decl for GetSelections()
24 // forward decl for wxMacListControl data type.
25 class wxMacListControl
;
29 WX_DEFINE_ARRAY( char* , wxListDataArray
);
31 // ----------------------------------------------------------------------------
33 // ----------------------------------------------------------------------------
35 class WXDLLEXPORT wxListBox
: public wxListBoxBase
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 int n
= 0, const wxString choices
[] = NULL
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxListBoxNameStr
)
51 Create(parent
, winid
, pos
, size
, n
, choices
, style
, validator
, name
);
59 const wxArrayString
& choices
,
61 const wxValidator
& validator
= wxDefaultValidator
,
62 const wxString
& name
= wxListBoxNameStr
)
64 Create(parent
, winid
, pos
, size
, choices
, style
, validator
, name
);
70 const wxPoint
& pos
= wxDefaultPosition
,
71 const wxSize
& size
= wxDefaultSize
,
73 const wxString choices
[] = NULL
,
75 const wxValidator
& validator
= wxDefaultValidator
,
76 const wxString
& name
= wxListBoxNameStr
);
83 const wxArrayString
& choices
,
85 const wxValidator
& validator
= wxDefaultValidator
,
86 const wxString
& name
= wxListBoxNameStr
);
90 // implement base class pure virtuals
91 virtual void Refresh(bool eraseBack
= true, const wxRect
*rect
= NULL
);
93 virtual void Delete(unsigned int n
);
95 virtual unsigned int GetCount() const;
96 virtual wxString
GetString(unsigned int n
) const;
97 virtual void SetString(unsigned int n
, const wxString
& s
);
98 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
100 virtual bool IsSelected(int n
) const;
101 virtual int GetSelection() const;
102 virtual int GetSelections(wxArrayInt
& aSelections
) const;
104 virtual void EnsureVisible(int n
);
106 // wxCheckListBox support
107 static wxVisualAttributes
108 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
110 wxMacListControl
* GetPeer() const;
113 // from wxItemContainer
114 virtual int DoAppend(const wxString
& item
);
115 virtual void DoSetItemClientData(unsigned int n
, void* clientData
);
116 virtual void* DoGetItemClientData(unsigned int n
) const;
117 virtual void DoSetItemClientObject(unsigned int n
, wxClientData
* clientData
);
118 virtual wxClientData
* DoGetItemClientObject(unsigned int n
) const;
120 // from wxListBoxBase
121 virtual void DoSetSelection(int n
, bool select
);
122 virtual void DoInsertItems(const wxArrayString
& items
, unsigned int pos
);
123 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
124 virtual void DoSetFirstItem(int n
);
125 virtual int DoListHitTest(const wxPoint
& point
) const;
127 // free memory (common part of Clear() and dtor)
128 // prevent collision with some BSD definitions of macro Free()
131 virtual wxSize
DoGetBestSize() const;
134 DECLARE_DYNAMIC_CLASS(wxListBox
)
135 DECLARE_EVENT_TABLE()
138 #endif // _WX_LISTBOX_H_