Exemple #1
0
        /// <summary>
        /// Adds a Menu item to the <see cref="T:Habanero.Faces.Base.IMenuItemCollection" />.
        /// </summary>
        /// <param name="menuItem"></param>
        public void Add(IMenuItem menuItem)
        {
            _list.Add(menuItem);
            ICollapsiblePanelGroupControl cpGroupMenuItem = _ownerMenuItem as ICollapsiblePanelGroupControl;

            if (cpGroupMenuItem != null && menuItem is CollapsibleSubMenuItemVWG)
            {
                CollapsibleSubMenuItemVWG outlookStyleSubMenuItem = (CollapsibleSubMenuItemVWG)menuItem;
                cpGroupMenuItem.AddControl(outlookStyleSubMenuItem);
                return;
            }
            ICollapsiblePanel cpMenuItem = _ownerMenuItem as ICollapsiblePanel;

            if (cpMenuItem != null && menuItem is CollapsibleMenuItemVWG)
            {
                if (cpMenuItem.ContentControl == null)
                {
                    cpMenuItem.ContentControl = this.ControlFactory.CreatePanel();
                    _columnLayoutManager      = new ColumnLayoutManager(cpMenuItem.ContentControl, this.ControlFactory);
                    // this.ControlFactory.CreateBorderLayoutManager(cpMenuItem);
                    _columnLayoutManager.HorizontalGapSize = 0;
                    _columnLayoutManager.VerticalGapSize   = 0;
                    _columnLayoutManager.BorderSize        = 0;
                }
                _columnLayoutManager.AddControl((CollapsibleMenuItemVWG)menuItem);
                cpMenuItem.Height        += ((CollapsibleMenuItemVWG)menuItem).Height;
                cpMenuItem.ExpandedHeight = cpMenuItem.Height;
            }
        }
Exemple #2
0
        /// <summary>
        /// Builds a CollapsibleMenu for Visual Web Gui.
        /// </summary>
        /// <param name="habaneroMenu"></param>
        /// <returns></returns>
        protected virtual IMenuItem BuildMenu(HabaneroMenu habaneroMenu)
        {
            IMenuItem subMenuItem = new CollapsibleSubMenuItemVWG(this.ControlFactory, habaneroMenu.Name);

            BuildSubMenu(habaneroMenu, subMenuItem.MenuItems);
            CreateLeafMenuItems(habaneroMenu, subMenuItem);
            return(subMenuItem);
        }