Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Multiple ranged selection not working
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiple ranged selection not working

 Post Reply Post Reply Page  <12
Author
Message
xcentric View Drop Down
Groupie
Groupie


Joined: 04 September 2008
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote xcentric Quote  Post ReplyReply Direct Link To This Post Posted: 16 July 2009 at 1:44pm
Mark, I have tested your fresh demo.

Just in case you had not seen it:
1) General -> Show Markup Sample
2) Right-Click on the header -> Columns

You will see a markup code instead of a column name.

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2009 at 1:02am
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2009 at 10:12am
Hi Mark,

Today I can consecrate some time to tests.

ReportSampleStaticProto tests results :

  • OK : Selection persistence for group childs seems to work perfectly.

  • TO FIX : Click on expand/collapse button should not change selection or generate item click / double click events.

  • TO FIX : Multiple selection of blocs doesn't work for group child records.

  • TO FIX : When selecting with CTRL + SHIFT, no item should be unselected, this will avoid a bug when changing selection direction (3 blocs upward and one downward).



I will now check for horizontal scrollbar that is automatically hidden.

Regards,
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2009 at 10:19am

Thanks for testing but you get intermidiate stage - try again - same links (support multiple column set in group box)

https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar
https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticExt.rar
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2009 at 11:31am
New tests results :

  • OK : Click on expand/collapse button should not change selection or generate item click / double click events.

  • TO FIX : Multiple selection of blocs doesn't work for group child records.

  • TO FIX : When selecting with CTRL + SHIFT, no item should be unselected, this will avoid a bug when changing selection direction (3 blocs upward and one downward).

  • OK : Horizontal scrollbar that was automatically hidden.

Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2009 at 11:42am
1 >>Multiple selection of blocs doesn't work for group child records - What do you mean?
Consider that group row is not selectable - you can select most deep childs - on individual or multiple (inside same child set) base.
Under such conditions you still think that there is something wrong?
We can make selection with group row (if it allow focus - there is flag m_pReportControl->IsSkipGroupsFocusEnabled() with default = TRUE) later.
2  CTRL + SHIFT case - do you test keyboard-only selection in this case (compare with Windows Explorer please)? For mouse case - yes need to prevent unselection.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2009 at 1:59pm
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2009 at 6:17pm
If you need some code modification - visit this post and leave your wish - https://forum.codejock.com/forum_posts.asp?TID=13834
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 19 July 2009 at 10:39am
Originally posted by xcentric xcentric wrote:

Mark, I have tested your fresh demo.

Just in case you had not seen it:
1) General -> Show Markup Sample
2) Right-Click on the header -> Columns

You will see a markup code instead of a column name.

 
You right - this is not part of Report Control - this is app menu where we can check MarkUp case and do smth.
Thanks
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2009 at 4:39am
... no item should be unselected ... : OK

Bug when changing selection direction works better but there is still a problem :

Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2009 at 5:35am
Selection in sublevels (children selection when using groups) :


1) Two lines range




2) Multiple selection of blocs


Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 July 2009 at 1:27pm
>>When selecting with CTRL + SHIFT, no item should be unselected, this will avoid a bug when changing selection direction (3 blocs upward and one downward)

Thanks (should be < instead of <=) - try now please - https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticExt.rar
 
>>Selection in sublevels (children selection when using groups) -
this is effect of m_bSkipGroupsFocus = TRUE; (CXTPReportControl::SkipGroupsFocus(TRUE))
if you use m_bSkipGroupsFocus = FALSE; (CXTPReportControl::SkipGroupsFocus(FALSE))
selection with childs working as well as no childs case mode selection
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2009 at 1:15am
Please get fresh updates - it works in both cases now: m_bSkipGroupsFocus = TRUE and m_bSkipGroupsFocus = FALSE
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2009 at 4:43am
Concerning my first post :

"Selection change direction" still need to be fixed.

---------------------------------------

Concerning my second post :

1) Two lines selection range : OK

2) Children selection and SkipGroupsFocus : OK
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 21 July 2009 at 11:20am
Don't change direction - as you wrote "this will avoid a bug when changing selection direction"
You have access to all recent code - https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar - try to cover this case please
E.g. we can use same logic as for SHIFT + CONTROL case - if click inside [minSelection - maxSelection] range - ignore it if SHIFT pressed
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 9:11am
Hi Mark,

Starting from this evening I will be in holiday for three weeks.

I had not enough time to further work on the selection.

I noticed some strange behavior when selecting a range of rows starting from one child and ending to one child of another parent.

Meanwhile, please be patient and see you in three weeks.

Regards,
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 10:16am
Sergio - as a professional you should at least comment which version of app (with timestamp of exe) you use to testing? It can be already obsolete....
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 11:18am
The last timestamp is on file XTPReportRows.cpp : July 21, 2009.

