Example #1
0
        protected override void SetupCustomizeMenu(BarItem bar, ListMenuItem listmenu)
        {
            base.SetupCustomizeMenu(bar, listmenu);

            if (AppearanceStyleCommand == null)
            {
                AppearanceStyleCommand = new DelegateCustomCommand(OnAppearanceStyle, CanAppearanceStyle);
            }

            // Добавляем функционал подсветки (в начало списка)
            var minPriority = listmenu.MenuItems.Min(i => i.Priority);

            listmenu.MenuItems.Add(new CommandMenuItem
            {
                Caption        = StringResources.AppearanceStyle,
                Command        = AppearanceStyleCommand,
                ImageSmall     = ImageResources.DCLAppearanceStyle16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLAppearanceStyle32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = minPriority - 100
            });

            // убираем функционал настройки самого layout-а
            var item = listmenu.MenuItems.FirstOrDefault(i => i.Caption == StringResources.CustomizeRegion);

            if (item != null)
            {
                listmenu.MenuItems.Remove(item);
            }
        }
Example #2
0
        private void lbFunctions_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            tbSearch.Text = "";
            ListMenuItem selectedFunction = (ListMenuItem)lbFunctions.SelectedItem;

            if (selectedFunction != null)
            {
                switch (selectedFunction.Key)
                {
                case "Card":
                    LoadCard();
                    tbFunctionName.Text = "Thẻ vào/ra";
                    currentMode         = 1;
                    break;

                case "Holder":
                    LoadHolder();
                    tbFunctionName.Text = "Chủ thẻ";
                    currentMode         = 2;
                    break;

                case "Device":
                    LoadDevice();
                    tbFunctionName.Text = "Bộ điều khiển";
                    currentMode         = 3;
                    break;

                case "Door":
                    LoadDoor();
                    tbFunctionName.Text = "Cửa";
                    currentMode         = 4;
                    break;

                case "Schedule":
                    LoadSchedule();
                    tbFunctionName.Text = "Lịch";
                    currentMode         = 5;
                    break;

                case "Right":
                    LoadRight();
                    tbFunctionName.Text = "Quyền";
                    currentMode         = 6;
                    break;

                case "Event":
                    LoadEvent();
                    tbFunctionName.Text = "Sự kiện";
                    currentMode         = 7;
                    break;

                case "Department":
                    LoadDepartment();
                    tbFunctionName.Text = "Bộ phận/Phòng ban";
                    currentMode         = 8;
                    break;
                }
            }
        }
        protected override void Dispose(bool disposing)
        {
            _processBar     = null;
            _bpMenuListItem = null;
            _reports        = null;
            Print           = null;

            base.Dispose(disposing);
        }
Example #4
0
        private void AddMenu()
        {
            InitializeCustomizationBar();
            var bar = Menu.GetOrCreateBarItem(StringResources.Commands, 1);

            bar.MenuItems.Add(new CommandMenuItem
            {
                Caption    = StringResources.Filter,
                Command    = FilterCommand,
                ImageSmall = ImageResources.DCLFilter16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLFilter32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F3),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 10
            });

            bar.MenuItems.Add(new CommandMenuItem
            {
                Caption    = StringResources.ExportData,
                Command    = ExportCommand,
                ImageSmall = ImageResources.DCLFilterRefresh16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLFilterRefresh32.GetBitmapImage(),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 10
            });

            bar.MenuItems.Add(new CommandMenuItem
            {
                Caption    = StringResources.RefreshData,
                Command    = RefreshCommand,
                ImageSmall = ImageResources.DCLFilterRefresh16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLFilterRefresh32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F5),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 20
            });

            // меню вида
            var listMenuItem = new ListMenuItem
            {
                Caption    = StringResources.SettingsInMenu,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 30
            };

            bar.MenuItems.Add(listMenuItem);
        }
Example #5
0
    private void CreateMenuRecursively(SiteMapNodeCollection nodes, ListMenuItemCollection items)
    {
        ListMenuItem item;

        foreach (SiteMapNode node in nodes)
        {
            item = new ListMenuItem(node.Title, node.Url);
            items.Add(item);
            this.CreateMenuRecursively(node.ChildNodes, item.ChildItems);
        }
    }
