示例#1
0
        private void _initialTab()
        {
            _knavTab.ToolTips.AllowButtonSpecToolTips = true;
            _knavTab.ToolTips.AllowPageToolTips       = true;
            _knavTab.Paint      += _knavTab_Paint;
            _knavTab.MouseWheel += _knavTab_MouseWheel;

            btnspecRightSplit.Enabled = ButtonEnabled.False;
            btnspecAdd.Click         += BtnspecAdd_Click;
            TabOperator.setTabItemContextMenu(_kctxmenuTabItem);
            _handleTabItemContextMenuClick();
        }
示例#2
0
 private void MainForm_Resize(object sender, EventArgs e)
 {
     TabOperator.adjustTab(_knavTab);
 }
示例#3
0
        private void BtnspecAdd_Click(object sender, EventArgs e)
        {
            KryptonPage page = TabOperator.insert(newModel(), _knavTab);

            _knavTab.SelectedPage = page;
        }
示例#4
0
        private void Cm_Click(object sender, EventArgs e)
        {
            var page = _kctxmenuTabItem.Tag as KryptonPage;

            _kctxmenuTabItem.Tag = null;
            if (page == null)
            {
                return;
            }

            var index = TabOperator.getPageIndex(page, _knavTab);

            if (index == -1)
            {
                return;
            }
            var model = TabOperator.getTabItemModel(page);

            var cm  = sender as KryptonContextMenuItem;
            var tag = cm.Tag + "";

            switch (tag)
            {
            case "reload":

                break;

            case "collection":

                break;

            case "insertBefore":
                TabOperator.insert(newModel(), _knavTab, index);
                break;

            case "insertAfter":
                index = index + 1 >= _knavTab.Pages.Count ? -1 : index + 1;
                TabOperator.insert(newModel(), _knavTab, index);
                break;

            case "close":
                TabOperator.remove(model, _knavTab);
                break;

            case "closeOther":
                TabOperator.removeOther(page.UniqueName, _knavTab);
                break;

            case "closeLeft":
                TabOperator.removeLeft(page.UniqueName, _knavTab);
                break;

            case "closeRight":
                TabOperator.removeRight(page.UniqueName, _knavTab);
                break;

            case "closeAll":
                TabOperator.removeAll(_knavTab);
                break;

            case "exit":
                Application.Exit();
                break;
            }
        }
示例#5
0
 private void _knavTab_Paint(object sender, PaintEventArgs e)
 {
     TabOperator.adjustTab(_knavTab);
 }