]>
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
);
92 virtual void DoClear();
93 virtual void DoDeleteOneItem(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 DoInsertItems(const wxArrayStringsAdapter
& items
,
116 void **clientData
, wxClientDataType type
);
118 virtual void DoSetItemClientData(unsigned int n
, void* clientData
);
119 virtual void* DoGetItemClientData(unsigned int n
) const;
121 // from wxListBoxBase
122 virtual void DoSetSelection(int n
, bool select
);
123 virtual void DoSetFirstItem(int n
);
124 virtual int DoListHitTest(const wxPoint
& point
) const;
126 // free memory (common part of Clear() and dtor)
127 // prevent collision with some BSD definitions of macro Free()
130 virtual wxSize
DoGetBestSize() const;
133 DECLARE_DYNAMIC_CLASS(wxListBox
)
134 DECLARE_EVENT_TABLE()
137 #endif // _WX_LISTBOX_H_