X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..b4446c244775324631b8dd2b588ea35f32e71728:/src/mac/classic/treectrl.cpp diff --git a/src/mac/classic/treectrl.cpp b/src/mac/classic/treectrl.cpp index 7a548a7436..36dd0963f8 100644 --- a/src/mac/classic/treectrl.cpp +++ b/src/mac/classic/treectrl.cpp @@ -1,28 +1,21 @@ ///////////////////////////////////////////////////////////////////////////// -// 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 ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "treectrl.h" -#endif - #include "wx/stubs/textctrl.h" #include "wx/treebase.h" #include "wx/stubs/treectrl.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxTreeItem, wxObject) -#endif - wxTreeCtrl::wxTreeCtrl() { m_imageListNormal = NULL; @@ -44,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() @@ -62,7 +55,7 @@ wxTreeCtrl::~wxTreeCtrl() } // Attributes -int wxTreeCtrl::GetCount() const +unsigned int wxTreeCtrl::GetCount() const { // TODO return 0; @@ -114,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 @@ -156,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 @@ -215,7 +208,7 @@ wxString wxTreeCtrl::GetItemText(long item) const info.m_itemId = item; if (!GetItem(info)) - return wxString(""); + return wxEmptyString; return info.m_text; } @@ -256,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 @@ -268,7 +261,7 @@ wxTextCtrl* wxTreeCtrl::GetEditControl() const bool wxTreeCtrl::DeleteItem(long item) { // TODO - return FALSE; + return false; } bool wxTreeCtrl::ExpandItem(long item, int action) @@ -278,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); @@ -301,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; } @@ -348,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) @@ -373,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) @@ -385,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 @@ -416,4 +409,3 @@ wxTreeEvent::wxTreeEvent(wxEventType commandType, int id): m_code = 0; m_oldItem = 0; } -