Example #6
0
        public HighScoreMenu(MinerGame game, MenuScene previous)
            : base(game, previous)
        {
            this.HighScores = HighScores.GetInstance();
            HighScores.HighScoreList.Add(new Result() { PlayerName = "asd", Score = 10 });
            Rectangle labelRec = new Rectangle(Game.GraphicsDevice.Viewport.Width / 2 - MENU_ITEM_WIDTH / 2,
                Game.GraphicsDevice.Viewport.Height / 2 - 300, MENU_ITEM_WIDTH, MENU_ITEM_HEIGHT);

            label = new MenuItem(this, labelRec, LABEL_BEST_SCORES, null);

            scoresList = new ListMenuItem(this, new Vector2(label.Boundaries.Left, label.Boundaries.Bottom + 50), this.HighScores);
            scoresList = new ListMenuItem(this, new Rectangle(labelRec.X, labelRec.Y + labelRec.Height + 50, labelRec.Width, labelRec.Height * 2), this.HighScores);
        }
        protected override void SetupCustomizeMenu(BarItem bar, ListMenuItem listmenu)
        {
            base.SetupCustomizeMenu(bar, listmenu);

            // убираем функционал настройки самого layout-а
            if (listmenu != null && listmenu.MenuItems != null)
            {
                var item = listmenu.MenuItems.FirstOrDefault(i => i.Caption == StringResources.CustomizeRegion);
                if (item != null)
                {
                    listmenu.MenuItems.Remove(item);
                }
            }
        }
Example #8
0
        private void UpdateListMenuBoxSelectStatus(string sKey)
        {
            for (int i = 0; i < this.SpNavItems.Children.Count; i++)
            {
                ListMenuBox menuBox = this.SpNavItems.Children[i] as ListMenuBox;
                if (menuBox != null)
                {
                    if (menuBox.Items.Count == 0)
                    {
                        if (menuBox.Key == sKey)
                        {
                            menuBox.IsExpanded = true;
                        }
                        else
                        {
                            menuBox.IsExpanded = false;
                        }
                    }
                    else
                    {
                        bool bIsChildSelect = false;
                        for (int j = 0; j < menuBox.Items.Count; j++)
                        {
                            ListMenuItem menuItem = menuBox.Items[j] as ListMenuItem;
                            if (menuItem != null)
                            {
                                if (menuItem.Key != sKey)
                                {
                                    menuItem.IsSelected = false;
                                }
                                else
                                {
                                    menuItem.IsSelected = true;
                                    bIsChildSelect      = true;
                                }
                            }
                        }

                        if (!bIsChildSelect)
                        {
                            menuBox.IsExpanded = false;
                        }
                        else
                        {
                            menuBox.IsExpanded = true;
                        }
                    }
                }
            }
        }
        public override void CreateProcessMenu()
        {
            base.CreateProcessMenu();
            var bar      = Menu.GetOrCreateBarItem(StringResources.BusinessProcesses, 1, "BarItemWDUCL");
            var listmenu = new ListMenuItem
            {
                Name           = "ListMenuWDUCL",
                Caption        = StringResources.WDUCL,
                ImageSmall     = ImageResources.DCLWFDesigner16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLWFDesigner32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                Priority       = 1000
            };

            listmenu.MenuItems.Add(new CommandMenuItem
            {
                Caption          = StringResources.WfOpenReadOnly,
                Command          = ShowDesignerCommand,
                CommandParameter = true,
                ImageSmall       = ImageResources.DCLWFOpenReadOnly16.GetBitmapImage(),
                ImageLarge       = ImageResources.DCLWFOpenReadOnly32.GetBitmapImage(),
                GlyphAlignment   = GlyphAlignmentType.Top,
                Priority         = 1
            });

            listmenu.MenuItems.Add(new CommandMenuItem
            {
                Caption          = StringResources.WfOpen,
                Command          = ShowDesignerCommand,
                CommandParameter = false,
                ImageSmall       = ImageResources.DCLWFOpen16.GetBitmapImage(),
                ImageLarge       = ImageResources.DCLWFOpen32.GetBitmapImage(),
                GlyphAlignment   = GlyphAlignmentType.Top,
                Priority         = 2
            });

            bar.MenuItems.Add(listmenu);

            //Исключаем кнопку OpenInNewWindow
            foreach (var b in Menu.Bars.Where(b => b.Caption == StringResources.Commands).ToArray())
            {
                foreach (var m in b.MenuItems.Where(m => m.Caption == StringResources.OpenInNewWindow).ToArray())
                {
                    b.MenuItems.Remove(m);
                }
            }
        }
