Exemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Activates the given SideBarButton and perhaps the SideBarTab, if appropriate. This
        /// is called when the View menu item is clicked.
        /// </summary>
        /// <param name="tab">The SideBarTab to make active, if appropriate</param>
        /// <param name="button">The SideBarButton to make active</param>
        /// ------------------------------------------------------------------------------------
        public void ActivateTabAndButton(SideBarTab tab, SideBarButton button)
        {
            CheckDisposed();

            int iTab = Tabs.IndexOf(tab);

            // if we're in ActiveTabIsExclusive mode...
            if (ActiveTabIsExclusive)
            {
                if (m_iActive != iTab)
                {
                    // Collapse the previous tab and expand the new tab.
                    int iActivePrevious = m_iActive;
                    m_iActive = iTab;

                    SuspendLayout();
                    Tabs[iActivePrevious].Collapse();
                    PositionTabs();
                    ResumeLayout(true);
                }
            }

            // Press the specified button in this tab and clear all others.
            // REVIEW: What should this do in multiSelect mode when we
            //  want to preserve the state of all the buttons? We would
            //  want to press only the specified button.
            foreach (SideBarButton btn in Tabs[m_iActive].Buttons)
            {
                btn.PressButton(btn == button);
            }

            button.PerformClick();
        }
Exemplo n.º 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Activates the given SideBarButton and perhaps the SideBarTab, if appropriate. This
		/// is called when the View menu item is clicked.
		/// </summary>
		/// <param name="tab">The SideBarTab to make active, if appropriate</param>
		/// <param name="button">The SideBarButton to make active</param>
		/// ------------------------------------------------------------------------------------
		public void ActivateTabAndButton(SideBarTab tab, SideBarButton button)
		{
			CheckDisposed();

			int iTab = Tabs.IndexOf(tab);

			// if we're in ActiveTabIsExclusive mode...
			if (ActiveTabIsExclusive)
			{
				if (m_iActive != iTab)
				{
					// Collapse the previous tab and expand the new tab.
					int iActivePrevious = m_iActive;
					m_iActive = iTab;

					SuspendLayout();
					Tabs[iActivePrevious].Collapse();
					PositionTabs();
					ResumeLayout(true);
				}

			}

			// Press the specified button in this tab and clear all others.
			// REVIEW: What should this do in multiSelect mode when we
			//  want to preserve the state of all the buttons? We would
			//  want to press only the specified button.
			foreach(SideBarButton btn in Tabs[m_iActive].Buttons)
				btn.PressButton(btn == button);

			button.PerformClick();
		}