public Form1() { InitializeComponent(); diagram1.BeginUpdate(); comboLytDirection.SelectedIndex = 0; DiagramAppearance(); PopulateNodes(); this.diagram1.View.SelectionList.Clear(); DirectedTreeLayoutManager dtlm = new DirectedTreeLayoutManager(this.diagram1.Model, 0, 50, 60); dtlm.TopMargin = 50; dtlm.LeftMargin = 20; this.diagram1.LayoutManager = dtlm; this.diagram1.LayoutManager.UpdateLayout(null); txtHSpacing.Text = dtlm.HorizontalSpacing.ToString(); txtVSpacing.Text = dtlm.VerticalSpacing.ToString(); txtLMarigin.Text = dtlm.LeftMargin.ToString(); txtTMarigin.Text = dtlm.TopMargin.ToString(); chkAutoLayout.Checked = dtlm.AutoLayout; diagram1.EndUpdate(); }
private void Form1_Load(object sender, EventArgs e) { diagram1.BeginUpdate(); this.overviewControl1.Diagram = this.diagram1; PopulateNodes(); DiagramAppearance(); DirectedTreeLayoutManager dtLayoutManager = new DirectedTreeLayoutManager(this.diagram1.Model, 0, 40, 20, LayoutType.Horizontal, 1); dtLayoutManager.VerticalSpacing = 75; dtLayoutManager.TopMargin = 30; dtLayoutManager.LeftMargin = 10; this.diagram1.LayoutManager = dtLayoutManager; this.diagram1.LayoutManager.UpdateLayout(null); diagram1.EndUpdate(); }
/// <summary> /// Create a task view form for the inut task /// </summary> /// <param name="toShow"></param> public ViewTaskForm(Task toShow) { InitializeComponent(); StartPosition = FormStartPosition.CenterScreen; DoubleBuffered = true; //update ui relative to task info myTask = toShow; DateTime firstDate = DateTime.Now; if (myTask != null) { foreach (var n in myTask.Decomposition.Nodes) { nodes.Add(new NodeDecorator(n)); } firstDate = myTask.Decomposition.GetSoonestDate(); } //create the diagram and set layout manager sfDecompositionDiagram.BeginUpdate(); diagramAppearance(); populateNodes(); var dtlm = new DirectedTreeLayoutManager(sfDecompositionDiagram.Model, 0, 40, 50) { TopMargin = 1, LeftMargin = 50, AutoLayout = false }; sfDecompositionDiagram.LayoutManager = dtlm; sfDecompositionDiagram.LayoutManager.UpdateLayout(null); sfDecompositionDiagram.View.SelectionList.Clear(); sfDecompositionDiagram.EndUpdate(); sfNodeCalendar.DrawCell += sfCalendarDrawCell; sfNodeCalendar.SelectionChanged += sfCalendarOverview_SelectionChanged; sfNodeCalendar.SelectedDate = firstDate; sfNodeCalendar.GoToDate(firstDate); sfNodeCalendar.TrailingDatesVisible = true; }
public Form1( ) { InitializeComponent( ); managers = new NodeCollection( ); employees = new NodeCollection( ); this.diagram1.Model = this.model1; DirectedTreeLayoutManager mgr = new DirectedTreeLayoutManager(this.diagram1.Model, 0, 30, 50); mgr.LeftMargin = 100; mgr.TopMargin = 50; this.diagram1.LayoutManager = mgr; this.diagram1.Model.EventSink.DocumentEndUpdate += new EventHandler(EventSink_DocumentEndUpdate); this.diagram1.Model.DocumentSize = new PageSize(800, 800); this.diagram1.Model.RenderingStyle.SmoothingMode = SmoothingMode.HighQuality; // Load Palette this.paletteGroupBar1.LoadPalette(@"..\..\..\..\..\..\..\Common\Data\Diagram\edp\DragDrop.edp"); }
private void dialog_BeginLayout(DirectedTreeLayoutManager layout) { this.diagram1.LayoutManager = layout; Layouting(); }