/////////////////////////////////////////////////////////////////////////////
-// Name: listbox.cpp
+// Name: src/gtk1/listbox.cpp
// Purpose:
// Author: Robert Roebling
// Id: $Id$
#include "wx/intl.h"
#include "wx/checklst.h"
#include "wx/settings.h"
-#include "wx/gtk/private.h"
+#include "wx/gtk1/private.h"
#if wxUSE_TOOLTIPS
#include "wx/tooltip.h"
wxString str;
-#ifdef __WXGTK20__
- str = wxGTK_CONV_BACK( gtk_label_get_text( label ) );
-#else
str = wxString( label->label );
-#endif
#if wxUSE_CHECKLISTBOX
// checklistboxes have "[±] " prepended to their lables, remove it
//
- // NB: 4 below is the length of wxCHECKLBOX_STRING from wx/gtk/checklst.h
+ // NB: 4 below is the length of wxCHECKLBOX_STRING from wx/gtk1/checklst.h
if ( m_hasCheckBoxes )
str.erase(0, 4);
#endif // wxUSE_CHECKLISTBOX
wxString wxListBox::GetString( int n ) const
{
- wxCHECK_MSG( m_list != NULL, wxT(""), wxT("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, wxEmptyString, wxT("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
wxFAIL_MSG(wxT("wrong listbox index"));
- return wxT("");
+ return wxEmptyString;
}
int wxListBox::GetCount() const
return g_list_length(children);
}
-int wxListBox::FindString( const wxString &item ) const
+int wxListBox::FindString( const wxString &item, bool bCase ) const
{
- wxCHECK_MSG( m_list != NULL, -1, wxT("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, wxNOT_FOUND, wxT("invalid listbox") );
GList *child = m_list->children;
int count = 0;
while (child)
{
- if ( GetRealLabel(child) == item )
+ if ( item.IsSameAs( GetRealLabel(child), bCase ) )
return count;
count++;
}
#endif // wxUSE_LISTBOX
-