public TabPage Add(TabPage value)
        {
            // Use base class to process actual collection operation
            base.List.Add(value as object);

            return value;
        }
        public WizardPage Add(TabPage value)
        {
            // Create a WizardPage from the TabPage
            WizardPage wp = new WizardPage();
            wp.Title = value.Title;
            wp.Control = value.Control;
            wp.ImageIndex = value.ImageIndex;
            wp.ImageList = value.ImageList;
            wp.Icon = value.Icon;
            wp.Selected = value.Selected;
            wp.StartFocus = value.StartFocus;

            return Add(wp);
        }
 public void Remove(TabPage value)
 {
     // Use base class to process actual collection operation
     base.List.Remove(value as object);
 }
 public void Insert(int index, TabPage value)
 {
     // Use base class to process actual collection operation
     base.List.Insert(index, value as object);
 }
 public int IndexOf(TabPage value)
 {
     // Find the 0 based index of the requested entry
     return base.List.IndexOf(value);
 }
 public bool Contains(TabPage value)
 {
     // Use base class to process actual collection operation
     return base.List.Contains(value as object);
 }
 public void AddRange(TabPage[] values)
 {
     // Use existing method to add each array entry
     foreach(TabPage page in values)
         Add(page);
 }
        protected void RestoreDraggingPage()
        {
            // Create TabPage to represent the Content
            SharpClient.UI.Controls.TabPage newPage = new SharpClient.UI.Controls.TabPage();

            Content content = _redocker.Content;

            // Reflect the Content properties int the TabPage
            newPage.Title = content.Title;

            newPage.ImageList = content.ImageList;
            newPage.ImageIndex = content.ImageIndex;
            newPage.Control = content.Control;
            newPage.Tag = content;
            newPage.Selected = true;
		
            // Put it back where it came from
            _tabControl.TabPages.Insert(_dragPageIndex, newPage);

            // Update the title displayed
            NotifyFullTitleText(content.FullTitle);
        }
        protected override void OnContentInserted(int index, object value)
        {
            base.OnContentInserted(index, value);

            Content content = value as Content;

            // Create TabPage to represent the Content
            SharpClient.UI.Controls.TabPage newPage = new SharpClient.UI.Controls.TabPage();

            // Reflect the Content properties int the TabPage
            newPage.Title = content.Title;
            newPage.ImageList = content.ImageList;
            newPage.ImageIndex = content.ImageIndex;
            newPage.Control = content.Control;
            newPage.Tag = content;
			
            // Reflect same order in TabPages collection as Content collection
            _tabControl.TabPages.Insert(index, newPage);
        }
Example #10
0
			public DrawTab(SharpClient.UI.Controls.TabPage tabPage, Rectangle drawRect, int index)
			{
				_index = index;
				_tabPage = tabPage;
				_drawRect = drawRect;
			}
Example #11
0
        public void AddContentsAsGroup(ContentCollection contents, int index)
		{
            // Create new TabStub to represent the Contents
            TabStub ts = new TabStub(_manager.Style);

            // Set manager requested settings
            ts.Font = _manager.CaptionFont;
            ts.BackColor = _manager.BackColor;
            ts.ForeColor = _manager.InactiveTextColor;

            // Hook into events
            ts.PageOver += new TabStub.TabStubIndexHandler(OnPageOver);
            ts.PageClicked += new TabStub.TabStubIndexHandler(OnPageClicked);
            ts.PagesLeave += new TabStub.TabStubHandler(OnPagesLeave);
		    
            // Add a page for each Content instance
            foreach(Content c in contents)
            {
                // Create page object
                SharpClient.UI.Controls.TabPage page = new SharpClient.UI.Controls.TabPage();
		        
                // Copy across the visual properties
                page.Title = c.Title;
                page.ImageList = c.ImageList;
                page.ImageIndex = c.ImageIndex;
                
                // Remember reference to Content it represents
                page.Tag = c;
		        
                // Add into the stub
                ts.TabPages.Add(page);
		        
                // Mark Content as being in AutoHide mode
                c.AutoHidePanel = this;
                c.AutoHidden = true;
            }

            State windowState = State.DockLeft;
		    
            // Define stub settings based on our docking position
            switch(this.Dock)
            {
                case DockStyle.Left:
                    windowState = State.DockLeft;
                    ts.Edging = Edge.Left;
                    ts.Dock = DockStyle.Top;
                    break;
                case DockStyle.Right:
                    windowState = State.DockRight;
                    ts.Edging = Edge.Right;
                    ts.Dock = DockStyle.Top;
                    break;
                case DockStyle.Top:
                    windowState = State.DockTop;
                    ts.Edging = Edge.Top;
                    ts.Dock = DockStyle.Left;
                    break;
                case DockStyle.Bottom:
                    windowState = State.DockBottom;
                    ts.Edging = Edge.Bottom;
                    ts.Dock = DockStyle.Left;
                    break;
            }
		    
            // Add stub into the view
            Controls.Add(ts);
            
            // Set correct new position
            Controls.SetChildIndex(ts, index);
		    
            // Each TabStub has a WCT created and ready to be shown when needed
            WindowContentTabbed wct = _manager.CreateWindowForContent(null, new EventHandler(OnPageClose),
                                                                      null, new EventHandler(OnPageAutoHide))as WindowContentTabbed;
				//,                                                                      new ContextHandler(OnPageContextMenu)) as WindowContentTabbed;
            
            // Add each Content instance in turn
            foreach(Content c in contents)
                wct.Contents.Add(c);
                
            // By default the first Content added to a WCT will define the size
            // of the WCT control. We need to override this to use the AutoHideSize
            // from the first Content instead.
            wct.Size = contents[0].AutoHideSize;

            // Ensure Window caption bar reflects correct docking status
            wct.State = windowState;

            // Inform Window it should not allow user initiated redocking
            wct.RedockAllowed = false;

            // Hide tab selection from user
            wct.TabControl.HideTabsMode = SharpClient.UI.Controls.TabControl.HideTabsModes.HideAlways;

            // Associate WCT with matching TabStub
            ts.WindowContentTabbed = wct;
            
            // Make sure this AutoHidePanel is visible
            if (!this.Visible)
			    this.Show();
			    
	        Invalidate();
		}
Example #12
0
        public void AddContentIntoTabStub(Content content, TabStub ts, int index)
        {
            // Is focus leaving the entire WindowContentTabbed control?
            if ((_currentWCT != null) && (_currentWCT == ts.WindowContentTabbed))
            {
                // Remove Panel/WCT from display and stop timers
                RemoveDisplayedWindow();
            }                
        
            // Create a new tab page
            SharpClient.UI.Controls.TabPage page = new SharpClient.UI.Controls.TabPage();
		        
            // Copy across the visual properties
            page.Title = content.Title;
            page.ImageList = content.ImageList;
            page.ImageIndex = content.ImageIndex;
                
            // Remember reference to Content it represents
            page.Tag = content;
		        
            // Add into the stub
            ts.TabPages.Insert(index, page);
		        
            // Mark Content as being in AutoHide mode
            content.AutoHidePanel = this;
            content.AutoHidden = true;
        
            // Add content into the WCT of the TabStub
            ts.WindowContentTabbed.Contents.Insert(index, content);

            // Make sure this AutoHidePanel is visible
            if (!this.Visible)
                this.Show();
                
            Invalidate();
        }