X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62f864c32c53356b7228591c85b14abc491c46f0..0c9d7ace58512847c3aa4177c650723b6e971a28:/src/mac/classic/treectrl.cpp?ds=inline diff --git a/src/mac/classic/treectrl.cpp b/src/mac/classic/treectrl.cpp index 84f84a1b79..36dd0963f8 100644 --- a/src/mac/classic/treectrl.cpp +++ b/src/mac/classic/treectrl.cpp @@ -1,18 +1,14 @@ ///////////////////////////////////////////////////////////////////////////// -// 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" @@ -41,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() @@ -59,7 +55,7 @@ wxTreeCtrl::~wxTreeCtrl() } // Attributes -int wxTreeCtrl::GetCount() const +unsigned int wxTreeCtrl::GetCount() const { // TODO return 0; @@ -111,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 @@ -153,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 @@ -212,7 +208,7 @@ wxString wxTreeCtrl::GetItemText(long item) const info.m_itemId = item; if (!GetItem(info)) - return wxString(""); + return wxEmptyString; return info.m_text; } @@ -253,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 @@ -265,7 +261,7 @@ wxTextCtrl* wxTreeCtrl::GetEditControl() const bool wxTreeCtrl::DeleteItem(long item) { // TODO - return FALSE; + return false; } bool wxTreeCtrl::ExpandItem(long item, int action) @@ -275,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); @@ -298,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; } @@ -345,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) @@ -370,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) @@ -382,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 @@ -413,4 +409,3 @@ wxTreeEvent::wxTreeEvent(wxEventType commandType, int id): m_code = 0; m_oldItem = 0; } -