Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site
Search in forums

SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » No callback on last row deletion
No callback on last row deletion [message #51391] Tue, 19 March 2019 11:08 Go to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
When deleting rows of an ArrayCtrl by calling ar.Remove(ar.GetCursor()), I usually get a callback on ArrayCtrl::WhenAction. However when the last row is deleted and the ArrayCtrl becomes empty, none of these callbacks seems to be called: WhenAction, WhenArrayAction, WhenCursor. I believe this is a bug, and all of these should have been called, as there are changes to the array, and the cursor as well.
Re: No callback on last row deletion [message #51496 is a reply to message #51391] Thu, 04 April 2019 23:19 Go to previous message
mirek is currently offline  mirek
Messages: 11892
Registered: November 2005
Ultimate Member
WhenAction in general is (or should be) only triggered when the action is caused by user interaction.

WhenCursor is deprecated in favor of WhenSel, which should report all changes to cursor or selection.

Anyway, WhenArrayAction is defined to trigger when data of ArrayCtrl are changed by any means. I have tried to fix it in that direction. (Frankly, I have scanned all of my codebase and found only two uses of WhenArrayAction. But you are right that it should work that way).

Now in trunk.

Previous Topic: Please Remove BUG in DataGrid
Next Topic: ArrayCtrl::Paint is called three times
Goto Forum:

Current Time: Thu Jun 20 06:55:52 CEST 2019

Total time taken to generate the page: 0.01197 seconds