Customize the look of the sidebar.
Inheritance: System.Windows.Forms.ToolStripRenderer
Esempio n. 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary></summary>
        /// <param name="sbContainer">The control that contains the sidebar control.</param>
        /// <param name="ibContainer">The control that contains the information bar.</param>
        /// <param name="mediator">XCore message mediator through which messages are sent
        /// for tab and tab item clicks.</param>
        /// ------------------------------------------------------------------------------------
        public void Initialize(Control sbContainer, Control ibContainer, Mediator mediator)
        {
            if (sbContainer == null)
            {
                return;
            }

            m_sideBarItemAreaRenderer = new SideBarItemAreaRenderer(this);
            m_mediator = mediator;

            // Setup context menu to allow switching between large and small icon mode.
            SetupSideBarsContextMenu();

            SetupInfoBar(ibContainer);

            m_sideBar             = new SplitContainer();
            m_sideBar.Dock        = DockStyle.Fill;
            m_sideBar.Location    = new Point(0, 0);
            m_sideBar.Name        = "SideBar";
            m_sideBar.Orientation = Orientation.Horizontal;
            m_sideBar.FixedPanel  = FixedPanel.Panel2;
            m_sideBar.BorderStyle = BorderStyle.None;

            sbContainer.Controls.Add(m_sideBar);

            // Add toolstrip for category buttons
            ToolStrip sidebarCategoryArea = new ToolStrip();

            sidebarCategoryArea.Dock        = DockStyle.Fill;
            sidebarCategoryArea.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
            sidebarCategoryArea.GripStyle   = ToolStripGripStyle.Hidden;
            sidebarCategoryArea.Location    = new System.Drawing.Point(0, 0);
            sidebarCategoryArea.Name        = "sidebarCategoryArea";
            sidebarCategoryArea.Paint      += ItemAreaPaintDelegate;
            m_sideBar.Panel2.Controls.Add(sidebarCategoryArea);             // Add sub-toolstrip to main toolstrip
            m_categoryStrip = sidebarCategoryArea;

            sbContainer.Resize += this.HandleParentContainerResize;
            UpdateSidebarLayout();
            m_sideBar.SplitterDistance = 1;             // On startup, the category area should be at its max height.
        }
Esempio n. 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary></summary>
		/// <param name="sbContainer">The control that contains the sidebar control.</param>
		/// <param name="ibContainer">The control that contains the information bar.</param>
		/// <param name="mediator">XCore message mediator through which messages are sent
		/// for tab and tab item clicks.</param>
		/// ------------------------------------------------------------------------------------
		public void Initialize(Control sbContainer, Control ibContainer, Mediator mediator)
		{
			if (sbContainer == null)
				return;

			m_sideBarItemAreaRenderer = new SideBarItemAreaRenderer(this);
			m_mediator = mediator;

			// Setup context menu to allow switching between large and small icon mode.
			SetupSideBarsContextMenu();

			SetupInfoBar(ibContainer);

			m_sideBar = new SplitContainer();
			m_sideBar.Dock = DockStyle.Fill;
			m_sideBar.Location = new Point(0,0);
			m_sideBar.Name = "SideBar";
			m_sideBar.Orientation = Orientation.Horizontal;
			m_sideBar.FixedPanel = FixedPanel.Panel2;
			m_sideBar.BorderStyle = BorderStyle.None;

			sbContainer.Controls.Add(m_sideBar);

			// Add toolstrip for category buttons
			ToolStrip sidebarCategoryArea = new ToolStrip();
			sidebarCategoryArea.Dock = DockStyle.Fill;
			sidebarCategoryArea.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
			sidebarCategoryArea.GripStyle = ToolStripGripStyle.Hidden;
			sidebarCategoryArea.Location = new System.Drawing.Point(0, 0);
			sidebarCategoryArea.Name = "sidebarCategoryArea";
			sidebarCategoryArea.Paint += ItemAreaPaintDelegate;
			m_sideBar.Panel2.Controls.Add(sidebarCategoryArea); // Add sub-toolstrip to main toolstrip
			m_categoryStrip = sidebarCategoryArea;

			sbContainer.Resize += this.HandleParentContainerResize;
			UpdateSidebarLayout();
			m_sideBar.SplitterDistance = 1; // On startup, the category area should be at its max height.
		}