From: <mar...@us...> - 2006-07-27 17:11:36
|
Revision: 664 Author: marisademeglio Date: 2006-07-26 12:04:34 -0700 (Wed, 26 Jul 2006) ViewCVS: http://svn.sourceforge.net/urakawa/?rev=664&view=rev Log Message: ----------- Increase/decrease level works Modified Paths: -------------- trunk/urakawa/application/Obi/Obi/Project.cs trunk/urakawa/application/Obi/Obi/UserControls/TOCPanel.cs Modified: trunk/urakawa/application/Obi/Obi/Project.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/Project.cs 2006-07-26 18:04:54 UTC (rev 663) +++ trunk/urakawa/application/Obi/Obi/Project.cs 2006-07-26 19:04:34 UTC (rev 664) @@ -350,7 +350,7 @@ StateChanged(this, new Events.Project.StateChangedEventArgs(Events.Project.StateChange.Modified)); Commands.TOC.AddSection command = new Commands.TOC.AddSection(this, sibling, parent, parent.indexOf(sibling), visitor.Position); - CommandCreated(this, new Events.Project.CommandCreatedEventArgs(command)); + //MED CommandCreated(this, new Events.Project.CommandCreatedEventArgs(command)); } public void CreateSiblingSectionRequested(object sender, Events.Node.NodeEventArgs e) @@ -374,7 +374,7 @@ StateChanged(this, new Events.Project.StateChangedEventArgs(Events.Project.StateChange.Modified)); Commands.TOC.AddSection command = new Commands.TOC.AddSection(this, child, parent, parent.indexOf(child), visitor.Position); - CommandCreated(this, new Events.Project.CommandCreatedEventArgs(command)); + //MEDCommandCreated(this, new Events.Project.CommandCreatedEventArgs(command)); } public void CreateChildSectionRequested(object sender, Events.Node.NodeEventArgs e) @@ -625,11 +625,15 @@ ArrayList futureChildren = new ArrayList(); int nodeIndex = ((CoreNode)node.getParent()).indexOf(node); + int numChildren = node.getParent().getChildCount(); + //make copies of our future children, and remove them from the tree - for (int i = nodeIndex + 1; i<node.getParent().getChildCount(); i++) + for (int i = numChildren-1; i>nodeIndex; i--) { futureChildren.Add(node.getParent().getChild(i).detach()); } + //since the list was built in backwards order, rearrange it + futureChildren.Reverse(); CoreNode newParent = (CoreNode)node.getParent().getParent(); int newIndex = newParent.indexOf((CoreNode)node.getParent()) + 1; @@ -663,7 +667,7 @@ RenamedNode(this, new Events.Node.RenameNodeEventArgs(origin, node, label)); mUnsaved = true; StateChanged(this, new Events.Project.StateChangedEventArgs(Events.Project.StateChange.Modified)); - if (command != null) CommandCreated(this, new Events.Project.CommandCreatedEventArgs(command)); + //MEDif (command != null) CommandCreated(this, new Events.Project.CommandCreatedEventArgs(command)); } public void RenameNodeRequested(object sender, Events.Node.RenameNodeEventArgs e) Modified: trunk/urakawa/application/Obi/Obi/UserControls/TOCPanel.cs =================================================================== --- trunk/urakawa/application/Obi/Obi/UserControls/TOCPanel.cs 2006-07-26 18:04:54 UTC (rev 663) +++ trunk/urakawa/application/Obi/Obi/UserControls/TOCPanel.cs 2006-07-26 19:04:34 UTC (rev 664) @@ -464,9 +464,9 @@ //remove the node which was just moved selected.Remove(); + clone.ExpandAll(); + clone.EnsureVisible(); tocTree.SelectedNode = clone; - - clone.Expand(); } } @@ -506,7 +506,9 @@ tocTree.SelectedNode = clone; - clone.Expand(); + clone.ExpandAll(); + clone.EnsureVisible(); + tocTree.SelectedNode = clone; } } @@ -567,8 +569,9 @@ clone.Nodes.Add((TreeNode)node); } - clone.Expand(); + clone.ExpandAll(); clone.EnsureVisible(); + tocTree.SelectedNode = clone; } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |