I added one of the new CVSListBox (MFC Feature Pack) controls to the project. The list of items in the control is being tracked by some other objects in my application, so I need to make a lot of notifications from the list when something changes so that I can update other things. For those who do not know the control, there is a button bar that offers the basic functions of adding / deleting / changing the order.
The CVSListBox control offers redefinable virtual functions for things such as adding or renaming elements and changing their order - all this works well.
However, to remove items, the only override is OnBeforeRemoveItem, which is called BEFORE the item is missing, and from which TRUE / FALSE must be returned to allow deletion. After deletion, there is no special notice.
What is the best way to get a notification AFTER removal?
Obviously, something terrible can be hacked here, because after the deletion there will be an event with a modified selection, and one could hold the flag from before-remove to say that the next selected-modified is special, But I feel like I donβt missing something cleaner and more obvious. Any suggestions?
source
share