private void DrawPanel_MouseClick(object sender, MouseEventArgs e) { DrawPanel.Focus(); PointList.Add(new Point(e.X, e.Y)); CanCreateFigure(); }
private void ClearBt_Click(object sender, EventArgs e) { DrawPanel.Focus(); UHierarchy.ClearHierarchy(); DPanel.Clear(Panel.DefaultBackColor); UHierarchy.UpdatePanel(DPanel); }
/* ------------------------------------------------------------------------------- * Function: ColorButton_Click * * Use: Changes the current color * * Parameters: Sender: Refrence to the object that called this function * EventArgs: The auguments passed from the calling object * * Returns: nothing * -------------------------------------------------------------------------------*/ private void ColorButton_Click(object sender, EventArgs e) { //gets the color of the clicked box, and sets The current color to it TextBox ClickedBox = (TextBox)sender; DrawCurrentColor = ClickedBox.BackColor; DrawPanel.Focus(); }
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyValue == (char)Keys.Enter) { CanCreateFigure(true); DrawPanel.Focus(); } }
private void FigureColorBt_Click(object sender, EventArgs e) { DrawPanel.Focus(); var temp = FigureColorCD.ShowDialog(); if (temp == System.Windows.Forms.DialogResult.OK) { FigureColor = FigureColorCD.Color; } }
private void DrawPanel_MouseClick(object sender, MouseEventArgs e) { DrawPanel.Focus(); Drawing.Editing(e.Location, SemanticNetwork); if (e.Button == MouseButtons.Left) { SemanticNetwork.Deselect(); } if (AddingNewEdgeFlag) { for (int i = 0; i < SemanticNetwork.Nodes.Count; i++) { Node node = Drawing.CheckNode(e.X, e.Y, SemanticNetwork); if (node == null) { return; } if (selected1 == null) { selected1 = node; break; } if (selected2 == null) { selected2 = node; if (selected1 == null) { return; } EdgeForm addNewEdgeForm = new EdgeForm(); addNewEdgeForm.SetRelations = SemanticNetwork.Relations; addNewEdgeForm.Converter = converter; if (addNewEdgeForm.ShowDialog() == DialogResult.OK) { Relation relation = addNewEdgeForm.Relation; EdgeConfig ec = addNewEdgeForm.EdgeConfig; Edge edge = new Edge(relation, selected1, selected2, ec); //edge.EdgeConfig.SetDefaultValues(edge.NodeOne, edge.NodeTwo); SemanticNetwork.AddEdge(edge); AddingNewEdgeFlag = false; } DrawPanel.Invalidate(); selected1 = null; selected2 = null; break; } } } }
private void TypeCB_SelectedIndexChanged(object sender, EventArgs e) { DrawPanel.Focus(); NeedType = DetermineType(); PointList.Clear(); }