XTPReportControl.cpp : July 20, 2009.

I'm leaving now.
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 3:05pm
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2009 at 5:33am
Hello Mark,

I'm back !
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 August 2009 at 10:25am
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2009 at 6:06am
Got https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar (timestamp August, 20 - 11:40), and cannot build the ToolKit :

...
1>XTPReportControl.cpp
...\codejock software\mfc\xtreme toolkitpro v13.1.0\source\reportcontrol\xt
preportcontrol.cpp(5294) : error C2065: '_XTP_SCHEMA_1310' : undeclared identifi
er
...

...
1>XTPReportColumn.cpp
...\codejock software\mfc\xtreme toolkitpro v13.1.0\source\reportcontrol\xt
preportcolumn.cpp(306) : error C2065: '_XTP_SCHEMA_1310' : undeclared identifier
...
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2009 at 9:14am
In the example https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar (timestamp August, 20 - 15:00), this bug has resurrected :



Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2009 at 9:55am
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2009 at 11:23am

Can't confirm - my static (same as in link) - Aug 17, 18:10

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2009 at 11:41pm
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 11:14am
Originally posted by Sergio Sergio wrote:

In the example https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar (timestamp August, 20 - 15:00), this bug has resurrected :





This bug is still present.

Tested in files :

https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticExt.rar - timestamp Aug 21, 18:05 and Aug 25, 17:10
https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStatic.rar - timestamp Aug 21, 18:05 and Aug 25, 17:10
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 11:22am

Because you change direction - even you going from top to bottom or from bottom to top but not mix - this is that yourself use as one-directional selection - as you wrote "this will avoid a bug when changing selection direction"

Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 11:42am
I wrote :

>> When selecting with CTRL + SHIFT, no item should be unselected, this will avoid a bug when changing selection direction (3 blocs upward and one downward).

That means that using the CTRL + SHIFT keys should select all the items in the range of the last two mouse clicks, and should not leave any unselected items in the range.
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 11:48am
OK - you have fresh source - try to improve it please to implement your rule
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 11:49am
Here is another bug (Tree View test dialog) :

https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticExt.rar - timestamp Aug 25, 17:15 and Aug 25, 17:47


Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 12:07pm
I can't implement my rule since the source is a little bugged.

I've looked to the code, and I don't understand why there is a "direction" of selection in the code.

Moreover, the code is not well centralized, there isn't one clear method that handle the whole selection case, like :

BOOL DoSelectionChange(int nNewlyFocusedRowIndex, BOOL bExtendTo /*if VK_SHIFT*/, BOOL bReplacePreviousSelection /*if not VK_CONTROL*/, BOOL bByMouse, BOOL bSpacebarPressed /*If not by mouse, if VK_SPACE pressed to switch row selection*/, BOOL bSendNotifyMessageToParent, BOOL bCallVirtualNotifyMembers, BOOL bUpdateDisplay)

(Returns TRUE if the selection has changed)

If you centralize the code, it will be easier to manage all cases.
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 12:22pm
Good idea - add it
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 12:35pm
If you don't know how to centralize this method, please place some comments in the code, like :

/*Selection Start*/ ...
... code ...
... /*Selection End*/

or /*Sergio Start*/ ... /*Sergio End*/

In all methods, code and member variables that are implied in selection management. Please do not forget any part and mark only code related to the selection behavior.

Then upload the latest and commented source.

The final goal is to have one centralized method that handle all selection cases.
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 12:44pm

Sounds good - could you start it now if you have some time and I will contunie later when will have time (in the evening I guess) please? You can attach modified rar in Forum post

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 12:48pm
>>Here is another bug (Tree View test dialog) :
btw - keyboard selection for this case not skipped childs - please try.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 4:26pm
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2009 at 5:16pm
Centralized function you are looking for is BOOL CXTPReportControl::SetFocusedRow(CXTPReportRow* pRow, BOOL bShiftKey, BOOL bControlKey)
Check all places this function called and you will see it.
 
And to analyze CTRL + SHIFT case ... [A, B]  X [C, D] ... to choose which segment to add to selection [B, X] or [X, C]
we don't need direction flag as we have int CXTPReportSelectedRows::m_nRowBlockBegin
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 4:06am
There are two functions :

    BOOL CXTPReportControl::SetFocusedRow(CXTPReportRow* pRow, BOOL bControlKey)

and

    BOOL CXTPReportControl::SetFocusedRow(CXTPReportRow* pRow, BOOL bShiftKey, BOOL bControlKey)

The 1st method have duplicate code, why does it not call the 2nd method with bShiftKey set to FALSE ?
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 4:13am
Could you also give me some information about the class CXTPReportNavigator ?

In methods CXTPReportControl::SetFocusedRow(...), there is a call :

    GetNavigator()->SetMovePosition(pRow->GetType());
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 7:52am

