Skip to content

Instantly share code, notes, and snippets.

@anaselli
Created April 10, 2014 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anaselli/10420056 to your computer and use it in GitHub Desktop.
Save anaselli/10420056 to your computer and use it in GitHub Desktop.
diff --git a/src/NCTree.cc b/src/NCTree.cc
index 9c77a37..69a4124 100644
--- a/src/NCTree.cc
+++ b/src/NCTree.cc
@@ -488,7 +488,31 @@ void NCTree::CreateTreeLines( NCTreeLine * parentLine, NCTreePad * pad, YItem *
NCTreeLine * line = new NCTreeLine( parentLine, treeItem, multiSel );
pad->Append( line );
-
+
+
+ if (item->selected())
+ {
+ //retrieve position of item
+ int at = treeItem->index();
+ NCTreeLine * cline = 0; // current line
+ NCTableCol * ccol = 0; // current column
+ if ( multiSel )
+ {
+ cline = modifyTreeLine( at );
+ if ( cline )
+ {
+ ccol = cline->GetCol(0);
+ }
+ if ( ccol )
+ {
+ ccol->SetLabel( NCstring( std::string( cline->Level() + 3, ' ' ) + "[x] "
+ + item->label() ) );
+ }
+ }
+ //this highlights selected item, possibly unpacks the tree
+ //should it be in currently hidden branch
+ pad->ShowItem( getTreeLine( at ) );
+ }
// iterate over children
for ( YItemIterator it = item->childrenBegin(); it < item->childrenEnd(); ++it )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment