X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/448450723a0ad58452a7f17176645307db95dabc..a4ba2eeca12bce815242fb08d929e53232bbfb5e:/src/generic/treelay.cpp diff --git a/src/generic/treelay.cpp b/src/generic/treelay.cpp index 49769d5bd7..701a0f14b7 100644 --- a/src/generic/treelay.cpp +++ b/src/generic/treelay.cpp @@ -21,7 +21,8 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" +#include "wx/dc.h" +#include "wx/event.h" #endif #if wxUSE_TREELAYOUT @@ -299,6 +300,32 @@ long wxTreeLayoutStored::AddChild(const wxString& name, const wxString& parent) return -1; } +long wxTreeLayoutStored::AddChild(const wxString& name, long parent) +{ + if (m_num < (m_maxNodes -1 ) && parent < m_num) + { + long i = -1; + if (parent != -1) + { + i = parent; + } + else + { + m_parentNode = m_num; + } + + m_nodes[m_num].m_parentId = i; + m_nodes[m_num].m_name = name; + m_nodes[m_num].m_x = m_nodes[m_num].m_y = 0; + m_nodes[m_num].m_clientData = 0; + m_num ++; + + return (m_num - 1); + } + else + return -1; +} + long wxTreeLayoutStored::NameToId(const wxString& name) { long i;