Changeset 8912


Ignore:
Timestamp:
11/14/12 14:53:33 (9 years ago)
Author:
abeham
Message:

#1841:

  • Added a tooltip to the ProblemInstanceProviderView
  • Used tooltip to display a description of the selected instance
  • Made public member consumer private
Location:
trunk/sources/HeuristicLab.Problems.Instances.Views/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderView.Designer.cs

    r7967 r8912  
    4545    /// </summary>
    4646    private void InitializeComponent() {
     47      this.components = new System.ComponentModel.Container();
     48      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    4749      this.SuspendLayout();
     50      //
     51      // toolTip
     52      //
     53      this.toolTip.AutoPopDelay = 30000;
     54      this.toolTip.InitialDelay = 500;
     55      this.toolTip.ReshowDelay = 100;
    4856      //
    4957      // ProblemInstanceProviderView
    5058      //
    51       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    5259      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    5360      this.Name = "ProblemInstanceProviderView";
     
    5966    #endregion
    6067
     68    protected System.Windows.Forms.ToolTip toolTip;
     69
     70
    6171
    6272  }
  • trunk/sources/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceProviderViewGeneric.cs

    r8201 r8912  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Linq;
    2524using System.Windows.Forms;
     
    4039    private IProblemInstanceConsumer<T> GenericConsumer { get { return Consumer as IProblemInstanceConsumer<T>; } }
    4140
    42     public IProblemInstanceConsumer consumer;
     41    private IProblemInstanceConsumer consumer;
    4342    public override IProblemInstanceConsumer Consumer {
    4443      get { return consumer; }
     
    5958      } else {
    6059        instancesComboBox.DisplayMember = "Name";
    61         IEnumerable<IDataDescriptor> dataDescriptors = Content.GetDataDescriptors().ToList();
    62         ShowInstanceLoad(dataDescriptors.Count() > 0);
     60        var dataDescriptors = Content.GetDataDescriptors().ToList();
     61        ShowInstanceLoad(dataDescriptors.Any());
    6362        instancesComboBox.DataSource = dataDescriptors;
    6463        instancesComboBox.SelectedIndex = -1;
     
    8584      if (comboBox.DataSource == null)
    8685        comboBox.Items.Clear();
     86      toolTip.SetToolTip(comboBox, String.Empty);
    8787    }
    8888
     
    9393        try {
    9494          GenericConsumer.Load(instance);
    95         }
    96         catch (Exception ex) {
     95        } catch (Exception ex) {
    9796          ErrorHandling.ShowErrorDialog(String.Format("This problem does not support loading the instance {0}", descriptor.Name), ex);
    9897        }
    99       }
     98        toolTip.SetToolTip(instancesComboBox, descriptor.Description);
     99      } else toolTip.SetToolTip(instancesComboBox, String.Empty);
    100100    }
    101101  }
Note: See TracChangeset for help on using the changeset viewer.