void ToolbarButton_Checked(object sender, RoutedEventArgs e) { if (butDelete.IsChecked == true && sender == butDelete) { butEdit.IsChecked = false; butSelect.IsChecked = false; zoomCtrl.Cursor = Cursors.Help; _opMode = EditorOperationMode.Delete; ClearEditMode(); ClearSelectMode(); return; } if (butEdit.IsChecked == true && sender == butEdit) { butDelete.IsChecked = false; butSelect.IsChecked = false; zoomCtrl.Cursor = Cursors.Pen; _opMode = EditorOperationMode.Edit; ClearSelectMode(); return; } if (butSelect.IsChecked == true && sender == butSelect) { butEdit.IsChecked = false; butDelete.IsChecked = false; zoomCtrl.Cursor = Cursors.Hand; _opMode = EditorOperationMode.Select; ClearEditMode(); graphArea.SetVerticesDrag(true, true); return; } }
/// <summary> /// Включает режим создания редактора графов для типа вершин деревень. /// </summary> private void EnableCreateVillageMode() { buttonCreateMode.IsChecked = false; buttonDeleteMode.IsChecked = false; zoomCtrl.Cursor = Cursors.Hand; operationMode = EditorOperationMode.CreateVillage; ClearSelectMode(); //graphArea.ResetVertexStyle(); }
/// <summary> /// Включает режим выделения редактора графов. /// </summary> private void EnableSelectMode() { buttonDeleteMode.IsChecked = false; zoomCtrl.Cursor = Cursors.Arrow; operationMode = EditorOperationMode.Select; ClearCreateMode(); graphArea.SetVerticesDrag(true, true); //graphArea.ResetVertexStyle(); }
void ToolbarButton_Checked(object sender, RoutedEventArgs e) { if(butDelete.IsChecked == true && sender == butDelete) { butEdit.IsChecked = false; butSelect.IsChecked = false; zoomCtrl.Cursor = Cursors.Help; _opMode = EditorOperationMode.Delete; ClearEditMode(); ClearSelectMode(); return; } if (butEdit.IsChecked == true && sender == butEdit) { butDelete.IsChecked = false; butSelect.IsChecked = false; zoomCtrl.Cursor = Cursors.Pen; _opMode = EditorOperationMode.Edit; ClearSelectMode(); return; } if (butSelect.IsChecked == true && sender == butSelect) { butEdit.IsChecked = false; butDelete.IsChecked = false; zoomCtrl.Cursor = Cursors.Hand; _opMode = EditorOperationMode.Select; ClearEditMode(); graphArea.SetVerticesDrag(true, true); return; } }