Пример #1
0
        /// <summary>
        /// Carga el objeto Menu pasado
        /// en un control MenuEditor y lo muestra
        /// en el grpPanel de edición.
        /// </summary>
        /// <param name="menuObjectToLoad">Objeto Menu a cargar.</param>
        private void LoadPopupButtonObject(Fwk.UI.Controls.Menu.PopupButton popupButtonObjectToLoad)
        {
            UC_PopupButtonEditor popupButtonEditor    = null;
            IEnumerable <UC_PopupButtonEditor> editor = grpEditionContainer.Controls.OfType <UC_PopupButtonEditor>();

            if (editor.Count() > 0)
            {
                popupButtonEditor        = editor.First();
                popupButtonEditor.OnInit = true;

                popupButtonEditor.BringToFront();
                popupButtonEditor.LoadControl(popupButtonObjectToLoad);
                popupButtonEditor.MenuItemSaved += new MenuItemSavedHandler(menuEditor_MenuItemSaved);
                //popupButtonEditor.EditorValueChanges += new EventHandler(editorTemp_EditorValueChanges);
                popupButtonEditor.OnInit = false;
                return;
            }

            popupButtonEditor        = new UC_PopupButtonEditor();
            popupButtonEditor.OnInit = true;
            grpEditionContainer.Controls.Add(popupButtonEditor);
            popupButtonEditor.Dock = DockStyle.Fill;
            popupButtonEditor.BringToFront();
            popupButtonEditor.LoadControl(popupButtonObjectToLoad);
            popupButtonEditor.MenuItemSaved += new MenuItemSavedHandler(menuEditor_MenuItemSaved);
            //popupButtonEditor.EditorValueChanges += new EventHandler(editorTemp_EditorValueChanges);
            popupButtonEditor.OnInit = false;
        }
Пример #2
0
        private void DrawToolBar()
        {
            ctlToolBar.ClearLinks();

            if (_Buttons == null)
            {
                return;
            }

            PopupButton        wPopupButton   = null;
            PopupMenu          wPopupMenu     = null;
            BarLargeButtonItem wBarButtonItem = null;


            foreach (ButtonBase wButton in _Buttons)
            {
                // Se arma un PopupButton
                if (wButton.GetType() == typeof(PopupButton))
                {
                    wBarButtonItem = CreateButtonBase(wButton);

                    wPopupButton                   = (PopupButton)wButton;
                    wPopupMenu                     = new PopupMenu(this.components);
                    wPopupMenu.Manager             = barManager1;
                    wBarButtonItem.DropDownControl = wPopupMenu;
                    wBarButtonItem.DropDownEnabled = true;
                    wBarButtonItem.ButtonStyle     = BarButtonStyle.DropDown;
                    wBarButtonItem.ActAsDropDown   = true;

                    foreach (ButtonBase item in wPopupButton.Buttons)
                    {
                        wPopupMenu.ItemLinks.Add(CreateButtonBase(item));
                    }

                    ctlToolBar.AddItem(wBarButtonItem);
                }
                else
                {
                    wBarButtonItem = CreateButtonBase(wButton);
                    //AAguirre - Se agrego esta linea y se comento la linea de arriba, el boton se agregaba en el bar manager y no en la toolbar
                    ctlToolBar.AddItem(wBarButtonItem);
                }
            }
        }