public static BarButtonItem initMenuBtnItem(int strId, string strName, string strText, RibbonItemStyles eStyle, string strFilePathSvg, ItemClickEventHandler oCallback4Click, RibbonControl oParentSuper, PopupMenu oParent4MenuBtnItemContainer) { var oMenuItem = new BarButtonItem(); //set props oMenuItem.Id = strId; oMenuItem.Name = strName; var strLan = I18nUtilsEx.getStrFromApp(strName); oMenuItem.Caption = String.IsNullOrEmpty(strLan) ? strText : strLan; oMenuItem.RibbonStyle = eStyle; oMenuItem.ImageOptions.SvgImage = SvgImage.FromFile(strFilePathSvg); oMenuItem.ItemClick += oCallback4Click; //add to parent oParentSuper.Items.Add(oMenuItem); oParent4MenuBtnItemContainer.ItemLinks.Add(oMenuItem); return(oMenuItem); }
public static BarButtonItem initComplexBtnItem(int strId, string strName, string strText, RibbonItemStyles eStyle, string strFilePathSvg, ItemClickEventHandler oCallback4Click, RibbonControl oParentSuper, BarSubItem oParent4ComplexBtn) { var oComplexBtnItem = new BarButtonItem(); //set props oComplexBtnItem.Id = strId; oComplexBtnItem.Name = strName; var strLan = I18nUtilsEx.getStrFromApp(strName); oComplexBtnItem.Caption = String.IsNullOrEmpty(strLan) ? strText : strLan; oComplexBtnItem.RibbonStyle = eStyle; oComplexBtnItem.ImageOptions.SvgImage = SvgImage.FromFile(strFilePathSvg); oComplexBtnItem.ItemClick += oCallback4Click; //add to parent oParentSuper.Items.Add(oComplexBtnItem); oParent4ComplexBtn.LinksPersistInfo.Add(new LinkPersistInfo(oComplexBtnItem)); return(oComplexBtnItem); }
public static BarButtonItem initSimpleBtn(int strId, string strName, string strText, RibbonItemStyles eStyle, string strFilePathSvg, ItemClickEventHandler oCallback4Click, RibbonControl oParentSuper, RibbonPageGroup oParent4Group) { var oButton = new BarButtonItem(); //set props oButton.Id = strId; oButton.Name = strName; var strLan = I18nUtilsEx.getStrFromApp(strName); oButton.Caption = String.IsNullOrEmpty(strLan) ? strText : strLan; oButton.RibbonStyle = eStyle; oButton.ImageOptions.SvgImage = SvgImage.FromFile(strFilePathSvg); oButton.ItemClick += oCallback4Click; //add to parent oParentSuper.Items.Add(oButton); oParent4Group.ItemLinks.Add(oButton); return(oButton); }
private void ParseRibbonItemStyle() { RibbonItemStyles ribbonStyle = RibbonItemStyles.Default; if (this.codon != null && this.codon.Properties.Contains("style")) { string value = StringParser.Parse(this.codon.Properties["style"]); if (!string.IsNullOrEmpty(value)) { try { ribbonStyle = (RibbonItemStyles)System.Enum.Parse(typeof(RibbonItemStyles), value); } catch (System.Exception) { ribbonStyle = RibbonItemStyles.Default; } } } base.RibbonStyle = ribbonStyle; }
public static BarSubItem initComplexBtn(int strId, string strName, string strText, RibbonItemStyles eStyle, string strFilePathSvg, RibbonControl oParentSuper, RibbonPageGroup oParent4Group) { var oComplexBtn = new BarSubItem(); //set props oComplexBtn.Id = strId; oComplexBtn.Name = strName; var strLan = I18nUtilsEx.getStrFromApp(strName); oComplexBtn.Caption = String.IsNullOrEmpty(strLan) ? strText : strLan; oComplexBtn.RibbonStyle = eStyle; oComplexBtn.ImageOptions.SvgImage = SvgImage.FromFile(strFilePathSvg); //add to parent oParentSuper.Items.Add(oComplexBtn); oParent4Group.ItemLinks.Add(oComplexBtn); return(oComplexBtn); }
/// <summary> /// Do dané grupy přidá nový button podle definice /// </summary> /// <param name="group"></param> /// <param name="text"></param> /// <param name="tooltip"></param> /// <param name="image"></param> /// <param name="style"></param> /// <param name="itemClick"></param> private void RibbonAddButton(RibbonPageGroup group, string text, string tooltip, Bitmap image, RibbonItemStyles style, DXB.ItemClickEventHandler itemClick) { DXB.BarButtonItem button = new DXB.BarButtonItem(this.Ribbon.Manager, text) { RibbonStyle = style }; button.ImageOptions.Image = image; if (tooltip != null) { button.SuperTip = new DevExpress.Utils.SuperToolTip(); button.SuperTip.Items.AddTitle(text); button.SuperTip.Items.Add(tooltip); } group.ItemLinks.Add(button); if (itemClick != null) { button.ItemClick += itemClick; } }