void CXTPReportNavigator::SetMovePosition(XTPReportRowType RowType)

{

switch (RowType)

{

case xtpRowTypeBody: m_bCurrentFocusInHeadersRows = FALSE; m_bCurrentFocusInFootersRows = FALSE; break;

case xtpRowTypeHeader: m_bCurrentFocusInHeadersRows = TRUE; m_bCurrentFocusInFootersRows = FALSE; break;

case xtpRowTypeFooter: m_bCurrentFocusInHeadersRows = FALSE; m_bCurrentFocusInFootersRows = TRUE; break;

}

}

Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 9:15am
OK, thank you.

Now, I will try to manage the selection.
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 10:59am
Could you please give me the source code of your Report Static sample ?

Thank you.
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 11:01am

You can use standard CJ sample code - it is enough to selection testing.

Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 11:04am
How do I enable multiple selection mode ?

I need also to test with header and footer.
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 11:07am
OK. Standard Report Sample works with multiple selection.

How do I display header and footer ?
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 11:08am
OK. I found how.
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 11:44am
1) I have routed the 1st function to the 2nd one :

   BOOL CXTPReportControl::SetFocusedRow(CXTPReportRow* pRow, BOOL bControlKey)
   {
     return SetFocusedRow(pRow, FALSE, bControlKey);
   }

   BOOL CXTPReportControl::SetFocusedRow(CXTPReportRow* pRow, BOOL bShiftKey, BOOL bControlKey)
   {
     ...

---> It works.



2) I have tried to disable the "centralized code" of the selection :

     bEnableSelection = FALSE; // In SetFocusedRow(...)

---> It is still possible to select individual items using the CTRL+SPACEBAR keys or CTRL+left mouse click.

---> I have to move this external code inside the method SetFocusedRow(...), and I will perhaps have to create a third SetFocusedRow(...) method with more parameters (but at last, only one method will have all the code)
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 12:35pm
2) ---> OK. Now all the selection behavior is handled in the method SetFocusedRow(...)

3) I am now able to fix the selection.

Please note that :

- When changing the focus from another group (header, body or footer) of selection, the selection of the previous group will be cleared and only the focused item in the new group will be selected (SHIFT or CTRL keys will be ignored in this case), because it is impossible to select a range starting from the header and ending to the footer!
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 4:04pm
btw - i expect that you will confirm proper selection with group rows
 
 
Also please take attention to the end of function

