]>
git.saurik.com Git - wxWidgets.git/blob - src/common/lboxcmn.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/lboxcmn.cpp
3 // Purpose: wxListBox class methods common to all platforms
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "listboxbase.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/listbox.h"
35 // ============================================================================
37 // ============================================================================
39 // ----------------------------------------------------------------------------
41 // ----------------------------------------------------------------------------
43 void wxListBoxBase::InsertItems(int nItems
, const wxString
*items
, int pos
)
46 for ( int n
= 0; n
< nItems
; n
++ )
51 DoInsertItems(aItems
, pos
);
55 void wxListBoxBase::Set(int nItems
, const wxString
* items
, void **clientData
)
58 for ( int n
= 0; n
< nItems
; n
++ )
63 DoSetItems(aItems
, clientData
);
66 // ----------------------------------------------------------------------------
68 // ----------------------------------------------------------------------------
70 bool wxListBoxBase::SetStringSelection(const wxString
& s
, bool select
)
72 int sel
= FindString(s
);
73 wxCHECK_MSG( sel
!= -1, FALSE
,
74 wxT("invalid string in SetStringSelection") );
76 SetSelection(sel
, select
);
81 // ----------------------------------------------------------------------------
83 // ----------------------------------------------------------------------------
85 void wxListBoxBase::Command(wxCommandEvent
& event
)
87 SetSelection(event
.m_commandInt
, event
.m_extraLong
!= 0);
88 (void)ProcessEvent(event
);
91 void wxListBoxBase::SetFirstItem(const wxString
& s
)
93 int n
= FindString(s
);
95 wxCHECK_RET( n
!= -1, wxT("invalid string in wxListBox::SetFirstItem") );