Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Control key behaviour in multiple selection
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Control key behaviour in multiple selection

 Post Reply Post Reply
Author
Message
apautrot View Drop Down
Groupie
Groupie
Avatar

Joined: 16 April 2009
Location: France
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote apautrot Quote  Post ReplyReply Direct Link To This Post Topic: Control key behaviour in multiple selection
    Posted: 12 June 2012 at 11:55am
Hi
I'm using the report control of Codejock v15.13
It seems that there is no way to deselect a selected row with the control key.
I can't unselect a row, I can only clear the selection then select individual rows with control key.
I was waiting the control to work like standard list view, and have the behaviour of inverting the selection of the clicked row when the control key was pressed.

Here is my configuration of the report :

_report.GetReportHeader() -> AllowColumnReorder ( TRUE );
_report.SetMultipleSelection ( TRUE );
_report.FocusSubItems ( TRUE );
_report.AllowEdit ( TRUE );
_report.EditOnClick ( TRUE );

I can see the line 3483 in file XTPReportControl.cpp

m_pSelectedRows->Invert(pRow);

..which never invert the selection, because the pRow is never selected when this line is reached.

Could you please tell me if the control key should allow to unselect individual selected rows, or if it is an awaited behavior ?

Thank you.


Win 7 x64
VS 2008
CJ 15.13

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: 12 June 2012 at 7:14pm
Hi,

please update to the latest version.

Andre

Codejock support
Back to Top
apautrot View Drop Down
Groupie
Groupie
Avatar

Joined: 16 April 2009
Location: France
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote apautrot Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2012 at 5:29am
Hi
I have tried the latest version 13.3.1
I can isolate the problem with the sample ReportCustomHeap. Uncommenting the two lines at 119
wndReport.AllowEdit(TRUE);
wndReport.FocusSubItems(TRUE);
to get edition of sub items.
When holding control key, I can add to selection. But holding control + click on an already selected row clears the selection.

I have digged into the code and put a breakpoint in CXTPReportSelectedRows::Clear.
The handling of button click (on up event) in OnClick calls EditItem that calls SetFocusedRow with a default value false for parameter bControlKey, which is leading to clearing the actual selection.

I will try a quick fix until you state on that, can you take a look please ?



Win 7 x64
VS 2008
CJ 15.13

Back to Top
apautrot View Drop Down
Groupie
Groupie
Avatar

Joined: 16 April 2009
Location: France
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote apautrot Quote  Post ReplyReply Direct Link To This Post Posted: 18 June 2012 at 5:44am
I have fixed that by replacing the line 5823 of file XTPReportControl.cpp
SetFocusedRow(pItemArgs->pRow);
with
bool bKeyControl = (::GetKeyState(VK_CONTROL) < 0) || m_bMultiSelectionMode;
  SetFocusedRow(pItemArgs->pRow, bKeyControl);

Works well now.


Win 7 x64
VS 2008
CJ 15.13

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.281 seconds.