Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [not bug] Cancel selection change
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[not bug] Cancel selection change

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: [not bug] Cancel selection change
    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
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 24 August 2011 at 1:13pm
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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 04 December 2012 at 4:17am
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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 13 April 2017 at 3:13am
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 CryCryCry! 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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2017 at 8:04am
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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2017 at 8:20am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.