Example #10
0
        /* Populating the menu flowlayout with the menu */

        public void CreateMenuItems()
        {
            for (int i = fpListHeaderPanel.Controls.Count - 1; i >= 0; --i)
            {
                fpListHeaderPanel.Controls[i].Dispose();
            }
            fpListHeaderPanel.Controls.Clear();

            if (activeListType == "Anime")
            {
                headerList = SqliteDataAccess.LoadAnimeListHeaders();
            }
            else if (activeListType == "Game")
            {
                headerList = SqliteDataAccess.LoadGameListHeaders();
            }
            else if (activeListType == "Series")
            {
                headerList = SqliteDataAccess.LoadSeriesListHeaders();
            }

            ListMenuItem allMenuItem = new ListMenuItem(activeGroup, this);

            allMenuItem.MenuItemName("All");
            allMenuItem.MenuItemCount(headerList.Where(n => n.ListGroup != "Completed").Sum(n => n.Count).ToString());
            if (activeGroup == "All")
            {
                allMenuItem.ActiveColor();
                pageCount = (int)Math.Ceiling(headerList.Where(n => n.ListGroup != "Completed").Sum(n => n.Count) / 60.0);
            }
            fpListHeaderPanel.Controls.Add(allMenuItem);

            foreach (HeaderModel listsetting in headerList.OrderBy(n => n.SortOrder))
            {
                ListMenuItem menuItem = new ListMenuItem(activeGroup, this);
                menuItem.MenuItemName(listsetting.ListGroup);
                menuItem.MenuItemCount(listsetting.Count.ToString());
                if (listsetting.ListGroup == activeGroup)
                {
                    menuItem.ActiveColor();
                    pageCount = (int)Math.Ceiling(listsetting.Count / 60.0);
                }
                fpListHeaderPanel.Controls.Add(menuItem);
            }
        }
 private void CreateBPMenu()
 {
     try
     {
         _bpMenuListItem = new ListMenuItem
         {
             IsDynamicBarItem = true,
             Name             = "ListMenuItemBp",
             Caption          = StringResources.Wait,
             ImageSmall       = ImageResources.DCLBusinessProcess16.GetBitmapImage(),
             ImageLarge       = ImageResources.DCLBusinessProcess32.GetBitmapImage(),
             HotKey           = new KeyGesture(Key.F12),
             GlyphAlignment   = GlyphAlignmentType.Top,
             DisplayMode      = DisplayModeType.Default,
             Priority         = 100,
             IsEnable         = false
         };
         var items = GetBPMenuItems();
         if (items == null)
         {
             return;
         }
         _bpMenuListItem.PropertyChanged += BPMenuListItem_PropertyChanged;
         _bpMenuListItem.MenuItems.AddRange(items);
         _processBar.MenuItems.Add(_bpMenuListItem);
         OnPropertyChanged(GetType().ExtractPropertyName(() => Menu));
     }
     catch (Exception)
     {
         _bpMenuListItem.Caption = StringResources.ErrorButton;
         throw;
     }
     finally
     {
         if (_bpMenuListItem.Caption != StringResources.ErrorButton)
         {
             _bpMenuListItem.Caption = StringResources.BusinessProcess;
         }
         _bpMenuListItem.IsEnable = _bpMenuListItem.MenuItems.Count > 0;
     }
 }
