]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/listbox.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/listbox.cpp
4 // Author: William Osborne - minimal working wxPalmOS port
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
21 #include "wx/listbox.h"
24 #include "wx/dynarray.h"
25 #include "wx/settings.h"
31 #include "wx/window.h"
34 #include "wx/palmos/private.h"
37 #include "wx/ownerdrw.h"
40 // ============================================================================
41 // list box item declaration and implementation
42 // ============================================================================
46 class wxListBoxItem
: public wxOwnerDrawn
49 wxListBoxItem(const wxString
& str
= wxEmptyString
);
52 wxListBoxItem::wxListBoxItem(const wxString
& str
) : wxOwnerDrawn(str
, false)
54 // no bitmaps/checkmarks
58 wxOwnerDrawn
*wxListBox::CreateLboxItem(size_t WXUNUSED(n
))
60 return new wxListBoxItem();
63 #endif //USE_OWNER_DRAWN
65 // ============================================================================
66 // list box control implementation
67 // ============================================================================
69 // ----------------------------------------------------------------------------
71 // ----------------------------------------------------------------------------
74 wxListBox::wxListBox()
78 bool wxListBox::Create(wxWindow
*parent
,
82 int n
, const wxString choices
[],
84 const wxValidator
& validator
,
90 bool wxListBox::Create(wxWindow
*parent
,
94 const wxArrayString
& choices
,
96 const wxValidator
& validator
,
102 wxListBox::~wxListBox()
106 WXDWORD
wxListBox::MSWGetStyle(long style
, WXDWORD
*exstyle
) const
111 // ----------------------------------------------------------------------------
112 // implementation of wxListBoxBase methods
113 // ----------------------------------------------------------------------------
115 void wxListBox::DoSetFirstItem(int N
)
119 void wxListBox::DoDeleteOneItem(unsigned int n
)
123 void wxListBox::DoClear()
127 void wxListBox::Free()
131 void wxListBox::DoSetSelection(int N
, bool select
)
135 bool wxListBox::IsSelected(int N
) const
140 void *wxListBox::DoGetItemClientData(unsigned int n
) const
145 void wxListBox::DoSetItemClientData(unsigned int n
, void *clientData
)
149 // Return number of selections and an array of selected integers
150 int wxListBox::GetSelections(wxArrayInt
& aSelections
) const
155 // Get single selection, for single choice list items
156 int wxListBox::GetSelection() const
161 // Find string for position
162 wxString
wxListBox::GetString(unsigned int n
) const
164 return wxEmptyString
;
167 int wxListBox::DoInsertItems(const wxArrayStringsAdapter
& items
,
170 wxClientDataType type
)
174 void wxListBox::SetString(unsigned int n
, const wxString
& s
)
178 unsigned int wxListBox::GetCount() const
183 // ----------------------------------------------------------------------------
185 // ----------------------------------------------------------------------------
187 void wxListBox::SetHorizontalExtent(const wxString
& s
)
191 wxSize
wxListBox::DoGetBestSize() const
196 // ----------------------------------------------------------------------------
198 // ----------------------------------------------------------------------------
200 bool wxListBox::MSWCommand(WXUINT param
, WXWORD
WXUNUSED(id
))
205 // ----------------------------------------------------------------------------
206 // wxCheckListBox support
207 // ----------------------------------------------------------------------------
209 #if wxUSE_OWNER_DRAWN
214 // space beneath/above each row in pixels
215 // "standard" checklistbox use 1 here, some might prefer 2. 0 is ugly.
216 #define OWNER_DRAWN_LISTBOX_EXTRA_SPACE (1)
218 // the height is the same for all items
219 // TODO should be changed for LBS_OWNERDRAWVARIABLE style listboxes
221 // NB: can't forward this to wxListBoxItem because LB_SETITEMDATA
222 // message is not yet sent when we get here!
223 bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT
*item
)
228 // forward the message to the appropriate item
229 bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT
*item
)
234 #endif // wxUSE_OWNER_DRAWN
236 #endif // wxUSE_LISTBOX