Example #1
0
        public static StringCollection ContentNamesInPriority(Zone z, Content c)
        {
            // Container for returned group of found Content objects
            StringCollection sc = new StringCollection();

            // Process each Window in the Zone
            foreach(Window w in z.Windows)
            {
                WindowContent wc = w as WindowContent;

                // Is the Zone a Content derived variation?
                if (wc != null)
                {
                    // Does this contain the interesting Content?
                    if (wc.Contents.Contains(c))
                    {
                        // All Content of this Window are given priority and
                        // added into the start of the collection
                        foreach(Content content in wc.Contents)
                            sc.Insert(0, content.Title);
                    }
                    else
                    {
                        // Lower priority Window and so contents are always
                        // added to the end of the collection
                        foreach(Content content in wc.Contents)
                            sc.Add(content.Title);
                    }
                }
            }

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

            return value;
        }
Example #3
0
        protected void InternalConstruct(Control callingControl, 
                                         Source source, 
                                         Content c, 
                                         WindowContent wc, 
                                         FloatingForm ff,
                                         DockingManager dm,
                                         Point offset)
        {
            // Store the starting state
            _callingControl = callingControl;
            _source = source;
            _content = c;
            _windowContent = wc;
            _dockingManager = dm;
            _container = _dockingManager.Container;
            _floatingForm = ff;
            _hotZones = null;
            _currentHotZone = null;
            _insideRect = new Rectangle();
            _outsideRect = new Rectangle();
            _offset = offset;

            // Begin tracking straight away
            EnterTrackingMode();
        }
        public Content Add(Control control, string title, ImageList imageList, int imageIndex)
        {
            Content c = new Content(_manager, control, title, imageList, imageIndex);

            // Use base class to process actual collection operation
            base.List.Add(c as object);

            return c;
        }
        public Content Add(Control control)
        {
            Content c = new Content(_manager, control);

            // Use base class to process actual collection operation
            base.List.Add(c as object);

            return c;
        }
		// Should only ever be used by Serialization
  		public Content Add(Content c)
        {
			// Assign correct docking manager to object
			c.DockingManager = _manager;

            // Use base class to process actual collection operation
            base.List.Add(c as object);

            return c;
        }
Example #7
0
		public RestoreContentDockingAffinity(Restore child, 
										     State state, 
											 Content content, 
											 StringCollection best,
											 StringCollection next,
											 StringCollection previous,
											 StringCollection nextAll,
											 StringCollection previousAll)
			: base(child, state, content)
		{
			// Remember parameters
			_best = best;
			_next = next;
			_previous = previous;
			_nextAll = nextAll;
			_previousAll = previousAll;
			_size = content.DisplaySize;
			_location = content.DisplayLocation;
		}
Example #8
0
 public RestoreAutoHideAffinity(Restore child, 
                                State state,
                                Content content, 
                                StringCollection next,
                                StringCollection previous,
                                StringCollection nextAll,
                                StringCollection previousAll)
 : base(child, state, content)
 {
     // Remember parameters
     _next = next;				
     _previous = previous;	
     _nextAll = nextAll;				
     _previousAll = previousAll;	
 }
Example #9
0
 public RestoreAutoHideState(Restore child, State state, Content content)
     : base(child, state, content)
 {
 }
Example #10
0
 protected virtual void OnContentChanged(Content obj, Content.Property prop) {}
 public int IndexOf(Content value)
 {
     // Find the 0 based index of the requested entry
     return base.List.IndexOf(value);
 }
Example #12
0
		public RestoreWindowContent(Restore child, 
									Content content, 
									StringCollection next, 
									StringCollection previous,
									bool selected)
			: base(child, content)
		{
			// Remember parameters
            _selected = selected;
            _next = next;
			_previous = previous;
		}
Example #13
0
		public RestoreContent(Content content)
			: base()
		{
			// Remember parameter
			_title = content.Title;
			_content = content;
		}
Example #14
0
		public RestoreContent()
			: base()
		{
			// Default state
			_title = "";
			_content = null;
		}
