コード例 #1
0
        public TabGroupLeaf(TabbedGroups tabbedGroups, TabGroupBase parent)
            : base(tabbedGroups, parent)
        {
            // Create our managed tab control instance
            _tabControl = new Controls.TabControl();

            // We need page drag to begin when mouse dragged a small distance
            _tabControl.DragFromControl = false;

            // We need to monitor attempts to drag into the tab control
            _dragEntered           = false;
            _tabControl.AllowDrop  = true;
            _tabControl.DragDrop  += new DragEventHandler(OnControlDragDrop);
            _tabControl.DragEnter += new DragEventHandler(OnControlDragEnter);
            _tabControl.DragLeave += new EventHandler(OnControlDragLeave);

            // Need notification when page drag begins
            _tabControl.PageDragStart += new MouseEventHandler(OnPageDragStart);
            _tabControl.PageDragMove  += new MouseEventHandler(OnPageDragMove);
            _tabControl.PageDragEnd   += new MouseEventHandler(OnPageDragEnd);
            _tabControl.PageDragQuit  += new MouseEventHandler(OnPageDragQuit);

            // Hook into tab page collection events
            _tabControl.TabPages.Cleared  += new CollectionClear(OnTabPagesCleared);
            _tabControl.TabPages.Inserted += new CollectionChange(OnTabPagesInserted);
            _tabControl.TabPages.Removed  += new CollectionChange(OnTabPagesRemoved);

            // Hook into page level events
            _tabControl.GotFocus     += new EventHandler(OnGainedFocus);
            _tabControl.PageGotFocus += new EventHandler(OnGainedFocus);
            _tabControl.ClosePressed += new EventHandler(OnClose);

            // Manager only created at start of drag operation
            _targetManager = null;

            DefinePopupMenuForControl(_tabControl);

            // Setup the correct 'HideTabsMode' for the control
            Notify(TabGroupBase.NotifyCode.DisplayTabMode);

            // Define the default setup of TabControl and allow developer to customize
            _tabbedGroups.OnTabControlCreated(_tabControl);
        }
コード例 #2
0
 public TabGroupBase(TabbedGroups tabbedGroups, TabGroupBase parent)
 {
     InternalConstruct(tabbedGroups, parent);
 }
コード例 #3
0
 internal void SetParent(TabGroupBase tgb)
 {
     _parent = tgb;
 }