[not bug] Cancel selection change |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
Posted: 23 August 2011 at 8:26am |
Hi;
I try to cancel a selection change in XTP_NM_REPORT_SELCHANGING message but can't get it to work. Normally I expect the LRESULT* Result parameter to be set to FALSE to cancel the change of selections, but this does not work. So I moved over to XTP_NM_REPORT_FOCUS_CHANGING, because this message handler provides a XTP_NM_REPORTREQUESTEDIT structure that has a bCancel flag inside. The cancel flag is returned to the calling toolkit function (Apply == not Cancel) but afterwards the focus is still changed. In any case I think it's definitely buggy how the control handles these messages... Nevertheless, has anyone ever succeeded in canceling the change of selection when a special condition is met? |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
ABuenger
Newbie Joined: 02 February 2006 Status: Offline Points: 1075 |
Post Options
Thanks(0)
|
Hello everybody,
the LRESULT value of XTP_NM_REPORT_SELCHANGING will now be evaluated and if unequal 0 the action will be aborted. I've also added a XTP_NM_REPORT_LBUTTONUP notification. uploads/1755/ReportSample_18854.zip Andre |
|
Codejock support
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Hello Andre;
I've just tried to use the new functionality, but it's not usable. The XTP_NM_REPORT_SELCHANGING notificationis received two times. The first time with type "Clear" the second time with type "Add". In the first event I set the cancel flag, so I expect that no more "Add" notification should arrive, due to the fact that I cancel the selection change! When looking at the CJ code, I can see that the Add function is invoked in any case! IMHO "Add" should only be called when "Clear" is not canceled! |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Just tested with 17.3.0 and it's still the same!
There is no straight way to cancel a change in selection and focus. Digging into XT code shows that the cancel information ist not used in further processing. This is definitely a BUG in XT code ! I hope it's going to be fixed soon, because I reported this issue several years ago! |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello Martin,
xtpReportSelectionClear and xtpReportSelectionAdd is different events in single notification XTP_NM_REPORT_SELCHANGING. Also there is xtpReportSelectionRemove. So when you select other row then first called Clear then Add new row to selected rows array. If you cancel Clearing then previous selected row leave in selection, like you select with pressing [Ctrl] key. If you cancel Adding then row will not added to selection. Regards, Oleksandr Lebed |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1198 |
Post Options
Thanks(0)
|
Hello;
I know all those different parts, but it's annoying to have large effort for such a 'small' thing? Especially when in single selection mode... Martin |
|
Martin
Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0 Platform: Windows 10 v 1909 (64bit) Language: VC++ 2017 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |