From 3b38e2a022d97b2afae69cb5f322f96a6a0140f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Sun, 12 Mar 2006 13:15:53 +0000 Subject: [PATCH] Line-up interfaces to use size_t for GetCount()s. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/richtext/richtextbuffer.h | 2 +- src/mac/carbon/treectrl.cpp | 7 ++-- src/mac/classic/treectrl.cpp | 59 ++++++++++++++-------------- src/mac/corefoundation/hid.cpp | 6 +-- 4 files changed, 36 insertions(+), 38 deletions(-) diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 5916a2dfaa..e1633bc419 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -1492,7 +1492,7 @@ public: virtual void ClearStyleStack(); /// Get the size of the style stack, for example to check correct nesting - virtual int GetStyleStackSize() const { return m_attributeStack.GetCount(); } + virtual size_t GetStyleStackSize() const { return m_attributeStack.GetCount(); } /// Begin using bold bool BeginBold(); diff --git a/src/mac/carbon/treectrl.cpp b/src/mac/carbon/treectrl.cpp index 75dad9de67..729d535a9e 100644 --- a/src/mac/carbon/treectrl.cpp +++ b/src/mac/carbon/treectrl.cpp @@ -6,7 +6,7 @@ // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" @@ -41,7 +41,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, m_windowStyle = style; - m_windowId = (id == -1) ? NewControlId() : id; + m_windowId = (id == wxID_ANY) ? NewControlId() : id; if (parent) parent->AddChild(this); @@ -57,7 +57,7 @@ wxTreeCtrl::~wxTreeCtrl() } // Attributes -int wxTreeCtrl::GetCount() const +size_t wxTreeCtrl::GetCount() const { // TODO return 0; @@ -413,4 +413,3 @@ wxTreeEvent::wxTreeEvent(wxEventType commandType, int id) m_code = 0; m_oldItem = 0; } - diff --git a/src/mac/classic/treectrl.cpp b/src/mac/classic/treectrl.cpp index 8b1ebc6406..a29581f2b4 100644 --- a/src/mac/classic/treectrl.cpp +++ b/src/mac/classic/treectrl.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.cpp +// Name: src/mac/classic/treectrl.cpp // Purpose: wxTreeCtrl. See also Robert's generic wxTreeCtrl. // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/stubs/textctrl.h" @@ -37,13 +37,13 @@ bool wxTreeCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, con SetParent(parent); - m_windowId = (id == -1) ? NewControlId() : id; + m_windowId = (id == wxID_ANY) ? NewControlId() : id; if (parent) parent->AddChild(this); // TODO create tree control - return FALSE; + return false; } wxTreeCtrl::~wxTreeCtrl() @@ -55,7 +55,7 @@ wxTreeCtrl::~wxTreeCtrl() } // Attributes -int wxTreeCtrl::GetCount() const +size_t wxTreeCtrl::GetCount() const { // TODO return 0; @@ -107,7 +107,7 @@ long wxTreeCtrl::GetNextItem(long item, int code) const bool wxTreeCtrl::ItemHasChildren(long item) const { // TODO - return FALSE; + return false; } long wxTreeCtrl::GetChild(long item) const @@ -149,13 +149,13 @@ long wxTreeCtrl::GetRootItem() const bool wxTreeCtrl::GetItem(wxTreeItem& info) const { // TODO - return FALSE; + return false; } bool wxTreeCtrl::SetItem(wxTreeItem& info) { // TODO - return FALSE; + return false; } int wxTreeCtrl::GetItemState(long item, long stateMask) const @@ -208,7 +208,7 @@ wxString wxTreeCtrl::GetItemText(long item) const info.m_itemId = item; if (!GetItem(info)) - return wxString(""); + return wxEmptyString; return info.m_text; } @@ -249,7 +249,7 @@ bool wxTreeCtrl::SetItemData(long item, long data) bool wxTreeCtrl::GetItemRect(long item, wxRect& rect, bool textOnly) const { // TODO - return FALSE; + return false; } wxTextCtrl* wxTreeCtrl::GetEditControl() const @@ -261,7 +261,7 @@ wxTextCtrl* wxTreeCtrl::GetEditControl() const bool wxTreeCtrl::DeleteItem(long item) { // TODO - return FALSE; + return false; } bool wxTreeCtrl::ExpandItem(long item, int action) @@ -271,22 +271,22 @@ bool wxTreeCtrl::ExpandItem(long item, int action) { case wxTREE_EXPAND_EXPAND: break; - + case wxTREE_EXPAND_COLLAPSE: break; - + case wxTREE_EXPAND_COLLAPSE_RESET: break; - + case wxTREE_EXPAND_TOGGLE: break; - + default: wxFAIL_MSG("unknown action in wxTreeCtrl::ExpandItem"); } - - bool bOk = FALSE; // TODO expand item - + + bool bOk = false; // TODO expand item + // May not send messages, so emulate them if ( bOk ) { wxTreeEvent event(wxEVT_NULL, m_windowId); @@ -294,22 +294,22 @@ bool wxTreeCtrl::ExpandItem(long item, int action) event.m_item.m_mask = event.m_item.m_stateMask = 0xffff; // get all GetItem(event.m_item); - + bool bIsExpanded = (event.m_item.m_state & wxTREE_STATE_EXPANDED) != 0; - + event.m_code = action; event.SetEventObject(this); - + // @@@ return values of {EXPAND|COLLAPS}ING event handler is discarded event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDING : wxEVT_COMMAND_TREE_ITEM_COLLAPSING); GetEventHandler()->ProcessEvent(event); - + event.SetEventType(bIsExpanded ? wxEVT_COMMAND_TREE_ITEM_EXPANDED : wxEVT_COMMAND_TREE_ITEM_COLLAPSED); GetEventHandler()->ProcessEvent(event); } - + return bOk; } @@ -341,19 +341,19 @@ long wxTreeCtrl::InsertItem(long parent, const wxString& label, int image, int s bool wxTreeCtrl::SelectItem(long item) { // TODO - return FALSE; + return false; } bool wxTreeCtrl::ScrollTo(long item) { // TODO - return FALSE; + return false; } bool wxTreeCtrl::DeleteAllItems() { // TODO - return FALSE; + return false; } wxTextCtrl* wxTreeCtrl::EditLabel(long item, wxClassInfo* textControlClass) @@ -366,7 +366,7 @@ wxTextCtrl* wxTreeCtrl::EditLabel(long item, wxClassInfo* textControlClass) bool wxTreeCtrl::EndEditLabel(bool cancel) { // TODO - return FALSE; + return false; } long wxTreeCtrl::HitTest(const wxPoint& point, int& flags) @@ -378,13 +378,13 @@ long wxTreeCtrl::HitTest(const wxPoint& point, int& flags) bool wxTreeCtrl::SortChildren(long item) { // TODO - return FALSE; + return false; } bool wxTreeCtrl::EnsureVisible(long item) { // TODO - return FALSE; + return false; } // Tree item structure @@ -409,4 +409,3 @@ wxTreeEvent::wxTreeEvent(wxEventType commandType, int id): m_code = 0; m_oldItem = 0; } - diff --git a/src/mac/corefoundation/hid.cpp b/src/mac/corefoundation/hid.cpp index bc107d9f8b..a4a9a6ea37 100644 --- a/src/mac/corefoundation/hid.cpp +++ b/src/mac/corefoundation/hid.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: hid.cpp +// Name: src/mac/corefoundation/hid.cpp // Purpose: DARWIN HID layer for WX Implementation // Author: Ryan Norton // Modified by: @@ -208,7 +208,7 @@ USB Product Name return true; }//end Create() -int wxHIDDevice::GetCount (int nClass, int nType) +size_t wxHIDDevice::GetCount (int nClass, int nType) { mach_port_t m_pPort; @@ -248,7 +248,7 @@ int wxHIDDevice::GetCount (int nClass, int nType) //Now we iterate through them io_object_t pObject; - int nCount = 0; + size_t nCount = 0; while ( (pObject = IOIteratorNext(pIterator)) != 0) ++nCount; -- 2.45.2