Opened 5 years ago

Closed 5 years ago

#11619 closed defect (fixed)

Reset start selection variable when we delete item

Reported by: TNikolay Owned by:
Priority: normal Milestone:
Component: wxMSW Version: stable-latest
Keywords: wxTreeCtrl selection Cc:
Blocked By: Blocking:
Patch: yes

Description

We should reset m_htSelStart when we delete item. Probably patch expand better :)

Attachments (1)

tree-unset-selection-when-delete.patch download (651 bytes) - added by TNikolay 5 years ago.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by TNikolay

comment:1 Changed 5 years ago by neis

  • Patch set

comment:2 Changed 5 years ago by TNikolay

This patch fixes the following problem in wxTreeCtrl with multiple selection:

  1. select a few items
  1. delete the.

m_htSelStart  will be point to the latest selected item, but we already have deleted it. So if user press shift + arrow up at this point - we get incorrect selected range.

comment:3 Changed 5 years ago by vadz

  • Status changed from new to confirmed

Thanks for the patch, it seems correct to me but I think we should also do the same for m_htClickedItem, shouldn't we?

I'll apply the obvious generalization of this patch for both of them soon if there are no objections.

comment:4 Changed 5 years ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [63170]) Invalidate stored wxTreeItemIds when the corresponding item is deleted in wxMSW.

m_htSelStart and m_htClickedItem stored in wxTreeCtrl must be invalidated when
the item they point to is deleted (which also happens when all the items are
deleted), otherwise the selection doesn't behave correctly after doing it.

Closes #11619.

Note: See TracTickets for help on using tickets.