Exemple #1
0
        void SetTreeDesignMode(UC_TreeNavBar treeList)
        {
            if (IsOnDesignMode)
            {
                treeList.AllowDrop = true;

                this.AllowDrop = true;
            }
        }
Exemple #2
0
        void Update_UC_TreeNavBar(DevExpress.XtraNavBar.NavBarGroup navBarGroup, TreeNodeButton pMenuBarTreeNode)
        {
            BarGroup wBarGroup = (BarGroup)navBarGroup.Tag;

            wBarGroup.MenuBarTree.Add(pMenuBarTreeNode);
            UC_TreeNavBar treeList = (UC_TreeNavBar)((System.Windows.Forms.Control)(navBarGroup.ControlContainer)).Controls[0];

            //treeList = navBarGroup

            treeList.Populate(wBarGroup.MenuBarTree, this.IsOnDesignMode);
        }
Exemple #3
0
        void Cretate_UC_TreeNavBar(DevExpress.XtraNavBar.NavBarGroup navBarGroup)
        {
            BarGroup wBarGroup = (BarGroup)navBarGroup.Tag;

            NavBarGroupControlContainer navBarGroupControlContainer = new NavBarGroupControlContainer();

            navBarGroupControlContainer.SuspendLayout();
            this.Controls.Add(navBarGroupControlContainer);

            UC_TreeNavBar treeList = new UC_TreeNavBar();


            this.SuspendLayout();

            navBarGroup.GroupStyle = NavBarGroupStyle.ControlContainer;
            navBarGroupControlContainer.Controls.Add(treeList);
            navBarGroupControlContainer.Name = "navBarGroupControlContainer" + treeCount;
            navBarGroupControlContainer.Size = new System.Drawing.Size(176, 243);
            //navBarGroupControlContainer.TabIndex = treeCount;
            navBarGroup.ControlContainer = navBarGroupControlContainer;

            treeList.Populate(wBarGroup.MenuBarTree, this.IsOnDesignMode);

            treeList.Dock             = System.Windows.Forms.DockStyle.Fill;
            treeList.Location         = new System.Drawing.Point(0, 0);
            treeList.Name             = string.Concat("treeList", treeCount);
            treeList.TabIndex         = treeCount;
            treeList.Tag              = wBarGroup.MenuBarTree;
            treeList.OnNodeClick     += new OnNodeClickHandler(treeList_OnNodeClick);
            treeList.OnTreeViewClick += new EventHandler(treeList_OnTreeViewClick);
            SetTreeDesignMode(treeList);

            treeCount++;


            navBarGroupControlContainer.ResumeLayout(false);

            this.ResumeLayout(false);
        }
Exemple #4
0
        /// <summary>
        /// Actualiza un simplebuton
        /// </summary>
        /// <param name="ButtonBase_Updated">ButtonBase o item con los nuevos valores
        /// conserva el GUID</param>
        public void Update_ItemFromGroup(Fwk.UI.Controls.Menu.ButtonBase buttonBase_Updated)
        {
            BarGroup wBarGroup = (BarGroup)this.ActiveGroup.Tag;

            //BarGroup wBarGroupX = _MenuBar.GetBy_Guid(wBarGroup.Guid);
            if ((wBarGroup).ContainTree)
            {
                Fwk.UI.Controls.Menu.TreeNodeButton originalButtonBase = wBarGroup.MenuBarTree.GetBy_Guid(buttonBase_Updated.Guid);

                originalButtonBase.Map((TreeNodeButton)buttonBase_Updated);
                //wBarGroup.MenuBarTree.
                UC_TreeNavBar treeList = (UC_TreeNavBar)((System.Windows.Forms.Control)(this.ActiveGroup.ControlContainer)).Controls[0];

                treeList.Refresh();
            }
            else
            {
                Fwk.UI.Controls.Menu.ButtonBase originalButtonBase = wBarGroup.Buttons.GetBy_Guid(buttonBase_Updated.Guid);

                originalButtonBase.Map(buttonBase_Updated);


                //Recorro los items de la ActiveGroup y actuaizo los datos del que tenga como tag el guid que se actualiza
                foreach (NavBarItem link in this.ActiveGroup.NavBar.Items)
                {
                    if (((Fwk.UI.Controls.Menu.ButtonBase)(link.Tag)).Guid.Equals(originalButtonBase.Guid))
                    {
                        if (originalButtonBase.Image != null)
                        {
                            link.SmallImage = Fwk.HelperFunctions.TypeFunctions.ConvertByteArrayToImage(originalButtonBase.Image);
                        }

                        link.Caption = originalButtonBase.Caption;
                    }
                }
            }
        }