Example #12
0
        private void UpdateListMenuBoxSelectStatus(string sKey)
        {
            // Xaml 示例模块
            for (int i = 0; i < this.SpNavItems.Children.Count; i++)
            {
                ListMenuBox menuBox = this.SpNavItems.Children[i] as ListMenuBox;
                if (menuBox != null)
                {
                    if (menuBox.Items.Count == 0)
                    {
                        if (menuBox.Key == sKey)
                        {
                            menuBox.IsExpanded = true;
                        }
                        else
                        {
                            menuBox.IsExpanded = false;
                        }
                    }
                    else
                    {
                        bool bIsChildSelect = false;
                        for (int j = 0; j < menuBox.Items.Count; j++)
                        {
                            ListMenuItem menuItem = menuBox.Items[j] as ListMenuItem;
                            if (menuItem != null)
                            {
                                if (menuItem.Key != sKey)
                                {
                                    menuItem.IsSelected = false;
                                }
                                else
                                {
                                    menuItem.IsSelected = true;
                                    bIsChildSelect      = true;
                                }
                            }
                        }

                        if (!bIsChildSelect)
                        {
                            menuBox.IsExpanded = false;
                        }
                        else
                        {
                            menuBox.IsExpanded = true;
                        }
                    }
                }
            }

            // Binding示例模块
            bool bIsItemSelect = false;
            ObservableCollection <CatalogOfEffect> ltItems = this.LmxBinding.ItemsSource as ObservableCollection <CatalogOfEffect>;

            if (ltItems != null && ltItems.Count > 0)
            {
                for (int i = 0; i < ltItems.Count; i++)
                {
                    if (ltItems[i].Key != sKey)
                    {
                        ltItems[i].IsSelected = false;
                    }
                    else
                    {
                        ltItems[i].IsSelected = true;
                        bIsItemSelect         = true;
                    }
                }
                if (!bIsItemSelect)
                {
                    this.LmxBinding.IsExpanded = false;
                }
                else
                {
                    this.LmxBinding.IsExpanded = true;
                }
            }
        }
