private void pDrawPanel_MouseUp(object sender, MouseEventArgs e) { if (clickedNode != null) { clickedGrid.boxType = BoxType.Normal; clickedNode.Pinned = false; clickedNode = null; clickedGrid = null; } }
private void pDrawPanel_MouseDown(object sender, MouseEventArgs e) { foreach (KeyValuePair <Node, GridBox> keyPair in m_fdgBoxes) { if (keyPair.Value.boxRec.IntersectsWith(new Rectangle(e.Location, new Size(1, 1)))) { clickedNode = keyPair.Key; clickedGrid = keyPair.Value; clickedGrid.boxType = BoxType.Pinned; } } }
private void DrawPanel_Paint(object sender, PaintEventArgs e) { stopwatch.Stop(); var p = sender as Panel; paper = e.Graphics; GridBox box = new GridBox((panelRight - panelLeft) / 2, (panelBottom - panelTop) / 2, BoxType.Pinned); box.DrawBox(paper); m_fdgRenderer.Draw(0.05f); // TODO: Check Time stopwatch.Reset(); stopwatch.Start(); }
private bool addNode(string nodeName) { nodeName = nodeName.Trim(); if (m_fdgGraph.GetNode(tbNodeName.Text) != null) { return(false); } Node newNode = m_fdgGraph.CreateNode(nodeName); m_fdgBoxes[newNode] = new GridBox(0, 0, BoxType.Normal); cbbFromNode.Items.Add(nodeName); cbbToNode.Items.Add(nodeName); lbNode.Items.Add(nodeName); return(true); }
private void pDrawPanel_MouseDown(object sender, MouseEventArgs e) { foreach (KeyValuePair<Node, GridBox> keyPair in m_fdgBoxes) { if(keyPair.Value.boxRec.IntersectsWith(new Rectangle(e.Location,new Size(1,1)))) { clickedNode = keyPair.Key; clickedGrid = keyPair.Value; clickedGrid.boxType = BoxType.Pinned; } } }
private bool addNode(string nodeName) { nodeName = nodeName.Trim(); if (m_fdgGraph.GetNode(tbNodeName.Text) != null) { return false; } Node newNode = m_fdgGraph.CreateNode(nodeName); m_fdgBoxes[newNode] = new GridBox(0, 0, BoxType.Normal); cbbFromNode.Items.Add(nodeName); cbbToNode.Items.Add(nodeName); lbNode.Items.Add(nodeName); return true; }