Don’t use the Quick Reply editor on this page – use the full editor on a separate page by clicking on the “Post Reply” button above.
That editor includes an “Insert Image” button in the toolbar.
The “Insert Image” button is exist, but it dosen’t let me upload a new image.
It let me to choose from a image list or write a image url only.
Oh, I see – you’re right. When we upgraded the forum software, we seem to have lost that functionality.
We’ll investigate.
OK, it seems to work now:
Here’s a Gantt chart:
And a PERT chart:
It doesn’t look as if your questions have anything to do with diagram layout.
Do all of the model changes that you make occur within a transaction?
In other words, does all of your modifying code run between calls to StartTransaction and CommitTransaction?
That would account for most if not all of the odd behavior that you report.
Did you use Buttons to implement those expanding/collapsing controls?
Thank you, I will try your solution, and yes, I use with buttons to implement the expand/collapsed.
I added the transaction to all places that add nodes & links in the code.
And in the Button.Click event handlers?
And in any other code that modifies the contents of the diagram?
this._NEDiagramModel.CreateNodeData(nextNodeFID,
nextNodeType,
new NECableBase[] { port.DataPort.Cable }) as NEJunctionNode;
from: FromRight ? nextNode : currentNode,
to: FromRight ? currentNode : nextNode,
fromPort: FromRight ? nextPort : port,
toPort: FromRight ? port : nextPort,
link: out link);
... Some logic code...
You don’t need to call DoLayout – by default the Diagram.LayoutManager will do that for you.
And that call isn’t doing what you intended anyway – you’re just telling it to do a layout of the one new node and the one new link, without any consideration of any of the other nodes or links in the diagram.
I placed all buttons with a border & path controls, and I changed the event trigger from click to mouseLeftButtonDown.
So are you saying that the user can still click on “buttons” and there’s no appropriate mouse event handler called?
Regarding the scrollbars not being updated: check on the blue node’s Node.Bounds and the diagram’s Diagram.Panel.DiagramBounds and .ViewportBounds. The DiagramBounds should be big enough to cover the blue node’s Bounds.
Calling CommitTransaction should automatically update the DiagramBounds to cover all of the nodes in the diagram (unless Part.InDiagramBounds is false).
- Yes, the user can still click on “buttons” and there’s no appropriate mouse event handler called.
I tryed to set the Diagram width to a large fix size (8000), and when the width is large, the event handler work.
The DiagramBounds will affect the scrollbar and ability to scroll/pan, but it won’t affect whether mouse events are handled.
When the user gets no results when trying to click on a “button”, are they able to do other mouse gestures at or near that point in the diagram?
It seems very mysterious why mouse events are not being delivered.
It’s particularly odd when you were using a regular WPF Button control, since the GoXam code isn’t involved at all.
Might there be some large transparent object in front of the “button”?
Such an object would be intercepting any mouse events.