Example #15
0
		private void ShowStackControl(bool bShow,Content content)
		{
			if(_stackManager.Contents!=null && _stackManager.Contents.Count>0)
			{
				if(bShow)
				{				
					_stackManager.ShowContent(content); 
				}
				else
				{
					_stackManager.HideContent(content); 
				}
			}
		}
        protected override void OnContentChanged(Content obj, Content.Property prop)
        {
            // Find the matching TabPage entry
            foreach(SharpClient.UI.Controls.TabPage page in _tabControl.TabPages)
            {
                // Does this page manage our Content?
                if (page.Tag == obj)
                {
                    // Property specific processing
                    switch(prop)
                    {
                        case Content.Property.Control:
                            page.Control = obj.Control;
                            break;
                        case Content.Property.Title:
                            page.Title = obj.Title;
                            break;
                        case Content.Property.FullTitle:
                            // Title changed for the current page?
                            if (_tabControl.SelectedTab == page)
                            {
                                // Update displayed caption text
                                NotifyFullTitleText(obj.FullTitle);
                            }								
                            break;
                        case Content.Property.ImageList:
                            page.ImageList = obj.ImageList;
                            break;
                        case Content.Property.ImageIndex:
                            page.ImageIndex = obj.ImageIndex;
                            break;
                        case Content.Property.CaptionBar:
                            // Property changed for the current page?
                            if (_tabControl.SelectedTab == page)
                            {
                                Content target = page.Tag as Content;
                        
                                // TODO
                                NotifyShowCaptionBar(target.CaptionBar);                                
                            }
                            break;
                        case Content.Property.CloseButton:
                            // Property changed for the current page?
                            if (_tabControl.SelectedTab == page)
                            {
                                Content target = page.Tag as Content;
                        
                                NotifyCloseButton(target.CloseButton);   
                            }
                            break;
                        case Content.Property.HideButton:
                            // Property changed for the current page?
                            if (_tabControl.SelectedTab == page)
                            {
                                Content target = page.Tag as Content;
                        
                                NotifyHideButton(target.HideButton);   
                            }
                            break;
                    }

                    break;
                }
            }
        }
        public WindowContentTabbed(DockingManager manager, VisualStyle vs)
            : base(manager, vs)
        {
            _redocker = null;
            _activeContent = null;
            
            // Create the TabControl used for viewing the Content windows
            _tabControl = new SharpClient.UI.Controls.TabControl();

            // It should always occupy the remaining space after all details
            _tabControl.Dock = DockStyle.Fill;

            // Show tabs only if two or more tab pages exist
            _tabControl.HideTabsMode = SharpClient.UI.Controls.TabControl.HideTabsModes.HideUsingLogic;
            
            // Hook into the TabControl notifications
            _tabControl.GotFocus += new EventHandler(OnTabControlGotFocus);
            _tabControl.LostFocus += new EventHandler(OnTabControlLostFocus);
            _tabControl.PageGotFocus += new EventHandler(OnTabControlGotFocus);
            _tabControl.PageLostFocus += new EventHandler(OnTabControlLostFocus);
            _tabControl.SelectionChanged += new EventHandler(OnSelectionChanged);
            _tabControl.PageDragStart += new MouseEventHandler(OnPageDragStart);
            _tabControl.PageDragMove += new MouseEventHandler(OnPageDragMove);
            _tabControl.PageDragEnd += new MouseEventHandler(OnPageDragEnd);
            _tabControl.PageDragQuit += new MouseEventHandler(OnPageDragQuit);
            _tabControl.DoubleClickTab += new SharpClient.UI.Controls.TabControl.DoubleClickTabHandler(OnDoubleClickTab);
			//_tabControl.Font = manager.TabControlFont;
            _tabControl.BackColor = manager.BackColor;
            _tabControl.ForeColor = manager.InactiveTextColor;

            // Define the visual style required
            _tabControl.Style = vs;

			// Allow developers a chance to override default settings
			//manager.OnTabControlCreated(_tabControl);

            switch(vs)
            {
                case VisualStyle.IDE:
                    Controls.Add(_tabControl);
                    break;
                case VisualStyle.Plain:
                    // Only the border at the pages edge and not around the whole control
                    _tabControl.InsetBorderPagesOnly = !_manager.PlainTabBorder;

                    // We want a border around the TabControl so it is indented and looks consistent
                    // with the Plain look and feel, so use the helper Control 'BorderForControl'
                    BorderForControl bfc = new BorderForControl(_tabControl, _plainBorder);

                    // It should always occupy the remaining space after all details
                    bfc.Dock = DockStyle.Fill;

                    // Define the default border border
                    bfc.BackColor = _manager.BackColor;

                    // When in 'VisualStyle.Plain' we need to 
                    Controls.Add(bfc);
                    break;
            }

            // Need to hook into message pump so that the ESCAPE key can be 
            // intercepted when in redocking mode
            Application.AddMessageFilter(this);
        }
		public override void BringContentToFront(Content c)
		{
            // Find the matching Page and select it
            foreach(SharpClient.UI.Controls.TabPage page in _tabControl.TabPages)
                if (page.Tag == c)
                {
                    _tabControl.SelectedTab = page;
                    break;
                }
		}
