Enables the graph to track when it is changing.
Call BeginUpdate before directly modifying the graph (adding or deleting nodes), and EndUpdate after. Changing existing nodes (such as its Caption) will still generate events, to temporarily prevent events call the node's BeginUpdate method or call BeginUpdateNodes to prevent events for all the nodes in the graph. When implementing properties or methods that change the graph in descendants of the graph, call BeginUpdate before the changes are made, and EndUpdate when the changes are complete.
The BeginUpdate method may be nested inside other BeginUpdate method calls. The graph will not fire an OnChange event until an equal number of EndUpdate method calls are made. Therefore, always ensure you protect the calling of the EndUpdate method call in a try-finally block.
Note |
---|
OnChange events will not fire. However, OnAddNode and OnRemoveNode events will still fire so that you can keep external data sets synchonized with the graph. |
Namespace: GGraph
Delphi |
public |
The following example uses the Begin/End update methods to ensure no events fire while modifying the graph: Delphi |
var |