Example #13
0
        protected override Object createSpecialUiElement(Object filteredSubtree, TemplateUiObject templateObject, String brailleNodeId)
        {
            if (strategyMgr.getSpecifiedTree().GetData(filteredSubtree).properties.Equals(new GeneralProperties()))
            {
                return(strategyMgr.getSpecifiedTree().NewTree());
            }
            OSMElements.OSMElement brailleNode = templateObject.osm.DeepCopy();
            brailleNode.properties.resetIdGenerated = null; // zurücksetzen, da das die Id vom Elternknoten wäre
            // prop.controlTypeFiltered = templateObject.osm.brailleRepresentation.groupelementsOfSameType.renderer; // den Renderer der Kindelemente setzen
            brailleNode.properties.isEnabledFiltered    = false;
            brailleNode.brailleRepresentation.isVisible = true;
            if (templateObject.Screens == null)
            {
                Debug.WriteLine("Achtung, hier wurde kein Screen angegeben!"); return(strategyMgr.getSpecifiedTree().NewTree());
            }
            brailleNode.brailleRepresentation.screenName   = templateObject.Screens[0]; // hier wird immer nur ein Screen-Name übergeben
            brailleNode.brailleRepresentation.viewName     = "GroupChild" + strategyMgr.getSpecifiedTree().GetData(filteredSubtree).properties.IdGenerated;
            brailleNode.brailleRepresentation.isGroupChild = true;
            // if(templateObject.osm.brailleRepresentation.groupelementsOfSameType.renderer != null) {
            if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.renderer.Equals("DropDownMenuItem"))
            {
                OSMElements.UiElements.DropDownMenuItem dropDownMenu = new OSMElements.UiElements.DropDownMenuItem();
                if (strategyMgr.getSpecifiedTree().HasChild(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Child(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasChild = true;
                }
                if (strategyMgr.getSpecifiedTree().HasNext(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Next(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasNext = true;
                }
                if (strategyMgr.getSpecifiedTree().HasPrevious(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Previous(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasPrevious = true;
                }
                if (strategyMgr.getSpecifiedTree().HasParent(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Parent(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.isChild = true;
                }
                dropDownMenu.isOpen     = false;
                dropDownMenu.isVertical = false;
                brailleNode.brailleRepresentation.uiElementSpecialContent = dropDownMenu;
            }
            if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.renderer.Equals("ListItem"))
            {
                OSMElements.UiElements.ListMenuItem litItem = new ListMenuItem();
                if (strategyMgr.getSpecifiedTree().HasNext(filteredSubtree))
                {
                    litItem.hasNext = true;
                }
                //TODO: multi
                if (strategyMgr.getSpecifiedTree().HasChild(filteredSubtree))
                {
                    if (strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Child(filteredSubtree)).properties.controlTypeFiltered.Equals("CheckBox"))
                    {
                        litItem.isMultipleSelection = true;
                    }
                }
                brailleNode.brailleRepresentation.uiElementSpecialContent = litItem;
            }
            if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.renderer.Equals("TabItem"))
            {
                OSMElements.UiElements.TabItem tabView = new OSMElements.UiElements.TabItem();
                tabView.orientation = templateObject.osm.brailleRepresentation.groupelementsOfSameType.orienataion; //templateObject.orientation;
                brailleNode.brailleRepresentation.uiElementSpecialContent = tabView;
                //                brailleNode.brailleRepresentation.uiElementSpecialContent = templateObject.osm.brailleRepresentation.uiElementSpecialContent;
            }

            OSMElements.OSMElement brailleGroupNode = treeOperation.searchNodes.getBrailleTreeOsmElementById(brailleNodeId);
            bool groupViewWithScrollbars            = false;

            if (!brailleGroupNode.Equals(new OSMElements.OSMElement()) && brailleGroupNode != null && brailleGroupNode.brailleRepresentation != null)
            {
                groupViewWithScrollbars = brailleGroupNode.brailleRepresentation.isScrollbarShow;
            }
            Rect rect;

            if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.renderer.Equals("TabItem"))
            {
                Rect rectTmp = templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle;
                if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.orienataion.Equals(OSMElements.UiElements.Orientation.Left) || templateObject.osm.brailleRepresentation.groupelementsOfSameType.orienataion.Equals(OSMElements.UiElements.Orientation.Right))
                {
                    rectTmp.Y = (rectTmp.Height + 1) * strategyMgr.getSpecifiedTree().BranchIndex(filteredSubtree) + rectTmp.Y + 1;
                }
                if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.orienataion.Equals(OSMElements.UiElements.Orientation.Top) || templateObject.osm.brailleRepresentation.groupelementsOfSameType.orienataion.Equals(OSMElements.UiElements.Orientation.Bottom))
                {
                    rectTmp.X = (rectTmp.Width + 1) * strategyMgr.getSpecifiedTree().BranchIndex(filteredSubtree) + rectTmp.X + 1;
                }
                boxStartX = Convert.ToInt32(rectTmp.X);
                boxStartY = Convert.ToInt32(rectTmp.Y);
            }
            else
            {
                if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.orienataion.Equals(OSMElements.UiElements.Orientation.Vertical))
                {
                    int column            = 0;
                    int subBoxModel       = (brailleGroupNode == null || brailleGroupNode.brailleRepresentation == null)? 0 : brailleGroupNode.brailleRepresentation.boarder.Top + brailleGroupNode.brailleRepresentation.boarder.Bottom + brailleGroupNode.brailleRepresentation.margin.Top + brailleGroupNode.brailleRepresentation.margin.Bottom + brailleGroupNode.brailleRepresentation.padding.Top + brailleGroupNode.brailleRepresentation.padding.Bottom;
                    int max               = Convert.ToInt32(templateObject.osm.properties.boundingRectangleFiltered.Height) - (groupViewWithScrollbars == true ? 3 : 0) - subBoxModel;
                    int elementsProColumn = max / Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Height);
                    if (brailleNode.brailleRepresentation.groupelementsOfSameType.isLinebreak == true)
                    {
                        column = strategyMgr.getSpecifiedTree().BranchIndex(filteredSubtree) / elementsProColumn;
                    }
                    if (boxStartY == null)
                    {
                        boxStartY = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Y);
                    }
                    if (boxStartX == null)
                    {
                        boxStartX = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.X);
                    }

                    boxStartY = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Y) + ((strategyMgr.getSpecifiedTree().BranchIndex(filteredSubtree) - (column * elementsProColumn)) * Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Height));
                    boxStartX = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.X) + (column * Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Width));
                }
                else
                {  //horizontal
                    int line            = 0;
                    int subBoxModel     = (brailleGroupNode == null || brailleGroupNode.brailleRepresentation == null) ? 0 : brailleGroupNode.brailleRepresentation.boarder.Left + brailleGroupNode.brailleRepresentation.boarder.Right + brailleGroupNode.brailleRepresentation.margin.Left + brailleGroupNode.brailleRepresentation.margin.Right + brailleGroupNode.brailleRepresentation.padding.Left + brailleGroupNode.brailleRepresentation.padding.Right;
                    int max             = Convert.ToInt32(templateObject.osm.properties.boundingRectangleFiltered.Width) - (groupViewWithScrollbars == true ? 3 : 0) - subBoxModel;
                    int elementsProLine = max / Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Width);
                    if (brailleNode.brailleRepresentation.groupelementsOfSameType.isLinebreak == true)
                    {
                        line = strategyMgr.getSpecifiedTree().BranchIndex(filteredSubtree) / elementsProLine;
                    }
                    if (boxStartY == null)
                    {
                        boxStartY = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Y);
                    }
                    if (boxStartX == null)
                    {
                        boxStartX = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.X);
                    }
                    else
                    {
                        boxStartX = boxStartX + Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Width);
                    }
                    if (templateObject.osm.brailleRepresentation.groupelementsOfSameType.isLinebreak == true)
                    {
                        boxStartY = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Y) + line * Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Height);
                        if (line > 0)
                        {
                            boxStartX = Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.X) + ((strategyMgr.getSpecifiedTree().BranchIndex(filteredSubtree) - (elementsProLine * line))) * Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Width);
                        }
                    }
                }
            }
            rect = new System.Windows.Rect(Convert.ToDouble(boxStartX), Convert.ToDouble(boxStartY), Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Width), Convert.ToInt32(templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle.Height));
            brailleNode.properties.boundingRectangleFiltered = rect;

            if (!strategyMgr.getSpecifiedTree().HasParent(filteredSubtree))
            {
                return(strategyMgr.getSpecifiedTree().NewTree());
            }
            String idGenerated = treeOperation.updateNodes.addNodeInBrailleTree(brailleNode, brailleNodeId);

            if (idGenerated == null)
            {
                Debug.WriteLine("Es konnte keine Id erstellt werden."); return(strategyMgr.getSpecifiedTree().NewTree());
            }
            brailleNode.properties.IdGenerated = idGenerated;

            treeOperation.osmTreeConnector.addOsmConnection(strategyMgr.getSpecifiedTree().GetData(filteredSubtree).properties.IdGenerated, idGenerated);
            treeOperation.updateNodes.updateNodeOfBrailleUi(ref brailleNode);
            Object tree = strategyMgr.getSpecifiedTree().NewTree();

            strategyMgr.getSpecifiedTree().AddChild(tree, brailleNode);
            return(tree);
        }
