[Adapdev-commits] Adapdev/src/Adapdev.Windows.Forms SmartTreeView.cs,1.2,1.3
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-06-03 03:51:29
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6438/src/Adapdev.Windows.Forms Modified Files: SmartTreeView.cs Log Message: Fixed the ChangeForeColor method in SmartTreeView Fixed the logic for checking / unchecking child and parent nodes Index: SmartTreeView.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/SmartTreeView.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SmartTreeView.cs 2 Jun 2005 03:26:00 -0000 1.2 --- SmartTreeView.cs 3 Jun 2005 03:51:19 -0000 1.3 *************** *** 56,71 **** private void SmartTreeView_AfterCheck(object sender, System.Windows.Forms.TreeViewEventArgs e) { if(!this.disableAfterSelect) { - if(e.Node.Checked) CheckParents(e.Node); - // Required to avoid a stack overflow this.disableAfterSelect = true; // Check / Uncheck all children CheckChildren(e.Node); // Save the nodes state if(this.TrackState) this.SaveState(e.Node); this.disableAfterSelect = false; } } --- 56,81 ---- private void SmartTreeView_AfterCheck(object sender, System.Windows.Forms.TreeViewEventArgs e) { + this.SuspendLayout(); if(!this.disableAfterSelect) { // Required to avoid a stack overflow this.disableAfterSelect = true; + + // Check / Uncheck parents + if(e.Node.Checked) CheckParents(e.Node); + // Check / Uncheck all children CheckChildren(e.Node); + // Save the nodes state if(this.TrackState) this.SaveState(e.Node); + this.disableAfterSelect = false; } + + // Change the forecolor + this.ChangeForeColor(e.Node); + + this.ResumeLayout(); } *************** *** 79,84 **** // Save its state if(this.TrackState) this.SaveState(treeNode.Parent); - // Change the state - this.ChangeForeColor(treeNode); // Process the parent treeNode = treeNode.Parent; --- 89,92 ---- *************** *** 96,101 **** // Save its state if(this.TrackState) this.SaveState(child); - // Change the state - this.ChangeForeColor(node); // Check all children CheckChildren(child); --- 104,107 ---- |