Exemplo n.º 1
0
 protected override void OnMouseHover(EventArgs e)
 {
     if (!string.IsNullOrEmpty(ToolTipText))
     {
         DropDownMenuBase parent = Parent as DropDownMenuBase;
         if ((parent != null) && parent.UpdateToolTip_OnTheEdge(this))
         {
             return;
         }
     }
     base.OnMouseHover(e);
 }
Exemplo n.º 2
0
 public static void UpdateConfig(bool fBroadcast = true)
 {
     QTUtility.TextResourcesDic = Config.Lang.UseLangFile && File.Exists(Config.Lang.LangFile)
             ? QTUtility.ReadLanguageFile(Config.Lang.LangFile)
             : null;
     QTUtility.ValidateTextResources();
     StaticReg.ClosedTabHistoryList.MaxCapacity = Config.Misc.TabHistoryCount;
     StaticReg.ExecutedPathsList.MaxCapacity    = Config.Misc.FileHistoryCount;
     DropDownMenuBase.InitializeMenuRenderer();
     ContextMenuStripEx.InitializeMenuRenderer();
     PluginManager.RefreshPlugins();
     InstanceManager.LocalTabBroadcast(tabbar => tabbar.RefreshOptions());
     if (fBroadcast)
     {
         // SyncTaskBarMenu(); todo
         InstanceManager.StaticBroadcast(() => {
             ReadConfig();
             UpdateConfig(false);
         });
     }
 }
Exemplo n.º 3
0
        private void CreateItems(bool fRefresh) {
            ManageImageList(fRefresh);
            toolStrip.SuspendLayout();
            if(iSearchResultCount != -1) {
                Explorer.Refresh();
            }
            RefreshSearchBox(false);
            if(searchBox != null) {
                searchBox.Dispose();
                timerSerachBox_Search.Dispose();
                timerSearchBox_Rearrange.Dispose();
                searchBox = null;
                timerSerachBox_Search = null;
                timerSearchBox_Rearrange = null;
            }
            ClearToolStripItems();
            toolStrip.ShowItemToolTips = QTUtility.CheckConfig(Settings.ShowTooltips);
            Height = LargeButton ? 0x22 : 0x1a;
            bool flag = (ConfigValues[0] & 0x20) == 0x20;
            bool flag2 = (ConfigValues[0] & 0x10) == 0x10;
            UnloadPluginsOnCreation();
            foreach(int num in ButtonIndexes) {
                ToolStripItem item;
                switch(num) {
                    case 0: {
                            ToolStripSeparator separator = new ToolStripSeparator();
                            separator.Tag = 0;
                            toolStrip.Items.Add(separator);
                            goto Label_050D;
                        }
                    case 3:
                    case 4:
                    case 5:
                        item = CreateDropDownButton(num);
                        break;

                    case 9: {
                            item = new ToolStripDropDownButton();
                            string[] strArray = QTUtility.TextResourcesDic["ButtonBar_Misc"];
                            DropDownMenuBase base2 = new DropDownMenuBase(components);
                            base2.ShowCheckMargin = QTUtility.CheckConfig(Settings.NonDefaultMenu) && !QTUtility.CheckConfig(Settings.XPStyleMenus);
                            base2.ShowImageMargin = false;
                            base2.Items.AddRange(new ToolStripItem[] { new ToolStripMenuItem(strArray[0]), new ToolStripMenuItem(strArray[1]), new ToolStripMenuItem(strArray[2]), new ToolStripMenuItem(strArray[3]), new ToolStripMenuItem(strArray[4]), new ToolStripMenuItem(strArray[6]) });
                            base2.ItemClicked += copyButton_DropDownItemClicked;
                            base2.Opening += copyButton_Opening;
                            ((ToolStripDropDownButton)item).DropDown = base2;
                            break;
                        }
                    case 10:
                        item = new ToolStripButton();
                        ((ToolStripButton)item).CheckOnClick = true;
                        break;

                    case 0x13: {
                            ToolStripTrackBar bar = new ToolStripTrackBar();
                            bar.Tag = num;
                            bar.ToolTipText = ButtonItemsDisplayName[0x13];
                            bar.ValueChanged += trackBar_ValueChanged;
                            toolStrip.Items.Add(bar);
                            goto Label_050D;
                        }
                    case 20:
                        searchBox = new ToolStripSearchBox(LargeButton, (ConfigValues[0] & 8) != 0, ButtonItemsDisplayName[0x12], SearchBoxWidth);
                        searchBox.ToolTipText = ButtonItemsDisplayName[20];
                        searchBox.Tag = num;
                        searchBox.ErasingText += searchBox_ErasingText;
                        searchBox.ResizeComplete += searchBox_ResizeComplete;
                        searchBox.TextChanged += searchBox_TextChanged;
                        searchBox.KeyPress += searchBox_KeyPress;
                        searchBox.GotFocus += searchBox_GotFocus;
                        toolStrip.Items.Add(searchBox);
                        timerSerachBox_Search = new Timer(components);
                        timerSerachBox_Search.Interval = 250;
                        timerSerachBox_Search.Tick += timerSerachBox_Search_Tick;
                        timerSearchBox_Rearrange = new Timer(components);
                        timerSearchBox_Rearrange.Interval = 300;
                        timerSearchBox_Rearrange.Tick += timerSearchBox_Rearrange_Tick;
                        goto Label_050D;

                    case 0x10000:
                        CreatePluginItem();
                        goto Label_050D;

                    default:
                        if(num >= 0x15) {
                            goto Label_050D;
                        }
                        item = new ToolStripButton();
                        break;
                }
                if(flag) {
                    if(flag2) {
                        if(Array.IndexOf(selectiveLablesIndices, num) != -1) {
                            item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
                        }
                        else {
                            item.DisplayStyle = ToolStripItemDisplayStyle.Image;
                        }
                    }
                    else {
                        item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
                    }
                }
                else {
                    item.DisplayStyle = ToolStripItemDisplayStyle.Image;
                }
                item.ImageScaling = ToolStripItemImageScaling.None;
                item.Text = item.ToolTipText = ButtonItemsDisplayName[num];
                item.Image = (LargeButton ? imageStrip_Large[num - 1] : imageStrip_Small[num - 1]).Clone(new Rectangle(Point.Empty, LargeButton ? sizeLargeButton : sizeSmallButton), PixelFormat.Format32bppArgb);
                item.Tag = num;
                toolStrip.Items.Add(item);
                if(((num == 1) && (Array.IndexOf(ButtonIndexes, 2) == -1)) || (num == 2)) {
                    toolStrip.Items.Add(CreateDropDownButton(-1));
                }
            Label_050D: ;
            }
            if(ButtonIndexes.Length == 0) {
                ToolStripSeparator separator2 = new ToolStripSeparator();
                separator2.Tag = 0;
                toolStrip.Items.Add(separator2);
            }
            toolStrip.ResumeLayout();
            toolStrip.RaiseOnResize();
            iPluginCreatingIndex = 0;
            if(pluginManager != null) {
                pluginManager.ClearBackgroundMultipleOrders();
            }
        }
