public override void Initialize(IComponent component) { base.Initialize(component); // this.m_pCollectionItem = base.Component as ICollectionItem; this.m_pRibbonApplicationObjectDesignHelper = base.Component as IRibbonApplicationObjectDesignHelper; this.m_pObjectDesignHelper = base.Component as IObjectDesignHelper; this.m_pCollectionObjectDesignHelper = base.Component as ICollectionObjectDesignHelper; this.m_pPopupObjectDesignHelper = base.Component as IPopupObjectDesignHelper; // this.m_pRibbonControl = base.Component as IRibbonControl; this.m_pRibbonPageItem = base.Component as IRibbonPageItem; this.m_pButtonGroupItem = base.Component as IButtonGroupItem; this.m_pGalleryItem = base.Component as IGalleryItem; this.m_RibbonGalleryRowItem = base.Component as RibbonGalleryRowItem; // if (this.m_pRibbonControl != null) { IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; if (host != null) { if (host.RootComponent is System.Windows.Forms.Form) { System.Windows.Forms.Form form = (System.Windows.Forms.Form)host.RootComponent; form.MainMenuStrip = this.m_pRibbonControl.MenuStrip; this.m_pRibbonControl.ParentForm = form; if (form is WFNew.RibbonForm) { ((WFNew.RibbonForm)form).RibbonControl = this.m_pRibbonControl; } } } } }
private bool SelectCompnentMouseUpDG(Point point, RibbonGalleryRowItem ribbonGalleryRowItem) { if (ribbonGalleryRowItem == null) { return(false); } // foreach (BaseItem one in ribbonGalleryRowItem.BaseItems) { if (one.DesignMouseClickRectangleContainsEx(point)) { ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService; if (pSelectionService != null) { this.m_Item2 = one; if (ribbonGalleryRowItem.BaseItems.ExchangeItem(this.m_Item1, this.m_Item2)) { pSelectionService.SetSelectedComponents(new Component[] { this.m_Item1 as Component }, SelectionTypes.Primary); this.m_RibbonGallery.Refresh(); return(true); } else { pSelectionService.SetSelectedComponents(new Component[] { one as Component }, SelectionTypes.Primary); this.m_RibbonGallery.Refresh(); return(true); } } } } // return(false); }
public override void Initialize(IComponent component) { base.Initialize(component); // this.m_RibbonGalleryRowItem = base.Component as RibbonGalleryRowItem; if (this.m_RibbonGalleryRowItem == null) { GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("RibbonGalleryRowItem == null"); return; } }
private void AddRibbonGalleryRowItem(object sender, EventArgs ea) { IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); if (host != null) { RibbonGalleryRowItem baseItem = host.CreateComponent(typeof(RibbonGalleryRowItem)) as RibbonGalleryRowItem; baseItem.Name = baseItem.Site.Name; baseItem.Text = baseItem.Name; baseItem.LineDistance = 1; baseItem.Size = new Size(100, 21); this.m_RibbonGalleryItem.BaseItems.Add(baseItem); } }