if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( T("wxListBox creation failed") );
+ wxFAIL_MSG( wxT("wxListBox creation failed") );
return FALSE;
}
void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
GList *children = m_list->children;
int length = g_list_length(children);
- wxCHECK_RET( pos <= length, T("invalid index in wxListBox::InsertItems") );
+ wxCHECK_RET( pos <= length, wxT("invalid index in wxListBox::InsertItems") );
// VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item
// into a listbox at the given position, this is why we first delete
void wxListBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
GtkWidget *list_item;
void wxListBox::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxListBox::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, NULL, wxT("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxListBox::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxListBox::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, wxT("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxListBox::Clear()
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
gtk_list_clear_items( m_list, 0, Number() );
void wxListBox::Delete( int n )
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
- wxCHECK_RET( child, T("wrong listbox index") );
+ wxCHECK_RET( child, wxT("wrong listbox index") );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( m_list, list );
void wxListBox::Deselect( int n )
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
DisableEvents();
int wxListBox::FindString( const wxString &item ) const
{
- wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, wxT("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelection() const
{
- wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, wxT("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelections( wxArrayInt& aSelections ) const
{
- wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, wxT("invalid listbox") );
// get the number of selected items first
GList *child = m_list->children;
wxString wxListBox::GetString( int n ) const
{
- wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, wxT(""), wxT("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
return str;
}
- wxFAIL_MSG(T("wrong listbox index"));
+ wxFAIL_MSG(wxT("wrong listbox index"));
- return T("");
+ return wxT("");
}
wxString wxListBox::GetStringSelection() const
{
- wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, wxT(""), wxT("invalid listbox") );
GList *selection = m_list->selection;
if (selection)
return str;
}
- wxFAIL_MSG(T("no listbox selection available"));
- return T("");
+ wxFAIL_MSG(wxT("no listbox selection available"));
+ return wxT("");
}
int wxListBox::Number()
{
- wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, wxT("invalid listbox") );
GList *child = m_list->children;
int count = 0;
bool wxListBox::Selected( int n )
{
- wxCHECK_MSG( m_list != NULL, FALSE, T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, FALSE, wxT("invalid listbox") );
GList *target = g_list_nth( m_list->children, n );
if (target)
child = child->next;
}
}
- wxFAIL_MSG(T("wrong listbox index"));
+ wxFAIL_MSG(wxT("wrong listbox index"));
return FALSE;
}
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
{
- wxFAIL_MSG(T("wxListBox::Set not implemented"));
+ wxFAIL_MSG(wxT("wxListBox::Set not implemented"));
}
void wxListBox::SetFirstItem( int WXUNUSED(n) )
{
- wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented"));
+ wxFAIL_MSG(wxT("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
{
- wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented"));
+ wxFAIL_MSG(wxT("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetSelection( int n, bool select )
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
DisableEvents();
void wxListBox::SetString( int n, const wxString &string )
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
}
else
{
- wxFAIL_MSG(T("wrong listbox index"));
+ wxFAIL_MSG(wxT("wrong listbox index"));
}
}
void wxListBox::SetStringSelection( const wxString &string, bool select )
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
SetSelection( FindString(string), select );
}
#if wxUSE_DRAG_AND_DROP
void wxListBox::SetDropTarget( wxDropTarget *dropTarget )
{
- wxCHECK_RET( m_list != NULL, T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
#ifndef NEW_GTK_DND_CODE
if (m_dropTarget)