protected override bool SetCreateTypeInfo(IComponent pComponent) { if (pComponent is RibbonPageItem) { RibbonPageItem item = (RibbonPageItem)pComponent; IRibbonControl pRibbonControl = item.TryGetDependRibbonControl(); if (pRibbonControl != null) { item.LineDistance = 2; item.ColumnDistance = 2; //item.ShowBackgroud = true; } } else if (pComponent is RibbonBarItem) { RibbonBarItem item = (RibbonBarItem)pComponent; IRibbonControl pRibbonControl = item.TryGetDependRibbonControl(); if (pRibbonControl != null) { item.Padding = new Padding(3, 3, 3, 2); } } else if (pComponent is TextBoxItem) { TextBoxItem item = (TextBoxItem)pComponent; IRibbonControl pRibbonControl = item.TryGetDependRibbonControl(); if (pRibbonControl != null) { item.Size = new Size(100, 21); } } // return(base.SetCreateTypeInfo(pComponent)); }
public override void Initialize(IComponent component) { base.Initialize(component); // this.m_RibbonPageItem = base.Component as RibbonPageItem; if (this.m_RibbonPageItem == null) { GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("RibbonPageItem == null"); return; } }
protected internal override void SelectedComponent(Component component) { base.SelectedComponent(component); // if (component is RibbonPageItem) { RibbonPageItem item = component as RibbonPageItem; int index = this.m_pRibbonControl.TabPages.IndexOf(item); if (index >= 0 && index != this.m_pRibbonControl.RibbonPageSelectedIndex) { this.m_pRibbonControl.RibbonPageSelectedIndex = index; } } }
protected internal override void SelectedComponent(Component component) { base.SelectedComponent(component); // if (component is RibbonPageItem) { RibbonPageItem item = (RibbonPageItem)component; IRibbonControl pRibbonControl = item.TryGetDependRibbonControl(); if (pRibbonControl != null) { int index = pRibbonControl.TabPages.IndexOf(item); if (index >= 0 && index != pRibbonControl.RibbonPageSelectedIndex) { pRibbonControl.RibbonPageSelectedIndex = index; } } } }
private bool SelectCompnentMouseUp_DG(IUICollectionItem pUICollectionItem, Point point) { if (pUICollectionItem == null) { return(false); } if (!((IBaseItem)pUICollectionItem).Visible) { return(false); } // bool bIsCanvasItem = pUICollectionItem is ICanvasItem; bool bIsTabButtonContainerItem = pUICollectionItem is ITabButtonContainerItem; // foreach (BaseItem one in pUICollectionItem.BaseItems) { if (this.SelectCompnentMouseUp_DG(one as IUICollectionItem, point)) { return(true); } // if (!bIsCanvasItem) { if (one.DesignMouseClickRectangleContainsEx(point)) { ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService; if (pSelectionService != null) { if (bIsTabButtonContainerItem && one is TabButtonItem) { TabButtonItem tabButtonItem = (TabButtonItem)one; this.m_Item2 = tabButtonItem; ITabButtonContainerItem pTabButtonContainerItem = (ITabButtonContainerItem)pUICollectionItem; if (pTabButtonContainerItem.BaseItems.ExchangeItemT(this.m_Item1, this.m_Item2)) { RibbonPageTabButtonItem tabButton = this.m_Item1 as RibbonPageTabButtonItem; if (tabButton != null) { BaseItem tabPageItem = tabButtonItem.pTabPageItem as BaseItem; if (tabPageItem != null) { if (this.SetSelectedComponents(pSelectionService, tabPageItem)) { this.m_Control.Refresh(); } } } return(true); } else { RibbonPageItem ribbonPage = tabButtonItem.pTabPageItem as RibbonPageItem; if (ribbonPage != null) { if (this.SetSelectedComponents(pSelectionService, ribbonPage)) { this.m_Control.Refresh(); } } return(true); } } else { this.m_Item2 = one; if (pUICollectionItem.BaseItems.ExchangeItem(this.m_Item1, this.m_Item2)) { if (this.SetSelectedComponents(pSelectionService, this.m_Item1)) { this.m_Control.Refresh(); } return(true); } else { this.m_Control.Refresh(); if (this.SetSelectedComponents(pSelectionService, one)) { this.m_Control.Refresh(); } return(true); } } } } } } // if (bIsCanvasItem) { if (this.m_Item1 != null) { if (this.m_MouseDownPoint != Point.Empty) { ISetBaseItemHelper pSetBaseItemHelper = this.m_Item1 as ISetBaseItemHelper; if (pSetBaseItemHelper != null) { int iX = point.X - this.m_MouseDownPoint.X; int iY = point.Y - this.m_MouseDownPoint.Y; pSetBaseItemHelper.SetLocation(this.m_Item1.Location.X + iX, this.m_Item1.Location.Y + iY); this.Translation_DG(this.m_Item1 as CanvasItem, iX, iY); this.m_MouseDownPoint = Point.Empty; this.m_Control.Refresh(); } } // ISelectionService pSelectionService = GetService(typeof(ISelectionService)) as ISelectionService; if (pSelectionService != null) { this.SetSelectedComponents(pSelectionService, this.m_Item1); } // this.m_Item1 = null; // return(true); } } // return(false); }