Exemplo n.º 1
0
 private void layerView_MouseDown(object sender, LayerMouseEventArgs e)
 {
     if (e.Layer != null)
     {
         bool multiSelect = e.Modifiers == KeysDg.Shift || e.Modifiers == KeysDg.Control;
         if (multiSelect)
         {
             if (selectedLayers.Contains(e.Layer))
             {
                 UnselectLayer(e.Layer);
             }
             else
             {
                 SelectLayer(e.Layer);
             }
         }
         else
         {
             SetSelectedLayers(e.Layer);
         }
     }
     else
     {
         UnselectAllLayers();
     }
 }
Exemplo n.º 2
0
        private void layerView_MouseUp(object sender, LayerMouseEventArgs e)
        {
            switch (e.Buttons) {
                case MouseButtonsDg.Left:
                    switch (e.Item) {
                        case LayerItem.Name:
                            if (e.Layer != null && selectedLayers.Contains(e.Layer))
                                layerView.BeginEditLayerName(e.Layer);
                            break;
                        case LayerItem.ActiveState:
                            if (e.Layer != null)
                                diagramPresenter.SetLayerActive(e.Layer.Id, !diagramPresenter.IsLayerActive(e.Layer.Id));
                            break;
                        case LayerItem.Visibility:
                            if (e.Layer != null)
                                diagramPresenter.SetLayerVisibility(e.Layer.Id, !diagramPresenter.IsLayerVisible(e.Layer.Id));
                            break;
                        case LayerItem.MinZoom:
                            if (e.Layer != null && selectedLayers.Contains(e.Layer))
                                layerView.BeginEditLayerMinZoomBound(e.Layer);
                            break;
                        case LayerItem.MaxZoom:
                            if (e.Layer != null && selectedLayers.Contains(e.Layer))
                                layerView.BeginEditLayerMaxZoomBound(e.Layer);
                            break;
                        case LayerItem.None:
                            // nothing to do
                            break;
                        default:
                            throw new NShapeUnsupportedValueException(e.Item);
                    }
                    break;

                    // Open context menu
                case MouseButtonsDg.Right:
                    layerView.OpenContextMenu(e.Position.X, e.Position.Y, GetMenuItemDefs(), LayerController.DiagramSetController.Project);
                    break;

                default:
                    // Ignore all other buttons as well as combinations of buttons
                    break;
            }
        }
Exemplo n.º 3
0
 private void layerView_MouseMove(object sender, LayerMouseEventArgs e)
 {
     // ToDo: MouseHover image highlighting
 }
Exemplo n.º 4
0
 private void layerView_MouseDown(object sender, LayerMouseEventArgs e)
 {
     if (e.Layer != null) {
         bool multiSelect = e.Modifiers == KeysDg.Shift || e.Modifiers == KeysDg.Control;
         if (multiSelect) {
             if (selectedLayers.Contains(e.Layer))
                 UnselectLayer(e.Layer);
             else SelectLayer(e.Layer);
         } else SetSelectedLayers(e.Layer);
     } else UnselectAllLayers();
 }
Exemplo n.º 5
0
        private void layerView_MouseUp(object sender, LayerMouseEventArgs e)
        {
            switch (e.Buttons)
            {
            case MouseButtonsDg.Left:
                switch (e.Item)
                {
                case LayerItem.Name:
                    if (e.Layer != null && selectedLayers.Contains(e.Layer))
                    {
                        layerView.BeginEditLayerName(e.Layer);
                    }
                    break;

                case LayerItem.ActiveState:
                    if (e.Layer != null)
                    {
                        diagramPresenter.SetLayerActive(e.Layer.Id, !diagramPresenter.IsLayerActive(e.Layer.Id));
                    }
                    break;

                case LayerItem.Visibility:
                    if (e.Layer != null)
                    {
                        diagramPresenter.SetLayerVisibility(e.Layer.Id, !diagramPresenter.IsLayerVisible(e.Layer.Id));
                    }
                    break;

                case LayerItem.MinZoom:
                    if (e.Layer != null && selectedLayers.Contains(e.Layer))
                    {
                        layerView.BeginEditLayerMinZoomBound(e.Layer);
                    }
                    break;

                case LayerItem.MaxZoom:
                    if (e.Layer != null && selectedLayers.Contains(e.Layer))
                    {
                        layerView.BeginEditLayerMaxZoomBound(e.Layer);
                    }
                    break;

                case LayerItem.None:
                    // nothing to do
                    break;

                default:
                    throw new NShapeUnsupportedValueException(e.Item);
                }
                break;

            // Open context menu
            case MouseButtonsDg.Right:
                layerView.OpenContextMenu(e.Position.X, e.Position.Y, GetMenuItemDefs(), LayerController.DiagramSetController.Project);
                break;

            default:
                // Ignore all other buttons as well as combinations of buttons
                break;
            }
        }
Exemplo n.º 6
0
 private void layerView_MouseMove(object sender, LayerMouseEventArgs e)
 {
     // ToDo: MouseHover image highlighting
 }
Exemplo n.º 7
0
 private void layerView_MouseDown(object sender, LayerMouseEventArgs e)
 {
     // Nothing to do here
 }