/// <summary> /// Displays a context menu, listing all currently active documents within the specified document strip. /// </summary> /// <param name="strip"></param> /// <param name="screenPos"></param> public void DisplayActiveWindowList(DocumentTabStrip strip, Point screenPos) { if (!this.allowActiveWindowListContextMenu || !this.CanOperate()) { return; } List <RadMenuItemBase> items = this.BuildContextMenuItems(strip); ContextMenuDisplayingEventHandler eh = this.Events[ContextMenuDisplayingEventKey] as ContextMenuDisplayingEventHandler; if (eh != null) { ContextMenuDisplayingEventArgs e = new ContextMenuDisplayingEventArgs(strip, items, screenPos); eh(this, e); if (e.Cancel) { return; } //get the display position from the event arguments since the user may have it changed screenPos = e.DisplayPosition; } this.DisplayMenuCore(items, screenPos); }
/// <summary> /// Gets the list of menu items to be displayed on the ActiveWindowList on the specified DocumentTabStrip. /// </summary> /// <param name="strip"></param> /// <returns></returns> public IEnumerable <DockWindow> GetActiveWindowList(DocumentTabStrip strip) { IEnumerable collection = null; switch (this.activeListMenuSortOrder) { case ActiveDocumentListSortOrder.None: collection = strip.TabPanels; break; case ActiveDocumentListSortOrder.ZOrdered: collection = this.documents; break; case ActiveDocumentListSortOrder.ByText: collection = this.documentsSorted; break; } foreach (DockWindow window in collection) { if (window.Parent == strip) { yield return(window); } } }
/// <summary> /// Prepares the list of opened documents within the specified DocumentTabStrip instance. /// </summary> /// <param name="strip"></param> /// <returns></returns> private List <RadMenuItemBase> BuildContextMenuItems(DocumentTabStrip strip) { List <RadMenuItemBase> items = new List <RadMenuItemBase>(); foreach (DockWindow window in this.DockManager.DocumentManager.GetActiveWindowList(strip)) { items.Add(this.CreateMenuItem(window, ActivateWindow, null, true)); } return(items); }
private void EnsureActiveDocument() { //search all DocumentTabStrip instances and select the first opened document foreach (Control child in ControlHelper.EnumChildControls(this.dockManager.MainDocumentContainer, true)) { DocumentTabStrip strip = child as DocumentTabStrip; if (strip != null && strip.TabPanels.Count > 0 && strip.DockManager == this.dockManager) { DockWindow active = strip.ActiveWindow; this.InsertDocument(-1, active); strip.UpdateActiveWindow(active, true); break; } } }
private void ProcessDockableContainer(TabStripPanel dockableContainer, RadDock dock, List <SplitPanel> splitPanelList, RadDockComponentFactory componentFactory) { DocumentTabStrip documentTabStrip = dockableContainer as DocumentTabStrip; if (documentTabStrip == null) { splitPanelList.Add(dockableContainer); return; } DocumentContainer documentContainer = this.CreateMainDocumentContainer(dock, componentFactory); if (documentContainer != null) { splitPanelList.Add(documentContainer); } dock.MainDocumentContainer.SplitPanels.Add(documentTabStrip); }
public ContextMenuDisplayingEventArgs(DocumentTabStrip strip, List <RadMenuItemBase> items, Point displayPos) : this(items, displayPos) { this.documentStrip = strip; this.menuType = ContextMenuType.ActiveWindowList; }