Encapsulates a single item within a SimpleExplorerBar control.
Наследование: System.Windows.Forms.Panel
Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds an ExplorerBarItem with the specified text and hosting the specified control.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public ExplorerBarItem Add(string text, Control control)
        {
            ExplorerBarItem item = new ExplorerBarItem(text, control);

            Add(item);
            return(item);
        }
Пример #2
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Removes the specified item from the collection of items.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public void Remove(ExplorerBarItem item)
 {
     if (item != null && m_items.Contains(item))
     {
         Controls.Remove(item);
         m_items.Remove(item);
         item.Collapsed   -= HandleItemExpandingOrCollapsing;
         item.Expanded    -= HandleItemExpandingOrCollapsing;
         item.SizeChanged -= item_SizeChanged;
         ManageVScrollBar();
     }
 }
Пример #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds the specified item to the item collection.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void Add(ExplorerBarItem item)
        {
            item.Dock      = DockStyle.Top;
            item.BackColor = BackColor;
            m_items.Add(item);
            Controls.Add(item);
            item.BringToFront();

            item.Collapsed   += HandleItemExpandingOrCollapsing;
            item.Expanded    += HandleItemExpandingOrCollapsing;
            item.SizeChanged += item_SizeChanged;
            ManageVScrollBar();
        }
Пример #4
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handles an item expanding or collapsing.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        void HandleItemExpandingOrCollapsing(object sender, EventArgs e)
        {
            ExplorerBarItem item = sender as ExplorerBarItem;

            if (item == null)
            {
                return;
            }

            ScrollControlIntoView(item);
            ManageVScrollBar();

            if (item.IsExpanded && ItemExpanded != null)
            {
                ItemExpanded(this, item);
            }
            else if (!item.IsExpanded && ItemCollapsed != null)
            {
                ItemCollapsed(this, item);
            }
        }
Пример #5
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds the specified item to the item collection.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void Add(ExplorerBarItem item)
		{
			item.Dock = DockStyle.Top;
			item.BackColor = BackColor;
			m_items.Add(item);
			Controls.Add(item);
			item.BringToFront();

			item.Collapsed += HandleItemExpandingOrCollapsing;
			item.Expanded += HandleItemExpandingOrCollapsing;
			item.SizeChanged += item_SizeChanged;
			ManageVScrollBar();
		}
Пример #6
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds an ExplorerBarItem with the specified text and hosting the specified control.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public ExplorerBarItem Add(string text, Control control)
		{
			ExplorerBarItem item = new ExplorerBarItem(text, control);
			Add(item);
			return item;
		}
Пример #7
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Removes the specified item from the collection of items.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void Remove(ExplorerBarItem item)
		{
			if (item != null && m_items.Contains(item))
			{
				Controls.Remove(item);
				m_items.Remove(item);
				item.Collapsed -= HandleItemExpandingOrCollapsing;
				item.Expanded -= HandleItemExpandingOrCollapsing;
				item.SizeChanged -= item_SizeChanged;
				ManageVScrollBar();
			}
		}
Пример #8
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Handles one of the character grids in the explorer bar expanding or collapsing.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void HandleCharGridCharExplorerItemStateChanged(SimpleExplorerBar expBar,
			ExplorerBarItem item)
		{
			btnRemoveChar.Enabled = !string.IsNullOrEmpty(m_validCharsGridMngr.CurrentCharacter);
		}