// Image doubleclicked
        private void matcheslist_SelectedItemDoubleClicked(ImageBrowserItem item)
        {
            // Add image index to the list
            if (item != null)
            {
                filters.Items.Add(item.TileIndex.ToString());
            }

            // Run the timer
            filterstimer.Start();
        }
        // Texture doubleclicked
        private void matcheslist_SelectedItemDoubleClicked(ImageBrowserItem item)
        {
            // Add texture name to the list
            if (item != null)
            {
                filters.Items.Add(item.TextureName);
            }

            // Run the timer
            filterstimer.Start();
        }
Esempio n. 3
0
 // Item double clicked
 private void browser_SelectedItemDoubleClicked(ImageBrowserItem item)
 {
     if (item == null)
     {
         return;
     }
     if (selectedset == null)
     {
         throw new NotSupportedException("selectedset required!");
     }
     if (apply.Enabled)
     {
         apply_Click(this, EventArgs.Empty);
     }
 }
Esempio n. 4
0
 // OK clicked
 private void apply_Click(object sender, EventArgs e)
 {
     // Set selected name and close
     if (browser.SelectedItem != null)
     {
         ImageBrowserItem item = browser.SelectedItem as ImageBrowserItem;
         selectedname = item.TextureName;
         DialogResult = DialogResult.OK;
     }
     else
     {
         selectedname = "";
         DialogResult = DialogResult.Cancel;
     }
     this.Close();
 }
        // Item double clicked
        private void browser_SelectedItemDoubleClicked(ImageBrowserItem item)
        {
            if (item == null)
            {
                return;
            }
            switch (item.ItemType)
            {
            case ImageBrowserItemType.IMAGE:
                if (selectedset == null)
                {
                    throw new NotSupportedException("selectedset required!");
                }
                if (apply.Enabled)
                {
                    apply_Click(this, EventArgs.Empty);
                }
                break;

            case ImageBrowserItemType.FOLDER_UP:
                if (selectedset == null)
                {
                    throw new NotSupportedException("selectedset required!");
                }
                if (selectedset.Parent != null)
                {
                    // Select the node
                    tvTextureSets.SelectedNodes.Clear();
                    tvTextureSets.SelectedNodes.Add(selectedset.Parent);
                    selectedset.Parent.EnsureVisible();

                    // Update textures list
                    selectedset = selectedset.Parent;
                }
                else
                {
                    tvTextureSets.SelectedNodes.Clear();
                    selectedset = null;
                }
                FillImagesList();
                break;

            case ImageBrowserItemType.FOLDER:
                // selectedset is null when at root level
                TreeNodeCollection nodes = (selectedset == null ? tvTextureSets.Nodes : selectedset.Nodes);
                foreach (TreeNode child in nodes)
                {
                    TreeNodeData data = (TreeNodeData)child.Tag;
                    if (data.FolderName == item.TextureName)
                    {
                        // Select the node
                        tvTextureSets.SelectedNodes.Clear();
                        tvTextureSets.SelectedNodes.Add(child);
                        child.EnsureVisible();

                        // Update textures list
                        selectedset = child;
                        FillImagesList();
                        break;
                    }
                }
                break;

            default: throw new NotImplementedException("Unsupported ImageBrowserItemType");
            }
        }
 // Selection changed
 private void browser_SelectedItemChanged(ImageBrowserItem item)
 {
     apply.Enabled = (item != null && item.ItemType == ImageBrowserItemType.IMAGE);
 }
Esempio n. 7
0
 // Selection changed
 private void browser_SelectedItemChanged(ImageBrowserItem item)
 {
     apply.Enabled = (item != null);
 }