X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7360894949ff89740d023dc587be5aa31f5be693..b0d8bfa6cd4042d3ea8680ad0145f79e3cb15268:/src/motif/listbox.cpp diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 4219682a39..8eba4cd13a 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: listbox.cpp +// Name: src/motif/listbox.cpp // Purpose: wxListBox // Author: Julian Smart // Modified by: @@ -9,13 +9,11 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "listbox.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_LISTBOX + #ifdef __VMS #define XtParent XTPARENT #define XtDisplay XTDISPLAY @@ -91,7 +89,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id, validator, name ) ) return false; - m_noItems = n; + m_noItems = (size_t)n; m_backgroundColour = * wxWHITE; Widget parentWidget = (Widget) parent->GetClientWidget(); @@ -194,8 +192,9 @@ void wxListBox::DoSetFirstItem( int N ) { int count, length; - if (N < 0) + if (!IsValid(N)) return; + XtVaGetValues ((Widget) m_mainWidget, XmNvisibleItemCount, &count, XmNitemCount, &length, @@ -310,8 +309,10 @@ int wxDoFindStringInList(Widget w, const wxString& s) return -1; } -int wxListBox::FindString(const wxString& s) const +int wxListBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const { + // FIXME: back to base class for not supported value of bCase + return wxDoFindStringInList( (Widget)m_mainWidget, s ); } @@ -665,7 +666,7 @@ void wxListBox::ChangeForegroundColour() */ } -int wxListBox::GetCount() const +size_t wxListBox::GetCount() const { return m_noItems; } @@ -717,3 +718,4 @@ wxSize wxListBox::DoGetBestSize() const return wxDoGetListBoxBestSize( (Widget)m_mainWidget, this ); } +#endif // wxUSE_LISTBOX