/// <summary> /// Metoda přidá separátor jako další prvek grupy, pokud je to vhodné. /// Pokud je this grupa prázdná, anebo pokud poslední prvek grupy už je separátor, pak není vhodné přidávat další. /// </summary> /// <param name="provider"></param> /// <param name="force">true = Přidat separátor i když to není vhodné</param> public void AddSeparator(IFunctionProvider provider = null, bool force = false) { if (force || (this.Items.Count > 0 && this.Items[this.Items.Count - 1].ItemType != FunctionGlobalItemType.Separator)) { FunctionGlobalItem functionItem = new FunctionGlobalItem(provider); functionItem.Name = "__separator__"; functionItem.Text = ""; functionItem.ItemType = FunctionGlobalItemType.Separator; this.Items.Add(functionItem); } }
private FunctionGlobalGroup _CreateGroupEdit() { FunctionGlobalGroup group = new FunctionGlobalGroup(this); group.Title = "Editace položek"; group.Order = "A2"; group.ToolTipTitle = "EDITACE POLOŽEK"; group.LayoutWidth = 16; List <FunctionGlobalItem> items = new List <FunctionGlobalItem>(); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Small, Image = App.ResourcesApp.GetImage(RES.Images.Actions24.EditCopy2Png), Text = "Copy", ToolTip = "", LayoutHint = LayoutHint.NextItemSkipToNextRow }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Small, Image = App.ResourcesApp.GetImage(RES.Images.Actions24.EditCut2Png), Text = "Cut", ToolTip = "", LayoutHint = LayoutHint.NextItemSkipToNextRow }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Small, Image = App.ResourcesApp.GetImage(RES.Images.Actions24.EditPaste2Png), Text = "Paste", ToolTip = "", LayoutHint = LayoutHint.NextItemSkipToNextRow }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Micro, Image = App.ResourcesApp.GetImage(RES.Images.Actions16.EditPaste2Png), ToolTip = "Napastuje dokument" }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Micro, Image = App.ResourcesApp.GetImage(RES.Images.Actions16.EditUndo2Png), ToolTip = "Undoluje obsah" }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Micro, Image = App.ResourcesApp.GetImage(RES.Images.Actions16.EditRedo2Png), ToolTip = "Redohodí to co jste nečekali" }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Micro, Image = App.ResourcesApp.GetImage(RES.Images.Actions16.ViewRefresh2Png), ToolTip = "Přenačte něco málo z databáze" }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Large, Image = App.ResourcesApp.GetImage(RES.Images.Actions24.ArrowLeft2Png), Text = "", ToolTip = "Jděte vlevo" }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Large, Image = App.ResourcesApp.GetImage(RES.Images.Actions24.ArrowRight2Png), Text = "", ToolTip = "Jděte vpravo", LayoutHint = LayoutHint.ThisItemOnSameRow }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Micro, Image = App.ResourcesApp.GetImage(RES.Images.Actions16.EditRedo4Png), ToolTip = "Zase to redo" }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Separator, Size = FunctionGlobalItemSize.Whole }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Half, Image = App.ResourcesApp.GetImage(RES.Images.Actions16.EditUndo6Png), Text = "UNDO", LayoutHint = LayoutHint.ThisItemSkipToNextTable }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Button, Size = FunctionGlobalItemSize.Half, Image = App.ResourcesApp.GetImage(RES.Images.Actions16.EditRedo6Png), Text = "REDO", LayoutHint = LayoutHint.ThisItemSkipToNextTable, IsEnabled = false }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Separator, Size = FunctionGlobalItemSize.Whole }); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Label, Size = FunctionGlobalItemSize.Small, Text = "Databáze:" }); this._DbCombo = new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.ComboBox, Size = FunctionGlobalItemSize.Half }; this._DbCombo.SubItemsEnumerateBefore += new FunctionItemEventHandler(_DbCombo_SubItemsEnumerateBefore); group.Items.Add(this._DbCombo); group.Items.Add(new FunctionGlobalItem(this) { ItemType = FunctionGlobalItemType.Separator, Size = FunctionGlobalItemSize.Whole }); FunctionGlobalItem fItem = group.Items[0]; group.SubItemsEnumerateBefore += _ItemInGroup_SubItemsEnumerateBefore; group.ItemClicked += _ItemInGroupClick; return(group); }