void wxTreeLayout::GetNodeSize(long id, long *x, long *y, wxDC& dc)
{
wxString name(GetNodeName(id));
void wxTreeLayout::GetNodeSize(long id, long *x, long *y, wxDC& dc)
{
wxString name(GetNodeName(id));
wxList children;
GetChildren(nodeId, children);
int n = children.Number();
wxList children;
GetChildren(nodeId, children);
int n = children.Number();
GetNodeSize(parentId, &x, &y, dc);
SetNodeX(nodeId, (long)(GetNodeX(parentId) + m_xSpacing + x));
}
GetNodeSize(parentId, &x, &y, dc);
SetNodeX(nodeId, (long)(GetNodeX(parentId) + m_xSpacing + x));
}
wxNode *node = children.First();
while (node)
{
CalcLayout((long)node->Data(), level+1, dc);
node = node->Next();
}
wxNode *node = children.First();
while (node)
{
CalcLayout((long)node->Data(), level+1, dc);
node = node->Next();
}
SetNodeY(nodeId, m_lastY);
long x, y;
GetNodeSize(nodeId, &x, &y, dc);
SetNodeY(nodeId, m_lastY);
long x, y;
GetNodeSize(nodeId, &x, &y, dc);
GetNodeSize(parentId, &x, &y, dc);
SetNodeY(nodeId, (long)(GetNodeY(parentId) + m_ySpacing + y));
}
GetNodeSize(parentId, &x, &y, dc);
SetNodeY(nodeId, (long)(GetNodeY(parentId) + m_ySpacing + y));
}
wxNode *node = children.First();
while (node)
{
CalcLayout((long)node->Data(), level+1, dc);
node = node->Next();
}
wxNode *node = children.First();
while (node)
{
CalcLayout((long)node->Data(), level+1, dc);
node = node->Next();
}
SetNodeX(nodeId, m_lastX);
long x, y;
GetNodeSize(nodeId, &x, &y, dc);
SetNodeX(nodeId, m_lastX);
long x, y;
GetNodeSize(nodeId, &x, &y, dc);
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 ++;
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 (long)m_nodes[id].m_y;
}
void wxTreeLayoutStored::SetNodeX(long id, long x)
{
wxASSERT(id < m_num);
return (long)m_nodes[id].m_y;
}
void wxTreeLayoutStored::SetNodeX(long id, long x)
{
wxASSERT(id < m_num);
m_nodes[id].m_x = (int)x;
}
void wxTreeLayoutStored::SetNodeY(long id, long y)
{
wxASSERT(id < m_num);
m_nodes[id].m_x = (int)x;
}
void wxTreeLayoutStored::SetNodeY(long id, long y)
{
wxASSERT(id < m_num);
m_nodes[id].m_y = (int)y;
}
void wxTreeLayoutStored::SetNodeName(long id, const wxString& name)
{
wxASSERT(id < m_num);
m_nodes[id].m_y = (int)y;
}
void wxTreeLayoutStored::SetNodeName(long id, const wxString& name)
{
wxASSERT(id < m_num);
return m_nodes[id].m_clientData;
}
void wxTreeLayoutStored::ActivateNode(long id, bool active)
{
wxASSERT(id < m_num);
return m_nodes[id].m_clientData;
}
void wxTreeLayoutStored::ActivateNode(long id, bool active)
{
wxASSERT(id < m_num);
if ( (x >= (m_nodes[i].m_x-10)) && (x < (m_nodes[i].m_x + width+10)) &&
(y >= m_nodes[i].m_y-10) && (y < (m_nodes[i].m_y + height+10)) )
{
return m_nodes[i].m_name;
}
}
if ( (x >= (m_nodes[i].m_x-10)) && (x < (m_nodes[i].m_x + width+10)) &&
(y >= m_nodes[i].m_y-10) && (y < (m_nodes[i].m_y + height+10)) )
{
return m_nodes[i].m_name;
}
}