Example #14
0
        private void AddMenu()
        {
            InitializeCustomizationBar();
            var bar = Menu.GetOrCreateBarItem(StringResources.Commands, 1);

            bar.MenuItems.Add(new CommandMenuItem
            {
                Caption    = StringResources.Filter,
                Command    = FilterCommand,
                ImageSmall = ImageResources.DCLFilter16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLFilter32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F3),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 10
            });

            bar.MenuItems.Add(new CommandMenuItem
            {
                Caption    = StringResources.ExportData,
                Command    = ExportCommand,
                ImageSmall = ImageResources.DCLFilterRefresh16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLFilterRefresh32.GetBitmapImage(),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 10
            });

            bar.MenuItems.Add(new CommandMenuItem
            {
                Caption    = StringResources.RefreshData,
                Command    = RefreshCommand,
                ImageSmall = ImageResources.DCLFilterRefresh16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLFilterRefresh32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F5),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 20
            });

            // меню вида
            var listMenuItem = new ListMenuItem
            {
                Caption    = "Вид",
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 30
            };

            bar.MenuItems.Add(listMenuItem);
            listMenuItem.MenuItems.Add(new CheckCommandMenuItem
            {
                Caption    = "Координаты",
                Command    = ShowCoordinatesCommand,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F6),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 10
            });
            listMenuItem.MenuItems.Add(new CheckCommandMenuItem
            {
                Caption    = "Информация камеры",
                Command    = ShowCameraInfoCommand,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F7),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 20
            });
            listMenuItem.MenuItems.Add(new CheckCommandMenuItem
            {
                Caption    = "Цель",
                Command    = ShowCameraTargetCommand,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F8),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 30
            });
            listMenuItem.MenuItems.Add(new CheckCommandMenuItem
            {
                Caption    = "Поле вида",
                Command    = ShowFieldOfViewCommand,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F9),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 40
            });
            listMenuItem.MenuItems.Add(new CheckCommandMenuItem
            {
                Caption    = "FPS",
                Command    = ShowFrameRateCommand,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F10),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 50
            });
            listMenuItem.MenuItems.Add(new CheckCommandMenuItem
            {
                Caption    = "Количество полигонов",
                Command    = ShowTriangleCountInfoCommand,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F11),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 60
            });
            listMenuItem.MenuItems.Add(new CheckCommandMenuItem
            {
                Caption    = "Кубический вид",
                Command    = ShowViewCubeCommand,
                ImageSmall = ImageResources.DCLDefault16.GetBitmapImage(),
                ImageLarge = ImageResources.DCLDefault32.GetBitmapImage(),
                HotKey     = new KeyGesture(Key.F12),
                //GlyphSize = GlyphSizeType.Large,
                GlyphAlignment = GlyphAlignmentType.Top,
                DisplayMode    = DisplayModeType.Default,
                Priority       = 70
            });
        }