Exemplo n.º 4
0
        private ToolStripDropDownButton CreateDropDownButton(int index) {
            ToolStripDropDownButton button = new ToolStripDropDownButton();
            switch(index) {
                case -1:
                    if(NavDropDown == null) {
                        NavDropDown = new DropDownMenuBase(components, true, true, true);
                        NavDropDown.ImageList = QTUtility.ImageListGlobal;
                        NavDropDown.ItemClicked += dropDownButtons_DropDown_ItemClicked;
                        NavDropDown.Closed += dropDownButtons_DropDown_Closed;
                    }
                    button.DropDown = NavDropDown;
                    button.Tag = -1;
                    button.AutoToolTip = false;
                    break;

                case 3:
                    if(ddmrGroupButton == null) {
                        ddmrGroupButton = new DropDownMenuReorderable(components, true, false);
                        ddmrGroupButton.ImageList = QTUtility.ImageListGlobal;
                        ddmrGroupButton.ReorderEnabled = !LockDropDownItems;
                        ddmrGroupButton.ItemRightClicked += MenuUtility.GroupMenu_ItemRightClicked;
                        ddmrGroupButton.ItemMiddleClicked += ddmrGroupButton_ItemMiddleClicked;
                        ddmrGroupButton.ReorderFinished += dropDownButtons_DropDown_ReorderFinished;
                        ddmrGroupButton.ItemClicked += dropDownButtons_DropDown_ItemClicked;
                        ddmrGroupButton.Closed += dropDownButtons_DropDown_Closed;
                    }
                    button.DropDown = ddmrGroupButton;
                    button.Enabled = QTUtility.GroupPathsDic.Count > 0;
                    break;

                case 4:
                    if(ddmrRecentlyClosed == null) {
                        ddmrRecentlyClosed = new DropDownMenuReorderable(components, true, false);
                        ddmrRecentlyClosed.ImageList = QTUtility.ImageListGlobal;
                        ddmrRecentlyClosed.ReorderEnabled = false;
                        ddmrRecentlyClosed.MessageParent = Handle;
                        ddmrRecentlyClosed.ItemRightClicked += ddmr45_ItemRightClicked;
                        ddmrRecentlyClosed.ItemClicked += dropDownButtons_DropDown_ItemClicked;
                        ddmrRecentlyClosed.Closed += dropDownButtons_DropDown_Closed;
                    }
                    button.DropDown = ddmrRecentlyClosed;
                    button.Enabled = QTUtility.ClosedTabHistoryList.Count > 0;
                    break;

                case 5:
                    if(ddmrUserAppButton == null) {
                        ddmrUserAppButton = new DropDownMenuReorderable(components);
                        ddmrUserAppButton.ImageList = QTUtility.ImageListGlobal;
                        ddmrUserAppButton.ReorderEnabled = !LockDropDownItems;
                        ddmrUserAppButton.MessageParent = Handle;
                        ddmrUserAppButton.ItemRightClicked += ddmr45_ItemRightClicked;
                        ddmrUserAppButton.ReorderFinished += dropDownButtons_DropDown_ReorderFinished;
                        ddmrUserAppButton.ItemClicked += dropDownButtons_DropDown_ItemClicked;
                        ddmrUserAppButton.Closed += dropDownButtons_DropDown_Closed;
                    }
                    button.DropDown = ddmrUserAppButton;
                    button.Enabled = QTUtility.UserAppsDic.Count > 0;
                    break;
            }
            button.DropDownOpening += dropDownButtons_DropDownOpening;
            return button;
        }
