public QuickSearchBox() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); this.navigatorVisuals = NavigatorVisuals.getInstance(); // set the height of the listbox this.listBox.Height = (this.maxDropDownItems + 1) * this.listBox.ItemHeight; }
public NavigatorControl() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); //set the image List of the tree to be able to show the icons this.NavigatorTree.ImageList = NavigatorVisuals.getInstance().imageList; //initialisation for background worker resetTreeBackgroundWorker(); //initialise quickSearch BackgroundWorker initQuickSearchBackgroundWorker(); //set quicksearch empty this.setQuickSearchEmpty(); }
public QuickSearchComboBox() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); this.navigatorVisuals = NavigatorVisuals.getInstance(); this.DrawMode = DrawMode.OwnerDrawFixed; this.DrawItem += new DrawItemEventHandler(QuickSearchComboBox_DrawItem); //textBox this.textBox = new TextBox(); this.textBox.Location = this.Location; this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.textBox.Size = new Size(this.Width - 20, this.Height); this.Controls.Add(this.textBox); this.textBox.TextChanged += new System.EventHandler(this.textBoxTextChanged); }
/// <summary> /// adds an elementNode to the tree /// </summary> /// <param name="element">the source element</param> /// <param name="parentNode">the parentNode. If null is passed then the node will be added as root node</param> private TreeNode makeElementNode(UML.Extended.UMLItem element, TreeNode parentNode, TreeNode nodeToReplace = null) { //create new node TreeNode elementNode; if (nodeToReplace != null) { elementNode = nodeToReplace; if (nodeToReplace.Text.StartsWith(EAAddin.ownerMenuPrefix.Replace("&", string.Empty))) { elementNode.Text = EAAddin.ownerMenuPrefix.Replace("&", string.Empty) + NavigatorVisuals.getInstance().getNodeName(element); } //the type name is already ok //remove dummy node this.removeDummyNode(elementNode); } else { elementNode = new TreeNode(NavigatorVisuals.getInstance().getNodeName(element)); } elementNode.Tag = element; int imageIndex = NavigatorVisuals.getInstance().getImageIndex(element); elementNode.ImageIndex = imageIndex; elementNode.SelectedImageIndex = imageIndex; elementNode.ToolTipText = this.getToolTipText(element); //get sub menu option List <string> subMenuOptions = EAAddin.getMenuOptions(element); if (subMenuOptions.Count > 0) { this.removeDummyNode(elementNode); } //add subnodes foreach (string subNodeName in subMenuOptions) { TreeNode subNode = new TreeNode(subNodeName.Replace("&", String.Empty)); int subImageIndex = NavigatorVisuals.getInstance().getFolderImageIndex(subNodeName); subNode.ImageIndex = subImageIndex; subNode.SelectedImageIndex = subImageIndex; subNode.Nodes.Add(new TreeNode(dummyName, NavigatorVisuals.getInstance().getDummyIndex(), NavigatorVisuals.getInstance().getDummyIndex())); elementNode.Nodes.Add(subNode); } if (parentNode != null) { if (nodeToReplace == null) { this.removeDummyNode(parentNode); parentNode.Nodes.Add(elementNode); } } else { // // //remove duplicate // if (this.removeRootNode(element)) // { // //no parentNode, add as new root node before any others // this.NavigatorTree.Nodes.Insert(0,elementNode); // //remove the excess nodes // this.removeExcessNodes(); // //expand the node // elementNode.Expand(); // } // else // { // //first node is already the one we need // elementNode = this.NavigatorTree.Nodes[0]; // } } return(elementNode); }