CXTCheckListBox check multi-select behavior |
Post Reply |
Author | |
franji1
Groupie Joined: 28 June 2005 Status: Offline Points: 70 |
Post Options
Thanks(0)
Posted: 07 November 2014 at 10:58am |
My CXTCheckListBox Selection style is set to "Extended" in my dialog's resource. This means I can Ctrl+Click and Shift+Click and get multi-selected items in my list box.
When I have multiple selections, when I click on one of the checkboxes, what happens is that the selection goes away and toggles the selected state of the item associated with the checkbox. In the base MFC CCheckListBox implementation, when I do this, it maintains the selection and it checks/unchecks the entire selection. This is the behavior I desire. Is there a way to configure the CXTCheckListBox to behave like the base CCheckListBox? I am using XTP Extreme Toolkit Pro 13.2. Thanks for reading! P.S. The Samples\Controls\CheckListBox sample for CXTCheckListBox is not as good at highlighting its feature set like the other Controls examples (most are EXCELLENT to demonstrating programmatic behaviors). |
|
franji1
Groupie Joined: 28 June 2005 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
I dug deeper into the XTP code, and there is a method SetSelectionCheck, which is called ONE place, in CXTCheckListBox::OnKeyDown when you hit the space bar.
So, when I multi-select and hit the SPACE BAR, it checks/unchecks the entire selection (and does not change the multi-selection state). This is the desired behavior I want when I click on a check box. I looked at the OnLButtonDown and it does not care about multi-selection at all (and hence never calls SetSelectionCheck). So, I think I just have to override (technically catch the notification) OnLButtonDown and tweak it to the SPACE BAR behavior when there are multiple selections, because I don't see any "settings" that would cause it to behave like the SPACE BAR event. |
|
franji1
Groupie Joined: 28 June 2005 Status: Offline Points: 70 |
Post Options
Thanks(0)
|
Implemented my own OnLButtonDown() method that merges the VK_SPACE handling of the check box with the CXTCheckListBox::OnLButtonDown. Works great.
HOWEVER, double clicking on a check box (or more specifically checking/unchecking relatively quickly) causes CXTCheckListBox::OnLButtonDblClk to misbehave like CXTCheckListBox::OnLButtonDown. So I will need to "override" that message's behavior. |
|
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 |