Exemplo n.º 5
0
        protected override void WndProc(ref Message m)
        {
            try {
                QMenuItem ownerItem;
                if (!fRespondModKeys)
                {
                    base.WndProc(ref m);
                    return;
                }
                int wParam = (int)((long)m.WParam);
                switch (m.Msg)
                {
                case WM.KEYDOWN:
                    break;

                case WM.KEYUP:
                    if (fOnceKeyDown && ((wParam == 0x10) || (wParam == 0x11)))
                    {
                        bool flag2 = false;
                        foreach (QMenuItem item4 in lstQMIResponds.Where(item4 => item4.Selected))
                        {
                            if (item4.Enabled)
                            {
                                Keys modifierKeys = ModifierKeys;
                                if (modifierKeys == Keys.Control)
                                {
                                    item4.ImageKey = "control";
                                }
                                else if (fEnableShiftKey && (modifierKeys == Keys.Shift))
                                {
                                    item4.ImageKey = "shift";
                                }
                                else
                                {
                                    item4.RestoreOriginalImage(fChangeImageSelected, false);
                                }
                                lastKeyImageChangedItem = item4;
                            }
                            flag2 = true;
                            break;
                        }
                        ownerItem = OwnerItem as QMenuItem;
                        if (ownerItem != null)
                        {
                            DropDownMenuBase owner = ownerItem.Owner as DropDownMenuBase;
                            if ((owner != null) && owner.Visible)
                            {
                                if (flag2)
                                {
                                    PInvoke.SendMessage(owner.Handle, 0x2a3, IntPtr.Zero, IntPtr.Zero);
                                }
                                else
                                {
                                    QTUtility2.SendCOPYDATASTRUCT(owner.Handle, (IntPtr)wParam, string.Empty, (IntPtr)1);
                                }
                            }
                        }
                    }
                    goto Label_07C2;

                case WM.MOUSEMOVE:
                    goto Label_0562;

                case WM.MOUSELEAVE:
                    goto Label_072E;

                case WM.PAINT:
                    if (fSuspendPainting)
                    {
                        PInvoke.ValidateRect(m.HWnd, IntPtr.Zero);
                    }
                    else
                    {
                        base.WndProc(ref m);
                    }
                    return;

                case WM.COPYDATA: {
                    COPYDATASTRUCT copydatastruct = (COPYDATASTRUCT)Marshal.PtrToStructure(m.LParam, typeof(COPYDATASTRUCT));
                    ownerItem = GetItemAt(PointToClient(MousePosition)) as QMenuItem;
                    if (!(copydatastruct.dwData == IntPtr.Zero))
                    {
                        goto Label_04B6;
                    }
                    if (ownerItem == null)
                    {
                        goto Label_0462;
                    }
                    Keys keys3 = ModifierKeys;
                    if ((wParam == 0x11) && ((keys3 & Keys.Shift) != Keys.Shift))
                    {
                        ownerItem.ImageKey = "control";
                    }
                    else if ((fEnableShiftKey && (wParam == 0x10)) && ((keys3 & Keys.Control) != Keys.Control))
                    {
                        ownerItem.ImageKey = "shift";
                    }
                    else
                    {
                        ownerItem.RestoreOriginalImage(fChangeImageSelected, false);
                    }
                    lastKeyImageChangedItem = ownerItem;
                    goto Label_07C2;
                }

                default:
                    goto Label_07C2;
                }
                fOnceKeyDown = true;
                if ((((int)((long)m.LParam)) & 0x40000000) == 0)
                {
                    if ((wParam == 0x10) || (wParam == 0x11))
                    {
                        bool flag = false;
                        foreach (QMenuItem item2 in lstQMIResponds.Where(item2 => item2.Selected))
                        {
                            if (item2.Enabled)
                            {
                                Keys keys = ModifierKeys;
                                if ((wParam == 0x11) && ((keys & Keys.Shift) != Keys.Shift))
                                {
                                    item2.ImageKey = "control";
                                }
                                else if ((fEnableShiftKey && (wParam == 0x10)) && ((keys & Keys.Control) != Keys.Control))
                                {
                                    item2.ImageKey = "shift";
                                }
                                else
                                {
                                    item2.RestoreOriginalImage(fChangeImageSelected, false);
                                }
                                lastKeyImageChangedItem = item2;
                            }
                            flag = true;
                            break;
                        }
                        ownerItem = OwnerItem as QMenuItem;
                        if (ownerItem != null)
                        {
                            DropDownMenuBase base2 = ownerItem.Owner as DropDownMenuBase;
                            if ((base2 != null) && base2.Visible)
                            {
                                if (flag)
                                {
                                    PInvoke.SendMessage(base2.Handle, 0x2a3, IntPtr.Zero, IntPtr.Zero);
                                }
                                else
                                {
                                    QTUtility2.SendCOPYDATASTRUCT(base2.Handle, (IntPtr)wParam, string.Empty, IntPtr.Zero);
                                }
                            }
                        }
                    }
                    else if ((wParam == 13) && ((fEnableShiftKey && (ModifierKeys == Keys.Shift)) || (ModifierKeys == Keys.Control)))
                    {
                        foreach (ToolStripItem item3 in Items)
                        {
                            if (item3.Selected)
                            {
                                if (item3.Enabled)
                                {
                                    OnItemClicked(new ToolStripItemClickedEventArgs(item3));
                                }
                                break;
                            }
                        }
                    }
                }
                goto Label_07C2;
Label_0462:
                ownerItem = OwnerItem as QMenuItem;
                if (ownerItem != null)
                {
                    DropDownMenuBase base4 = ownerItem.Owner as DropDownMenuBase;
                    if ((base4 != null) && base4.Visible)
                    {
                        QTUtility2.SendCOPYDATASTRUCT(base4.Handle, (IntPtr)wParam, string.Empty, IntPtr.Zero);
                    }
                }
                goto Label_07C2;
Label_04B6:
                if (ownerItem != null)
                {
                    Keys keys4 = ModifierKeys;
                    if (keys4 == Keys.Control)
                    {
                        ownerItem.ImageKey = "control";
                    }
                    else if (fEnableShiftKey && (keys4 == Keys.Shift))
                    {
                        ownerItem.ImageKey = "shift";
                    }
                    else
                    {
                        ownerItem.RestoreOriginalImage(fChangeImageSelected, false);
                    }
                    lastKeyImageChangedItem = ownerItem;
                }
                else
                {
                    ownerItem = OwnerItem as QMenuItem;
                    if (ownerItem != null)
                    {
                        DropDownMenuBase base5 = ownerItem.Owner as DropDownMenuBase;
                        if ((base5 != null) && base5.Visible)
                        {
                            QTUtility2.SendCOPYDATASTRUCT(base5.Handle, (IntPtr)wParam, string.Empty, (IntPtr)1);
                        }
                    }
                }
                goto Label_07C2;
Label_0562:
                if ((m.WParam == IntPtr.Zero) && (m.LParam == lparamPreviousMouseMove))
                {
                    m.Result = IntPtr.Zero;
                    return;
                }
                lparamPreviousMouseMove = m.LParam;
                if ((!fEnableShiftKey || ((wParam & 4) != 4)) && (((wParam & 8) != 8) && !fChangeImageSelected))
                {
                    goto Label_07C2;
                }
                ToolStripItem itemAt = GetItemAt(QTUtility2.PointFromLPARAM(m.LParam));
                if (itemAt == null)
                {
                    base.WndProc(ref m);
                    return;
                }
                ownerItem = itemAt as QMenuItem;
                if (!IsQmiResponds(ownerItem))
                {
                    goto Label_06F8;
                }
                if (ownerItem == lastMouseActiveItem)
                {
                    goto Label_07C2;
                }
                if (lstQMIResponds.Count > 0x1c)
                {
                    fSuspendPainting = true;
                }
                SuspendLayout();
                if (ownerItem.Enabled)
                {
                    switch (wParam)
                    {
                    case 8:
                        ownerItem.ImageKey = "control";
                        goto Label_06AB;

                    case 4:
                        ownerItem.ImageKey = "shift";
                        goto Label_06AB;
                    }
                    if (((ownerItem.Genre == MenuGenre.Navigation) && (ownerItem.MenuItemArguments != null)) && (!ownerItem.MenuItemArguments.IsBack || (ownerItem.MenuItemArguments.Index != 0)))
                    {
                        ownerItem.ImageKey = ownerItem.MenuItemArguments.IsBack ? "back" : "forward";
                    }
                    else
                    {
                        ownerItem.RestoreOriginalImage();
                    }
                }
Label_06AB:
                if (lastMouseActiveItem != null)
                {
                    lastMouseActiveItem.RestoreOriginalImage();
                }
                if ((ownerItem != lastKeyImageChangedItem) && (lastKeyImageChangedItem != null))
                {
                    lastKeyImageChangedItem.RestoreOriginalImage();
                    lastKeyImageChangedItem = null;
                }
                lastMouseActiveItem = ownerItem;
                fSuspendPainting    = false;
                ResumeLayout(false);
                goto Label_07C2;
Label_06F8:
                if (lastMouseActiveItem != null)
                {
                    lastMouseActiveItem.RestoreOriginalImage();
                    lastMouseActiveItem = null;
                }
                if (lastKeyImageChangedItem != null)
                {
                    lastKeyImageChangedItem.RestoreOriginalImage();
                    lastKeyImageChangedItem = null;
                }
                goto Label_07C2;
Label_072E:
                ResetImageKeys();
                lastMouseActiveItem = null;
            }
            catch (Exception exception) {
                QTUtility2.MakeErrorLog(exception, "MSG:" + m.Msg.ToString("X") + ", WPARAM:" + m.WParam.ToString("X") + ", LPARAM:" + m.LParam.ToString("X"));
            }
Label_07C2:
            base.WndProc(ref m);
            fSuspendPainting = false;
        }
