Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/15 12:03:52 (10 years ago)
Author:
pfleck
Message:

#2025 Changed tab indices and focus behavior on first show.

Location:
branches/NewItemDialog/HeuristicLab.Optimizer/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.Designer.cs

    r12201 r12202  
    127127      this.expandAllButton.Name = "expandAllButton";
    128128      this.expandAllButton.Size = new System.Drawing.Size(23, 23);
    129       this.expandAllButton.TabIndex = 4;
     129      this.expandAllButton.TabIndex = 1;
    130130      this.expandAllButton.UseVisualStyleBackColor = true;
    131131      this.expandAllButton.Click += new System.EventHandler(this.expandAllButton_Click);
     
    137137      this.collapseAllButton.Name = "collapseAllButton";
    138138      this.collapseAllButton.Size = new System.Drawing.Size(23, 23);
    139       this.collapseAllButton.TabIndex = 5;
     139      this.collapseAllButton.TabIndex = 2;
    140140      this.collapseAllButton.UseVisualStyleBackColor = true;
    141141      this.collapseAllButton.Click += new System.EventHandler(this.collapseAllButton_Click);
     
    148148      this.searchTextBox.Name = "searchTextBox";
    149149      this.searchTextBox.Size = new System.Drawing.Size(514, 20);
    150       this.searchTextBox.TabIndex = 1;
     150      this.searchTextBox.TabIndex = 3;
    151151      this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
    152152      //
     
    164164      this.typesTreeView.ShowNodeToolTips = true;
    165165      this.typesTreeView.Size = new System.Drawing.Size(594, 260);
    166       this.typesTreeView.TabIndex = 2;
     166      this.typesTreeView.TabIndex = 4;
    167167      this.typesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.itemsTreeView_AfterSelect);
    168168      this.typesTreeView.VisibleChanged += new System.EventHandler(this.itemsTreeView_VisibleChanged);
  • branches/NewItemDialog/HeuristicLab.Optimizer/3.3/NewItemDialog.cs

    r12201 r12202  
    3030  internal partial class NewItemDialog : Form {
    3131    private bool isInitialized;
     32    private bool firstShown = true;
    3233
    3334    private List<TreeNode> treeNodes;
     
    5859    }
    5960
    60 
    6161    private void NewItemDialog_Load(object sender, EventArgs e) {
    6262      if (isInitialized) return;
     
    111111      isInitialized = true;
    112112    }
    113 
    114113    private void NewItemDialog_Shown(object sender, EventArgs e) {
    115114      SelectedType = null;
     115      if (firstShown) {
     116        searchTextBox.Focus();
     117        firstShown = false;
     118      }
    116119    }
    117120
     
    230233    }
    231234    private void SetTreeNodeVisibility() {
     235      typesTreeView.ExpandAll();
    232236      TreeNode selectedNode = typesTreeView.SelectedNode;
    233       if (string.IsNullOrEmpty(currentSearchString) && (typesTreeView.Nodes.Count > 1)) {
    234         typesTreeView.CollapseAll();
    235         if (selectedNode != null) typesTreeView.SelectedNode = selectedNode;
    236       } else {
    237         typesTreeView.ExpandAll();
    238       }
    239       if (selectedNode != null) selectedNode.EnsureVisible();
     237      if (selectedNode != null) {
     238        typesTreeView.SelectedNode = selectedNode;
     239        selectedNode.EnsureVisible();
     240      } else if (string.IsNullOrEmpty(currentSearchString) && typesTreeView.Nodes.Count > 1) {
     241        typesTreeView.Nodes[0].EnsureVisible();
     242      }
    240243    }
    241244    #endregion
Note: See TracChangeset for help on using the changeset viewer.