protected override void SetSelectionMenuItems(IContextMenuView contextMenuView, IContainerBase containerBase, IBaseNode node)
        {
            if (!Presenter.IsReactionNode(node))
            {
                return;
            }

            contextMenuView.AddMenuItem(CreateMenuCheckButton.WithCaption("Connect Educts right")
                                        .WithChecked(Presenter.DisplayEductsRight(node))
                                        .WithCheckedAction(displayRight => Presenter.SetDisplayEductsRightForDiagramSelection(displayRight)));

            base.SetSelectionMenuItems(contextMenuView, containerBase, node);
        }
Exemple #2
0
        protected virtual void SetSelectionMenuItems(IContextMenuView contextMenuView, IContainerBase containerBase, IBaseNode node)
        {
            contextMenuView.AddMenuItem(SubMenuSelect);

            if (containerBase != null)
            {
                SubMenuSelect.AddItem(CreateMenuButton.WithCaption("All Children")
                                      .WithActionCommand(() => Presenter.SelectChildren(containerBase)));
            }

            if (Presenter.SelectionContains <IBaseNode>())
            {
                SubMenuSelect.AddItem(CreateMenuButton.WithCaption("Visible Linked nodes")
                                      .WithActionCommand(() => Presenter.SelectVisibleLinkedNodesForDiagramSelection()));
                if (node != null)
                {
                    SubMenuSelect.AddItem(CreateMenuButton.WithCaption("Invert Selection")
                                          .WithActionCommand(() => Presenter.InvertSelection(node.GetParent())));
                }

                IHasLayoutInfo selectedNode = Presenter.GetFirstSelected <IHasLayoutInfo>();
                if (selectedNode != null)
                {
                    SubMenuDiagram.AddItem(CreateMenuCheckButton.WithCaption("Location Fixed").AsGroupStarter()
                                           .WithChecked(selectedNode.LocationFixed)
                                           .WithCheckedAction(locationFixed => Presenter.SetLocationFixedForDiagramSelection(locationFixed)));
                }

                contextMenuView.AddMenuItem(CreateMenuButton.WithCaption("Hide Selection").WithActionCommand(() => Presenter.HideSelection()));
            }

            if (Presenter.SelectionContains <IElementBaseNode>())
            {
                var subMenuNodeSize = CreateSubMenu.WithCaption("Nodesize")
                                      .WithItem(CreateMenuButton.WithCaption("Large").WithActionCommand(() => Presenter.SetNodeSizeForDiagramSelection(NodeSize.Large)))
                                      .WithItem(CreateMenuButton.WithCaption("Middle").WithActionCommand(() => Presenter.SetNodeSizeForDiagramSelection(NodeSize.Middle)))
                                      .WithItem(CreateMenuButton.WithCaption("Small").WithActionCommand(() => Presenter.SetNodeSizeForDiagramSelection(NodeSize.Small)));
                contextMenuView.AddMenuItem(subMenuNodeSize);
            }

            // Shows all children (e.g. after hiding a selection)

            if (containerBase != null)
            {
                contextMenuView.AddMenuItem(CreateMenuButton.WithCaption("Show All Children").WithActionCommand(() => Presenter.ShowChildren(containerBase)));
            }
        }
Exemple #3
0
 /// <summary>
 ///    Creates an IMenuBarButton that sets the Color Grouping option for charts
 /// </summary>
 /// <param name="userSettings">The user settings that contain Color Grouping option</param>
 /// <returns>The MenuBarButton</returns>
 public static IMenuBarButton ColorGroupObservedData(IPresentationUserSettings userSettings)
 {
     return(CreateMenuCheckButton.WithCaption(MenuNames.ColorGroupObservedData)
            .WithChecked(userSettings.ColorGroupObservedDataFromSameFolder)
            .WithCheckedAction(colorGroup => userSettings.ColorGroupObservedDataFromSameFolder = colorGroup));
 }