Example #19
0
		public virtual void BringContentToFront(Content c) {}
Example #20
0
		public RestoreContentFloatingAffinity(Restore child, 
										      State state, 
											  Content content, 
											  StringCollection best,
											  StringCollection associates)
			: base(child, state, content)
		{
			// Remember parameters
			_best = best;
			_associates = associates;
			_size = content.DisplaySize;
			_location = content.DisplayLocation;

			// Remove target from collection of friends
			if (_best.Contains(content.Title))
				_best.Remove(content.Title);

			// Remove target from collection of associates
			if (_associates.Contains(content.Title))
				_associates.Remove(content.Title);
		}
Example #21
0
		public RestoreZoneAffinity(Restore child, 
								   Content content, 
								   StringCollection best,
								   StringCollection next,
								   StringCollection previous)
			: base(child, content)
		{
			// Remember parameters
			_best = best;				
			_next = next;				
			_previous = previous;	
			
			if (content.Visible)			
				_space = content.ParentWindowContent.ZoneArea;
			else
				_space = 50m;
		}
Example #22
0
		public RestoreContent(Restore child, Content content)
			: base(child)
		{
			// Remember parameter
			_title = content.Title;
			_content = content;
		}
		public int SetIndex(int newIndex, Content value)
		{
			base.List.Remove(value);
			base.List.Insert(newIndex, value);

			return newIndex;
		}
 public void Remove(Content value)
 {
     // Use base class to process actual collection operation
     base.List.Remove(value as object);
 }
Example #25
0
        public virtual bool OnContentHiding(Content c)
        {
            CancelEventArgs cea = new CancelEventArgs();

            if (_surpressVisibleEvents == 0)
            {
                // Allow user to prevent hide operation
                if (ContentHiding != null)
                    ContentHiding(c, cea);
            }

            // Was action cancelled?
            return cea.Cancel;
        }
Example #26
0
 public RestoreAutoHideState(State state, Content content)
     : base(state, content)
 {
 }
Example #27
0
		public override void Reconnect(DockingManager dm)
		{
			// Connect to the current instance of required content object
			_content = dm.Contents[_title];

			base.Reconnect(dm);
		}
Example #28
0
 public virtual void OnContentShown(Content c)
 {
     if (_surpressVisibleEvents == 0)
     {
         // Notify operation has completed
         if (ContentShown != null)
             ContentShown(c, EventArgs.Empty);
     }
 }
 public bool Contains(Content value)
 {
     // Use base class to process actual collection operation
     return base.List.Contains(value as object);
 }
Example #30
0
		public RestoreContentState(Restore child, State state, Content content)
			: base(child, content)
		{
			// Remember parameter
			_state = state;
		}