Exemplo n.º 6
0
        internal void CreateItems()
        {
            string[] ButtonItemsDisplayName = QTUtility.TextResourcesDic["ButtonBar_BtnName"];
            ManageImageList();
            toolStrip.SuspendLayout();
            if(iSearchResultCount != -1) {
                Explorer.Refresh();
            }
            RefreshSearchBox(false);
            if(searchBox != null) {
                searchBox.Dispose();
                timerSerachBox_Search.Dispose();
                timerSearchBox_Rearrange.Dispose();
                searchBox = null;
                timerSerachBox_Search = null;
                timerSearchBox_Rearrange = null;
            }
            ClearToolStripItems();
            toolStrip.ShowItemToolTips = true;
            Height = Config.BBar.LargeButtons ? 34 : 26;
            bool showButtonLabels = Config.BBar.ShowButtonLabels;
            UnloadPluginsOnCreation();
            foreach(int index in Config.BBar.ButtonIndexes) {
                ToolStripItem item;
                switch(index) {
                    case BII_SEPARATOR:
                        toolStrip.Items.Add(new ToolStripSeparator {Tag = 0});
                        continue;

                    case BII_GROUP:
                    case BII_RECENTTAB:
                    case BII_APPLICATIONLAUNCHER:
                        item = CreateDropDownButton(index);
                        break;

                    case BII_MISCTOOL:
                        string[] strArray = QTUtility.TextResourcesDic["ButtonBar_Misc"];
                        DropDownMenuBase base2 = new DropDownMenuBase(components) {
                                ShowCheckMargin = !QTUtility.IsXP,
                                ShowImageMargin = false
                        };
                        base2.Items.AddRange(new ToolStripItem[] {
                                new ToolStripMenuItem(strArray[0]),
                                new ToolStripMenuItem(strArray[1]),
                                new ToolStripMenuItem(strArray[2]),
                                new ToolStripMenuItem(strArray[3]),
                                new ToolStripMenuItem(strArray[4]),
                                new ToolStripMenuItem(strArray[6])
                        });
                        base2.ItemClicked += copyButton_DropDownItemClicked;
                        base2.Opening += copyButton_Opening;
                        item = new ToolStripDropDownButton {DropDown = base2};
                        break;

                    case BII_TOPMOST:
                        item = new ToolStripButton {CheckOnClick = true};
                        break;

                    case BII_WINDOWOPACITY:
                        ToolStripTrackBar bar = new ToolStripTrackBar {
                            Tag = index,
                            ToolTipText = ButtonItemsDisplayName[19]
                        };
                        int crKey, dwFlg;
                        byte bAlpha;
                        if(PInvoke.GetLayeredWindowAttributes(ExplorerHandle, out crKey, out bAlpha, out dwFlg)) {
                            bar.SetValueWithoutEvent(bAlpha);
                        }
                        bar.ValueChanged += trackBar_ValueChanged;
                        toolStrip.Items.Add(bar);
                        continue;

                    case BII_FILTERBAR:
                        searchBox = new ToolStripSearchBox(
                                Config.BBar.LargeButtons,
                                Config.BBar.LockSearchBarWidth,
                                ButtonItemsDisplayName[0x12],
                                SearchBoxWidth) {
                            ToolTipText = ButtonItemsDisplayName[20],
                            Tag = index
                        };
                        searchBox.ErasingText += searchBox_ErasingText;
                        searchBox.ResizeComplete += searchBox_ResizeComplete;
                        searchBox.TextChanged += searchBox_TextChanged;
                        searchBox.KeyPress += searchBox_KeyPress;
                        searchBox.GotFocus += searchBox_GotFocus;
                        toolStrip.Items.Add(searchBox);
                        timerSerachBox_Search = new Timer(components) {Interval = 250};
                        timerSerachBox_Search.Tick += timerSerachBox_Search_Tick;
                        timerSearchBox_Rearrange = new Timer(components) {Interval = 300};
                        timerSearchBox_Rearrange.Tick += timerSearchBox_Rearrange_Tick;
                        continue;

                    default:
                        if(index >= INTERNAL_BUTTON_COUNT) {
                            if(index.HiWord() > 0) CreatePluginItem(index);
                            continue;
                        }
                        item = new ToolStripButton();
                        break;
                }
                item.DisplayStyle = showButtonLabels
                        ? ToolStripItemDisplayStyle.ImageAndText
                        : ToolStripItemDisplayStyle.Image;
                item.ImageScaling = ToolStripItemImageScaling.None;
                item.Text = item.ToolTipText = ButtonItemsDisplayName[index];
                item.Image = (Config.BBar.LargeButtons ? imageStrip_Large[index - 1] : imageStrip_Small[index - 1])
                        .Clone(new Rectangle(Point.Empty, Config.BBar.LargeButtons ? sizeLargeButton : sizeSmallButton), PixelFormat.Format32bppArgb);
                item.Tag = index;
                toolStrip.Items.Add(item);
                if((index == BII_NAVIGATION_BACK && Array.IndexOf(Config.BBar.ButtonIndexes, BII_NAVIGATION_FWRD) == -1) || index == BII_NAVIGATION_FWRD) {
                    toolStrip.Items.Add(CreateDropDownButton(BII_NAVIGATION_DROPDOWN));
                }
            }
            if(Config.BBar.ButtonIndexes.Length == 0) {
                toolStrip.Items.Add(new ToolStripSeparator {Tag = 0});
            }

            // todo: check
            QTTabBarClass tabBar = InstanceManager.GetThreadTabBar();
            if(tabBar != null) {
                tabBar.rebarController.RefreshHeight();
            }
            RefreshButtons();

            toolStrip.ResumeLayout();
            toolStrip.RaiseOnResize();
        }