Example #15
0
 protected virtual void SetupCustomizeMenu(BarItem bar, ListMenuItem listmenu)
 {
 }
Example #16
0
        protected void InitializeCustomizationBar()
        {
            //if (!IsMenuEnable)
            //    IsMenuEnable = true;

            //if (!IsCustomizeBarEnabled)
            //    IsCustomizeBarEnabled = true;

            if (!IsMenuEnable)
            {
                return;
            }

            if (!IsCustomizeBarEnabled)
            {
                return;
            }

            InitializeCustomizationBarCommands();

            _сustomizationBar = Menu.GetOrCreateBarItem(StringResources.SettingsInMenu, 10000, StandardBars.BarItemSettingsInMenu.ToString());
            var listmenu = new ListMenuItem
            {
                Name           = "ListMenuSettingsInMenu",
                Caption        = StringResources.SettingsInMenu,
                ImageSmall     = ImageResources.DCLSettings16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLSettings32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
            };

            listmenu.MenuItems.Add(new CheckCommandMenuItem
            {
                IsChecked      = IsCustomization,
                Caption        = StringResources.CustomizeRegion,
                Command        = CustomizationCommand,
                ImageSmall     = ImageResources.DCLCustomLayer16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLCustomLayer32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                Priority       = 10
            });

            listmenu.MenuItems.Add(new CommandMenuItem
            {
                Caption        = StringResources.CustomizationRegionSave,
                Command        = SaveLayoutCommand,
                ImageSmall     = ImageResources.DCLViewSave16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLViewSave32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                Priority       = 50
            });

            listmenu.MenuItems.Add(new CommandMenuItem
            {
                Caption        = StringResources.CustomizationRegionSaveDB,
                Command        = SaveDBLayoutCommand,
                ImageSmall     = ImageResources.DCLViewSaveDB16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLViewSaveDB32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                Priority       = 100
            });

            listmenu.MenuItems.Add(new CommandMenuItem
            {
                Caption        = StringResources.CustomizationRegionSaveDBUpCriticalVersion,
                Command        = SaveDBLayoutUpVersionCommand,
                ImageSmall     = ImageResources.DCLViewSaveDB16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLViewSaveDB32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                Priority       = 101
            });

            listmenu.MenuItems.Add(new CommandMenuItem
            {
                Caption        = StringResources.CustomizationRegionClear,
                Command        = ClearLayoutCommand,
                ImageSmall     = ImageResources.DCLViewClear16.GetBitmapImage(),
                ImageLarge     = ImageResources.DCLViewClear32.GetBitmapImage(),
                GlyphAlignment = GlyphAlignmentType.Top,
                Priority       = 1000
            });

            SetupCustomizeMenu(_сustomizationBar, listmenu);

            _сustomizationBar.MenuItems.Add(listmenu);
        }