Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/11/10 21:17:43 (14 years ago)
Author:
mkommend
Message:

corrected behavior of CheckedItemCollectionViews (ticket #893)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemCollectionView.cs

    r3764 r3788  
    5858    protected override void OnContentChanged() {
    5959      base.OnContentChanged();
     60      base.itemsListView.Enabled = !this.Locked;
     61    }
     62
     63    protected override void OnLockedChanged() {
     64      base.OnLockedChanged();
     65      base.itemsListView.Enabled = !this.Locked;
    6066    }
    6167
     
    6773
    6874    #region ListView Events
     75    private bool doubleClick;
    6976    protected virtual void itemsListView_ItemCheck(object sender, ItemCheckEventArgs e) {
    70       var checkedItem = (T)itemsListView.Items[e.Index].Tag;
    71       bool check = e.NewValue == CheckState.Checked;
    72       if (Content.ItemChecked(checkedItem) != check) {
    73         Content.SetItemCheckedState(checkedItem, check);
     77      if (doubleClick) {
     78        e.NewValue = e.CurrentValue;
     79        doubleClick = false;
     80      } else {
     81        var checkedItem = (T)itemsListView.Items[e.Index].Tag;
     82        bool check = e.NewValue == CheckState.Checked;
     83        if (Content.ItemChecked(checkedItem) != check) {
     84          Content.SetItemCheckedState(checkedItem, check);
     85        }
    7486      }
     87    }
     88    protected void itemsListView_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) {
     89      if (e.Clicks > 1)
     90        doubleClick = true;
    7591    }
    7692    #endregion
Note: See TracChangeset for help on using the changeset viewer.