X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..dd5e86874e7796e4a7ccfc65d973f309cdc9a087:/src/gtk1/treegtk.cpp?ds=inline diff --git a/src/gtk1/treegtk.cpp b/src/gtk1/treegtk.cpp index bd5d97f1c1..325c74f345 100644 --- a/src/gtk1/treegtk.cpp +++ b/src/gtk1/treegtk.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.cpp +// Name: src/gtk1/treectrl.cpp // Purpose: wxTreeCtrl // Author: Denis Pershin // Modified by: @@ -13,16 +13,16 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" + #include "wx/log.h" #endif -#include "wx/gtk/treectrl.h" +#include "wx/gtk1/treectrl.h" #include "wx/textctrl.h" -#include "wx/log.h" #include @@ -152,12 +152,14 @@ static void gtk_treectrl_count_callback (GtkWidget *widget, gpointer data) { gtk_container_foreach(GTK_CONTAINER(widget), gtk_treectrl_count_callback, data); } -size_t wxTreeCtrl::GetCount() const { - int count = 0; +unsigned int wxTreeCtrl::GetCount() const +{ + int count = 0; + + if (m_anchor != NULL) + gtk_treectrl_count_callback(GTK_WIDGET(m_anchor), &count); - if (m_anchor != NULL) - gtk_treectrl_count_callback(GTK_WIDGET(m_anchor), &count); - return count; + return (unsigned int)count; } unsigned int wxTreeCtrl::GetIndent() const { @@ -184,16 +186,17 @@ void wxTreeCtrl::SetStateImageList(wxImageList *imageList) { m_imageListState = imageList; } -wxString wxTreeCtrl::GetItemText(const wxTreeItemId &item) const { - char *t; +wxString wxTreeCtrl::GetItemText(const wxTreeItemId &item) const +{ + char *t; - if (!item.IsOk()) - return wxString(""); + if (!item.IsOk()) + return wxEmptyString; - GtkLabel *l = GTK_LABEL(gtk_object_get_data(GTK_OBJECT((GtkTreeItem *)item), "w_label")); - gtk_label_get(l, &t); + GtkLabel *l = GTK_LABEL(gtk_object_get_data(GTK_OBJECT((GtkTreeItem *)item), "w_label")); + gtk_label_get(l, &t); - return t; + return t; } int wxTreeCtrl::GetItemImage(const wxTreeItemId& item) const { @@ -717,7 +720,7 @@ long wxTreeCtrl::GetChild(long item) const { p = findGtkTreeItem(item); GList *list = gtk_container_children(GTK_CONTAINER(p)); - next = GTK_TREE_ITEM(list->data);; + next = GTK_TREE_ITEM(list->data); if (next != NULL) return (long)gtk_object_get_data(GTK_OBJECT(next), "id"); @@ -729,7 +732,7 @@ long wxTreeCtrl::GetFirstVisibleItem(void) const { GtkTreeItem *next = NULL; GList *list = gtk_container_children(GTK_CONTAINER(m_anchor)); - next = GTK_TREE_ITEM(list->data);; + next = GTK_TREE_ITEM(list->data); // gtk_container_foreach(GTK_CONTAINER(m_anchor), gtk_treectrl_next_visible_callback, &next); if (next != NULL) @@ -744,7 +747,7 @@ long wxTreeCtrl::GetNextVisibleItem(long item) const { p = findGtkTreeItem(item); GList *list = gtk_container_children(GTK_CONTAINER(p)); - next = GTK_TREE_ITEM(list->data);; + next = GTK_TREE_ITEM(list->data); // gtk_container_foreach(GTK_CONTAINER(p), gtk_treectrl_next_visible_callback, &next); if (next != NULL)