Exemplo n.º 1
0
        private void CreateStackTab(StackTabPage page)
        {
            StackTab stackTab = new StackTab(page, DockStyle.Top);

            if (_component.StackStyle == StackStyle.ShowMultiple)
            {
                stackTab.TitleBar.ActAsButton = ActAsButton.JustArrow;
                stackTab.TitleBar.ArrowButton = ArrowButton.DownArrow;
            }
            else
            {
                stackTab.TitleBar.ActAsButton = ActAsButton.WholeControl;
                stackTab.TitleBar.ArrowButton = ArrowButton.None;
            }

            stackTab.ButtonClicked      += OnTabButtonClick;
            stackTab.TitleClicked       += OnTabTitleClicked;
            stackTab.TitleDoubleClicked += OnTabTitleDoubleClicked;

            TabGroupLeaf tgl = _stackTabControl.RootSequence.AddNewLeaf();

            tgl.MinimumSize = stackTab.MinimumRequestedSize;

            // Prevent user from resizing
            tgl.ResizeBarLock = _component.StackStyle == StackStyle.ShowMultiple ? false : true;

            Crownwood.DotNetMagic.Controls.TabPage tabPageUI = new Crownwood.DotNetMagic.Controls.TabPage(page.Name, stackTab);
            tabPageUI.Tag = page;
            tgl.TabPages.Add(tabPageUI);

            RecalculateTabSizes();
        }
Exemplo n.º 2
0
        private void OpenLeaf(TabGroupLeaf tgl, decimal space)
        {
            if (tgl == null)
            {
                return;
            }

            // Only open the leaf visually, it does not set a leaf active
            Crownwood.DotNetMagic.Controls.TabPage tabPageUI = tgl.TabPages[0];
            StackTabPage page     = (StackTabPage)tabPageUI.Tag;
            StackTab     stackTab = (StackTab)tabPageUI.Control;

            if (page.Component.IsStarted == false)
            {
                page.Component.Start();
            }

            if (stackTab.ApplicationComponentControl == null)
            {
                stackTab.ApplicationComponentControl      = (Control)_component.GetPageView(page).GuiElement;
                stackTab.ApplicationComponentControl.Dock = DockStyle.Fill;
            }

            SetArrowState(stackTab.TitleBar, true);

            tgl.Space = space;
        }
Exemplo n.º 3
0
        private void HighlightLeaf(TabGroupLeaf tgl, bool highlight)
        {
            Crownwood.DotNetMagic.Controls.TabPage tabPageUI = tgl.TabPages[0];
            StackTab stackTab = (StackTab)tabPageUI.Control;

            if (highlight)
            {
                stackTab.TitleBar.Style     = _activeStyle;
                _stackTabControl.ActiveLeaf = tgl;

                stackTab.Select();
                stackTab.Focus();
            }
            else
            {
                stackTab.TitleBar.Style = _inactiveStyle;
            }
        }
		private void CreateStackTab(StackTabPage page)
		{
			StackTab stackTab = new StackTab(page, DockStyle.Top);

			if (_component.StackStyle == StackStyle.ShowMultiple)
			{
				stackTab.TitleBar.ActAsButton = ActAsButton.JustArrow;
				stackTab.TitleBar.ArrowButton = ArrowButton.DownArrow;
			}
			else
			{
				stackTab.TitleBar.ActAsButton = ActAsButton.WholeControl;
				stackTab.TitleBar.ArrowButton = ArrowButton.None;
			}

			stackTab.ButtonClicked += OnTabButtonClick;
			stackTab.TitleClicked += OnTabTitleClicked;
			stackTab.TitleDoubleClicked += OnTabTitleDoubleClicked;

			TabGroupLeaf tgl = _stackTabControl.RootSequence.AddNewLeaf();
			tgl.MinimumSize = stackTab.MinimumRequestedSize;

			// Prevent user from resizing
			tgl.ResizeBarLock = _component.StackStyle == StackStyle.ShowMultiple ? false : true;

			Crownwood.DotNetMagic.Controls.TabPage tabPageUI = new Crownwood.DotNetMagic.Controls.TabPage(page.Name, stackTab);
			tabPageUI.Tag = page;
			tgl.TabPages.Add(tabPageUI);

			RecalculateTabSizes();
		}