From 027d45e8fc3cbb7a1efa91c727bcee6c52c4519c Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 24 Mar 2006 23:46:43 +0000 Subject: [PATCH] Back to unsigned int count in wxTreeCtrl. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38351 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/treectlg.h | 2 +- include/wx/gtk/treectrl.h | 4 ++-- include/wx/gtk1/treectrl.h | 2 +- include/wx/mac/carbon/treectrl.h | 2 +- include/wx/mac/classic/treectrl.h | 2 +- include/wx/msw/treectrl.h | 2 +- include/wx/os2/treectrl.h | 2 +- include/wx/palmos/treectrl.h | 2 +- include/wx/treectrl.h | 2 +- src/generic/treectlg.cpp | 4 ++-- src/gtk/treegtk.cpp | 12 +++++++----- src/gtk1/treegtk.cpp | 12 +++++++----- src/mac/carbon/treectrl.cpp | 2 +- src/mac/classic/treectrl.cpp | 2 +- src/msw/treectrl.cpp | 4 ++-- src/os2/treectrl.cpp | 7 ++++--- src/palmos/treectrl.cpp | 3 ++- 17 files changed, 36 insertions(+), 30 deletions(-) diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index 700b9a378c..1b4f259489 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -69,7 +69,7 @@ public: // implement base class pure virtuals // ---------------------------------- - virtual size_t GetCount() const; + virtual unsigned int GetCount() const; virtual unsigned int GetIndent() const { return m_indent; } virtual void SetIndent(unsigned int indent); diff --git a/include/wx/gtk/treectrl.h b/include/wx/gtk/treectrl.h index 280b08ea3a..6b1282674f 100644 --- a/include/wx/gtk/treectrl.h +++ b/include/wx/gtk/treectrl.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.h +// Name: wx/gtk/treectrl.h // Purpose: wxTreeCtrl class // Author: Denis Pershin // Modified by: @@ -154,7 +154,7 @@ public: // --------- // get the total number of items in the control - size_t GetCount() const; + virtual unsigned int GetCount() const; // indent is the number of pixels the children are indented relative to // the parents position. SetIndent() also redraws the control diff --git a/include/wx/gtk1/treectrl.h b/include/wx/gtk1/treectrl.h index 3e177c70cb..3ab40d1c41 100644 --- a/include/wx/gtk1/treectrl.h +++ b/include/wx/gtk1/treectrl.h @@ -154,7 +154,7 @@ public: // --------- // get the total number of items in the control - size_t GetCount() const; + virtual unsigned int GetCount() const; // indent is the number of pixels the children are indented relative to // the parents position. SetIndent() also redraws the control diff --git a/include/wx/mac/carbon/treectrl.h b/include/wx/mac/carbon/treectrl.h index c73ec7fae9..3bf45fe300 100644 --- a/include/wx/mac/carbon/treectrl.h +++ b/include/wx/mac/carbon/treectrl.h @@ -137,7 +137,7 @@ public: // accessors // --------- // - size_t GetCount() const; + virtual unsigned int GetCount() const; // indent int GetIndent() const; diff --git a/include/wx/mac/classic/treectrl.h b/include/wx/mac/classic/treectrl.h index 1d386f10bd..3ef103d41e 100644 --- a/include/wx/mac/classic/treectrl.h +++ b/include/wx/mac/classic/treectrl.h @@ -137,7 +137,7 @@ public: // accessors // --------- // - size_t GetCount() const; + virtual unsigned int GetCount() const; // indent int GetIndent() const; diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index 59fa744586..a1cd6dd6c0 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -78,7 +78,7 @@ public: // implement base class pure virtuals // ---------------------------------- - virtual size_t GetCount() const; + virtual unsigned int GetCount() const; virtual unsigned int GetIndent() const; virtual void SetIndent(unsigned int indent); diff --git a/include/wx/os2/treectrl.h b/include/wx/os2/treectrl.h index b14254085a..3758c86c16 100644 --- a/include/wx/os2/treectrl.h +++ b/include/wx/os2/treectrl.h @@ -90,7 +90,7 @@ public: // // Get the total number of items in the control // - size_t GetCount(void) const; + virtual unsigned int GetCount(void) const; // // Indent is the number of pixels the children are indented relative to diff --git a/include/wx/palmos/treectrl.h b/include/wx/palmos/treectrl.h index 48aed96db1..33b92a78e5 100644 --- a/include/wx/palmos/treectrl.h +++ b/include/wx/palmos/treectrl.h @@ -73,7 +73,7 @@ public: // --------- // get the total number of items in the control - size_t GetCount() const; + virtual unsigned int GetCount() const; // indent is the number of pixels the children are indented relative to // the parents position. SetIndent() also redraws the control diff --git a/include/wx/treectrl.h b/include/wx/treectrl.h index 0b4587bc79..c161d0d098 100644 --- a/include/wx/treectrl.h +++ b/include/wx/treectrl.h @@ -50,7 +50,7 @@ public: // --------- // get the total number of items in the control - virtual size_t GetCount() const = 0; + virtual unsigned int GetCount() const = 0; // indent is the number of pixels the children are indented relative to // the parents position. SetIndent() also redraws the control diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index fd499ea6fe..25576d2fb7 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -863,7 +863,7 @@ wxGenericTreeCtrl::~wxGenericTreeCtrl() // accessors // ----------------------------------------------------------------------------- -size_t wxGenericTreeCtrl::GetCount() const +unsigned int wxGenericTreeCtrl::GetCount() const { if ( !m_anchor ) { @@ -871,7 +871,7 @@ size_t wxGenericTreeCtrl::GetCount() const return 0; } - size_t count = m_anchor->GetChildrenCount(); + unsigned int count = m_anchor->GetChildrenCount(); if ( !HasFlag(wxTR_HIDE_ROOT) ) { // take the root itself into account diff --git a/src/gtk/treegtk.cpp b/src/gtk/treegtk.cpp index 9c6809f292..d5c5ddff1d 100644 --- a/src/gtk/treegtk.cpp +++ b/src/gtk/treegtk.cpp @@ -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 { diff --git a/src/gtk1/treegtk.cpp b/src/gtk1/treegtk.cpp index 58722ba8ac..91e52b964c 100644 --- a/src/gtk1/treegtk.cpp +++ b/src/gtk1/treegtk.cpp @@ -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 { diff --git a/src/mac/carbon/treectrl.cpp b/src/mac/carbon/treectrl.cpp index 729d535a9e..164b37af75 100644 --- a/src/mac/carbon/treectrl.cpp +++ b/src/mac/carbon/treectrl.cpp @@ -57,7 +57,7 @@ wxTreeCtrl::~wxTreeCtrl() } // Attributes -size_t wxTreeCtrl::GetCount() const +unsigned int wxTreeCtrl::GetCount() const { // TODO return 0; diff --git a/src/mac/classic/treectrl.cpp b/src/mac/classic/treectrl.cpp index a29581f2b4..36dd0963f8 100644 --- a/src/mac/classic/treectrl.cpp +++ b/src/mac/classic/treectrl.cpp @@ -55,7 +55,7 @@ wxTreeCtrl::~wxTreeCtrl() } // Attributes -size_t wxTreeCtrl::GetCount() const +unsigned int wxTreeCtrl::GetCount() const { // TODO return 0; diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 82816207fd..52c7d9f768 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -817,9 +817,9 @@ void wxTreeCtrl::DoSetItem(wxTreeViewItem* tvItem) } } -size_t wxTreeCtrl::GetCount() const +unsigned int wxTreeCtrl::GetCount() const { - return (size_t)TreeView_GetCount(GetHwnd()); + return (unsigned int)TreeView_GetCount(GetHwnd()); } unsigned int wxTreeCtrl::GetIndent() const diff --git a/src/os2/treectrl.cpp b/src/os2/treectrl.cpp index d54a567d25..2a3742d8a3 100644 --- a/src/os2/treectrl.cpp +++ b/src/os2/treectrl.cpp @@ -492,16 +492,17 @@ void wxTreeCtrl::DoSetItem ( } } // end of wxTreeCtrl::DoSetItem -size_t wxTreeCtrl::GetCount () const +unsigned int wxTreeCtrl::GetCount () const { - CNRINFO vCnrInfo; + CNRINFO vCnrInfo; ::WinSendMsg( GetHWND() ,CM_QUERYCNRINFO ,MPFROMP(&vCnrInfo) ,(MPARAM)(USHORT)sizeof(CNRINFO) ); - return (size_t)vCnrInfo.cRecords; + + return (unsigned int)vCnrInfo.cRecords; } // end of wxTreeCtrl::GetCount unsigned int wxTreeCtrl::GetIndent () const diff --git a/src/palmos/treectrl.cpp b/src/palmos/treectrl.cpp index d8b6f0ac96..41a4abbea1 100644 --- a/src/palmos/treectrl.cpp +++ b/src/palmos/treectrl.cpp @@ -210,8 +210,9 @@ void wxTreeCtrl::DoSetItem(wxTreeViewItem* tvItem) { } -size_t wxTreeCtrl::GetCount() const +unsigned int wxTreeCtrl::GetCount() const { + // TODO return 0; } -- 2.45.2