SetDataRange
Set a DataRange object to the TreeNode
BOOL SetDataRange( DataRange & dRange, DWORD dwDisplaySettings = 0 )
TRUE is OK, otherwise failed.
EX1
// Assume there exists active worksheet with two columns. // Fill the worksheet and columns with long name and short name. void TreeNode_SetDataRange_ex1() { Worksheet wks = Project.ActiveLayer(); if ( wks ) { DataRange dr; dr.Add("X", wks, 3, 0, 5, 1); Tree trInput; // Create a tree with a treenode TreeNode trRange = trInput.AddNode("Range1"); DWORD dw = GETLC_PAGE_LONG_NAME|GETLC_PAGE_NAME_NONE ;//Change dw to other options to see the result if ( trRange ) trRange.SetDataRange(dr,dw); //Set dr to this treenode DataRange drClone; if ( trRange.GetDataRange(drClone) ) //Get the data range out_str("GetDataRange from treenode successfully."); out_tree(trRange); } }
TreeNode::GetDataRange, DataRange::GetDescription
origin.h