-#include "wx/dynarray.h"
-#include "wx/arrstr.h"
-#include "wx/utils.h"
-#include "wx/intl.h"
-#include "wx/checklst.h"
-#include "wx/settings.h"
-#include "wx/log.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/dynarray.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/utils.h"
+ #include "wx/settings.h"
+ #include "wx/checklst.h"
+ #include "wx/arrstr.h"
+#endif
+
(wxClientData*) gtk_tree_entry_get_userdata(entry) );
else if ( listbox->HasClientUntypedData() )
event.SetClientData( gtk_tree_entry_get_userdata(entry) );
(wxClientData*) gtk_tree_entry_get_userdata(entry) );
else if ( listbox->HasClientUntypedData() )
event.SetClientData( gtk_tree_entry_get_userdata(entry) );
int ret = strcasecmp(gtk_tree_entry_get_collate_key(entry),
gtk_tree_entry_get_collate_key(entry2));
int ret = strcasecmp(gtk_tree_entry_get_collate_key(entry),
gtk_tree_entry_get_collate_key(entry2));
// Disable the pop-up textctrl that enables searching - note that
// the docs specify that even if this disabled (which we are doing)
// Disable the pop-up textctrl that enables searching - note that
// the docs specify that even if this disabled (which we are doing)
// ----------------------------------------------------------------------------
void wxListBox::GtkInsertItems(const wxArrayString& items,
// ----------------------------------------------------------------------------
void wxListBox::GtkInsertItems(const wxArrayString& items,
wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
GtkTreeIter* pIter = NULL; // append by default
wxASSERT_MSG(pos <= nCurCount, wxT("Invalid index passed to wxListBox"));
GtkTreeIter* pIter = NULL; // append by default
gboolean res = gtk_tree_model_iter_nth_child(
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
gboolean res = gtk_tree_model_iter_nth_child(
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
GtkInsertItems(items, NULL, pos);
}
int wxListBox::DoAppend( const wxString& item )
{
// Call DoInsertItems
GtkInsertItems(items, NULL, pos);
}
int wxListBox::DoAppend( const wxString& item )
{
// Call DoInsertItems
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
n
GTK_TREE_MODEL(m_liststore),
&iter, NULL, //NULL = parent = get first
n
wxT("Invalid index passed to GetItemClientData") );
GtkTreeEntry* entry = GtkGetEntry(n);
wxCHECK_MSG(entry, NULL, wxT("could not get entry"));
void* userdata = gtk_tree_entry_get_userdata( entry );
wxT("Invalid index passed to GetItemClientData") );
GtkTreeEntry* entry = GtkGetEntry(n);
wxCHECK_MSG(entry, NULL, wxT("could not get entry"));
void* userdata = gtk_tree_entry_get_userdata( entry );
wxT("Invalid index passed to SetItemClientData") );
GtkTreeEntry* entry = GtkGetEntry(n);
wxCHECK_RET(entry, wxT("could not get entry"));
gtk_tree_entry_set_userdata( entry, clientData );
wxT("Invalid index passed to SetItemClientData") );
GtkTreeEntry* entry = GtkGetEntry(n);
wxCHECK_RET(entry, wxT("could not get entry"));
gtk_tree_entry_set_userdata( entry, clientData );
{
// wxItemContainer already deletes data for us
wxListBox::DoSetItemClientData(n, (void*) clientData);
{
// wxItemContainer already deletes data for us
wxListBox::DoSetItemClientData(n, (void*) clientData);
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
GtkTreeEntry* entry = GtkGetEntry(n);
wxCHECK_RET( m_treeview != NULL, wxT("invalid listbox") );
GtkTreeEntry* entry = GtkGetEntry(n);
// notification function...
void* userdata = gtk_tree_entry_get_userdata(entry);
gtk_tree_entry_set_userdata(entry, NULL); //don't delete on destroy
// notification function...
void* userdata = gtk_tree_entry_get_userdata(entry);
gtk_tree_entry_set_userdata(entry, NULL); //don't delete on destroy
wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") );
//Sort of hackish - maybe there is a faster way
wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox") );
//Sort of hackish - maybe there is a faster way
- wxCHECK_MSG( m_treeview != NULL, -1, wxT("invalid listbox"));
- wxCHECK_MSG( HasFlag(wxLB_SINGLE), -1,
+ wxCHECK_MSG( m_treeview != NULL, wxNOT_FOUND, wxT("invalid listbox"));
+ wxCHECK_MSG( HasFlag(wxLB_SINGLE), wxNOT_FOUND,
// only works on single-sel
if (!gtk_tree_selection_get_selected(selection, NULL, &iter))
// only works on single-sel
if (!gtk_tree_selection_get_selected(selection, NULL, &iter))
void wxListBox::DoSetFirstItem( int n )
{
wxCHECK_RET( m_treeview, wxT("invalid listbox") );
void wxListBox::DoSetFirstItem( int n )
{
wxCHECK_RET( m_treeview, wxT("invalid listbox") );
//RN: I have no idea why this line is needed...
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (m_treeview))
//RN: I have no idea why this line is needed...
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (m_treeview))
// need to translate from master window since it is in client coords
gint binx, biny;
gdk_window_get_geometry(gtk_tree_view_get_bin_window(m_treeview),
// need to translate from master window since it is in client coords
gint binx, biny;
gdk_window_get_geometry(gtk_tree_view_get_bin_window(m_treeview),
gdk_window_set_background( window, m_backgroundColour.GetColor() );
gdk_window_clear( window );
}
gdk_window_set_background( window, m_backgroundColour.GetColor() );
gdk_window_clear( window );
}
wxString str(GetString(i));
GetTextExtent(str, &wLine, NULL);
lbWidth = wxMax(lbWidth, wLine);
wxString str(GetString(i));
GetTextExtent(str, &wLine, NULL);
lbWidth = wxMax(lbWidth, wLine);
- // don't make the listbox too tall (limit height to around 10 items) but don't
- // make it too small neither
+ // don't make the listbox too tall (limit height to around 10 items) but don't
+ // make it too small neither