void CXTPReportSelectedRows::SelectBlock(int nBlockBegin, int nEnd, BOOL bControlKey) {

............................................
if (m_pControl->m_bSelectionExcludeGroupRows
    m_pControl->UnselectGroupRows(); //this is the way to show only selected childs under group rows

//new flag - m_bSelectionExcludeGroupRows (default = TRUE - this is 12.1 way to show selection - witrhout group rows)

}

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2009 at 8:13pm
Sergio - please get fresh source update - https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar
Today's modifications - DD with custom clippoard format and flag m_bSelectionExcludeGroupRows (see prev post)
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 4:01am
I confirm that children items are now correctly selected when selecting from one parent to another (having parents in expanded state).

----------------

I have finished to implement the SetFocusedRow(...) method, but it still doesn't work. After some debugging, I found that the method :

   void CXTPReportSelectedRows::SelectBlock(int nBlockBegin, int nEnd, BOOL bControlKey)

does not work properly and is bugged. I think that this method does too much. Before doing anything else, I will do my own SelectBlock(...) for testing and finishing the selection behavior.

Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 5:44am
I did a temporary method to do a block of selection and now, it works much better :

    void CXTPReportControl::FixOfSelectBlock(int nRowsType, int nStartingRow, int nEndingRow)


I have done all cases for keyboard and mouse. I have one last point to do : remember correctly the starting range for keyboard and mouse. I will have to create a new member variable in CXTPReportControl like :

   int m_nSelectionStartingRow;                          // Starting row index of the last bloc of selection.
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 8:01am
OK. Done it works fine.

I am now preparing the sources to upload.
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 8:37am
Hi Mark,


Here are the 3 impacted files :

    XTPReportControl.h
    XTPReportControl.cpp
    XTPReportRows.cpp

    20090827_081811_MultipleSelecti.zip


Here is the differences report in HTML format (using Beyond Compare) :

    SergioChangesReport.zip

    20090827_082034_SergioChangesRe.zip


You will have to :

- Fix your method SelectBlock(...) (See comments "----> Bugged method !"). Look at my temporary fix FixOfSelectBlock(...), and try to put your specific check in the commented line "//if (pRow->CanBeSelected())".

- Don't use CXTPReportSelectedRows::m_nRowBlockBegin but better use CXTPReportControl::m_nSelectionStartingRow. You may rename it if you prefer. The class CXTPReportControl is now a friend class of CXTPReportSelectedRows. Look at my change in the file XTPReportRows.cpp.


Regards,
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 10:48am
Thank you Sergio - i merged our recent modifications and now we can ask everybody to try before I wll update SVN -
 
 
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 10:54am
Seems to work.

But your "https://forum.codejock.com/uploads/DemoVersion/ReportSampleStaticAug27.rar" has bad columns sizes and scrollbar behavior, and this is not due to my changes... ---> You removed it from your previous post. I added this comment on 28 August 2009, why the web site does not report it ?

The Tree Dialog Test inside the same app is working perfectly.

Please check...

HAVE YOU FIXED YOUR METHOD "SelectBloc(...)" ?
Have you read my comments of my previous post ?
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 11:06am
NO - I make a build with all your changes to see the result. E.g. it loose selection now (try Pane app) - how to make DD?
 
I wanted to have some milestone state and this is that we have now.
 
I see now that you don't touch SelectBlock function - main logical working horse
 
>>The Tree Dialog Test inside the same app is working perfectly  - same in Aug 25 build - I already told you it
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 11:15am
What do you mean with "DD" ?
When does it loose selection ?

I have just tested the new selection with our projects, and I have just seen one small bug : the message "selection changed" is not generated for all cases.
This is due to the method m_pSelectedRows->IsChanged() that is not working for all cases in SetFocusedRow(...). Please just force the "changed state" inside SetFocusedRow(...).

----------------------------------

">>The Tree Dialog Test inside the same app is working perfectly - same in Aug 25 build - I already told you it"

--> Yes, I knew it, I meant that that Codejock DLL contents was perfectly working on the Tree Dialog Test that you haven't modified.

PLEASE STOP MODIFYING PREVIOUS POSTS!
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 11:17am
DD is drag and drop. Build yourself working app version and attach please
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 11:36am
Yes, confirmed. Simple mouse click, with SHIFT up and CTRL up, should check if the item is already selected and if this is the case, it should not change the selection...
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 1:17pm

OK - I fixed this case, rebuild static app and updated links from prev post (...Aug27) - people can get and try
 
// MOUSE

if (m_bBlockSelection) {

.........................
else
{

if (!pRow->IsSelected()) {

// Replace selected item

m_pSelectedRows->Select(pRow);

m_nSelectionStartingRow = nNewFocusedRow;

}

.........................
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2009 at 10:58pm
Also look on new feature - Report Control with resizable rows - select row and you can track down row height -
 
 
Menu - Help - Header-Footer turn this mode off
 
 
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2009 at 3:38am
I think that Drag'n'Drop will still not work, because we also need it if m_bBlockSelection is TRUE.

There is perhaps something to do with mouse up if m_bBlockSelection is TRUE and if the SHIFT & CTRL keys are up and if the clicked row is already selected.

For now, I have something else to do, I will try to look later.
Sergio
Back to Top
xcentric View Drop Down
Groupie
Groupie


Joined: 04 September 2008
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote xcentric Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2009 at 4:02am
I have tested the sample https://forum.codejock.com/uploads/DemoVersion/ReportPaneViewStaticTrack.rar and found the issue:
1) Run the sample
2) Click between column 4 and column 5 on the header (just one mouse click)
3) You will see that column 4 has resized, but it should not
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2009 at 4:22am
Could you please stop modifying previous posts that have already been replied ?

Your web site doesn't report any modified state or recent date for modification of any previous post.

Thank you.
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2009 at 8:39am
No - this is my posts and if I consider that content (links) description is obsolete - I am changing it to match the current links content state - it make sense. I can't touch YOUR posts so don't worry 
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2009 at 9:06am
I know it, please don't change your posts!
Sergio
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2009 at 11:05am
>>2) Click between column 4 and column 5 on the header (just one mouse click)
>>3) You will see that column 4 has resized, but it should not
 
What's happened if you click again in same place after resize done? No more resizing on click - right?.
This is result of columns with MinWidth > GivenWidth - in my case 100 and 80:

for (i = 0; i < COL_NUMBER; ++i)

{

columnStr.Format("Column %d",i);

CXTPReportColumn* pCol = GetReportCtrl().AddColumn(new CXTPReportColumn(i, columnStr, 80, FALSE,XTP_REPORT_NOICON,TRUE));

pCol->EnableResize(TRUE);

pCol->SetMinWidth(100);

}

Back to Top
xcentric View Drop Down
Groupie
Groupie


Joined: 04 September 2008
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote xcentric Quote  Post ReplyReply Direct Link To This Post Posted: 28 August 2009 at 11:31am
Originally posted by mdoubson mdoubson wrote:

This is result of columns with MinWidth > GivenWidth - in my case 100 and 80:


Yes, you are right, thanks.
Back to Top
 Post Reply Post Reply Page  <12
  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.172 seconds.