Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Report Control: Context Menu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report Control: Context Menu

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

Joined: 12 April 2005
Location: Germany
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote leo_12 Quote  Post ReplyReply Direct Link To This Post Topic: Report Control: Context Menu
    Posted: 09 January 2006 at 3:58am

When right-clicking on a row in a ReportControl I expected the selection would be changed to the row where I clicked and the context menu is shown for that row.

In release 9.81 the focus is changed but not the selection. Therefore it is unclear whether the context menu is valid for the focused or for the selected row.

Why is the selection ignored if the focused row is not a GroupRow?

void CXTPReportControl::OnContextMenu(CWnd* /*pWnd*/, CPoint pos)
{

...  

if (pRow)
  {
   SetFocusedRow(pRow, !pRow->IsGroupRow() || pRow->IsSelected());
   pRow->OnContextMenu(ptClient);
  }

...
}

 

Any comments on that?

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2006 at 7:18am

Hi leo,

Actually there is a bug here. Just change condition a little and rebuild the Toolkit:

from:

   SetFocusedRow(pRow, !pRow->IsGroupRow() || pRow->IsSelected());
to:
   SetFocusedRow(pRow, !pRow->IsGroupRow() && pRow->IsSelected());

The idea is: do not reset multiple selection when you click at one of selected items, and reset (change) selection when click at not selected row or at the group row.

--
WBR,
Serge

Back to Top
leo_12 View Drop Down
Groupie
Groupie
Avatar

Joined: 12 April 2005
Location: Germany
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote leo_12 Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2006 at 8:07am
Thanks for your help!
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.047 seconds.