Exemplo n.º 1
0
            // 创建新标签 地址  索引 是否锁定  是否选中
            public bool CreateTab(Address address, int index, bool fLocked, bool fSelect)
            {
                using (IDLWrapper wrapper = new IDLWrapper(address)) {
                    address.ITEMIDLIST = wrapper.IDL;
                    address.Path       = wrapper.Path;
                }
                if ((address.ITEMIDLIST == null) || (address.ITEMIDLIST.Length <= 0))
                {
                    return(false);
                }
                QTabItem tab = new QTabItem(QTUtility2.MakePathDisplayText(address.Path, false), address.Path, tabBar.tabControl1);

                tab.NavigatedTo(address.Path, address.ITEMIDLIST, -1, false);
                tab.ToolTipText = QTUtility2.MakePathDisplayText(address.Path, true);
                tab.TabLocked   = fLocked;
                if (index < 0)
                {
                    tabBar.AddInsertTab(tab);
                }
                else
                {
                    if (index > tabBar.tabControl1.TabCount)
                    {
                        index = tabBar.tabControl1.TabCount;
                    }
                    tabBar.tabControl1.TabPages.Insert(index, tab);
                }
                if (fSelect)
                {
                    tabBar.tabControl1.SelectTab(tab);
                }
                return(true);
            }
Exemplo n.º 2
0
 public CreateNewGroupForm(string currentPath, QTabControl.QTabCollection tabs)
 {
     newPath = currentPath;
     Tabs    = tabs;
     InitializeComponent();
     textBox1.Text = QTUtility2.MakePathDisplayText(newPath, false);
     string[] strArray = QTUtility.TextResourcesDic["TabBar_NewGroup"];
     Text            = strArray[0];
     label1.Text     = strArray[1];
     chkAllTabs.Text = strArray[2];
     ActiveControl   = textBox1;
 }
Exemplo n.º 3
0
 public CreateNewGroupForm(string currentPath, QTabControl.QTabCollection tabs)
 {
     this.newPath = currentPath;
     this.Tabs    = tabs;
     this.InitializeComponent();
     this.textBox1.Text = QTUtility2.MakePathDisplayText(this.newPath, false);
     string[] strArray = QTUtility.TextResourcesDic["TabBar_NewGroup"];
     this.Text           = strArray[0];
     this.label1.Text    = strArray[1];
     this.checkBox1.Text = strArray[2];
     base.ActiveControl  = this.textBox1;
 }
Exemplo n.º 4
0
        public static QMenuItem CreateMenuItem(MenuItemArguments mia)
        {
            QMenuItem item = new QMenuItem(QTUtility2.MakePathDisplayText(mia.Path, false), mia);

            if (((mia.Genre == MenuGenre.Navigation) && mia.IsBack) && (mia.Index == 0))
            {
                item.ImageKey = "current";
            }
            else
            {
                item.SetImageReservationKey(mia.Path, null);
            }
            item.ToolTipText = QTUtility2.MakePathDisplayText(mia.Path, true);
            return(item);
        }
Exemplo n.º 5
0
 private void UpdateContextMenu()
 {
     contextMenuNotifyIcon.Hide();
     contextMenuNotifyIcon.SuspendLayout();
     contextMenuNotifyIcon.Items.Clear();
     foreach (var inst in dicNotifyIcon.Values)
     {
         StringBuilder lpString = new StringBuilder(260);
         PInvoke.GetWindowText(inst.ExplorerHandle, lpString, lpString.Capacity);
         ToolStripMenuItem item = new ToolStripMenuItem(lpString.ToString());
         item.Tag = inst.TabBarHandle;
         if (inst.CurrentPath.Length > 0)
         {
             item.ToolTipText = QTUtility2.MakePathDisplayText(inst.CurrentPath, true);
             item.ImageKey    = QTUtility.GetImageKey(inst.CurrentPath, null);
         }
         int j = Math.Min(inst.TabNames.Length, inst.TabPaths.Length);
         if (j > 1)
         {
             for (int i = 0; i < j; i++)
             {
                 item.DropDownItems.Add(new ToolStripMenuItem(inst.TabNames[i])
                 {
                     Tag         = inst.TabBarHandle,
                     ToolTipText = QTUtility2.MakePathDisplayText(inst.TabPaths[i], true),
                     ImageKey    = QTUtility.GetImageKey(inst.TabPaths[i], null)
                 });
             }
             if (item.DropDownItems.Count > 0)
             {
                 item.DropDownItemClicked += contextMenuNotifyIcon_SubItems_DropDownItemClicked;
                 item.DropDown.ImageList   = QTUtility.ImageListGlobal;
             }
         }
         contextMenuNotifyIcon.Items.Add(item);
     }
     contextMenuNotifyIcon.Items.Add(new ToolStripSeparator());
     contextMenuNotifyIcon.Items.Add(new ToolStripMenuItem("Restore all")
     {
         Tag = 0
     });
     contextMenuNotifyIcon.Items.Add(new ToolStripMenuItem("Close all")
     {
         Tag = 1
     });
     contextMenuNotifyIcon.ResumeLayout();
 }