Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [SOLVED] 15.1.3. Two message on right click
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] 15.1.3. Two message on right click

 Post Reply Post Reply
Author
Message
aceproof View Drop Down
Newbie
Newbie


Joined: 24 March 2008
Location: Russian Federation
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote aceproof Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] 15.1.3. Two message on right click
    Posted: 28 September 2011 at 10:15am

When I right click on the report row, at first I receive NM_CLICK notification, then NM_RCLICK

XTPReportControl.cpp:

void CXTPReportControl::OnButton(UINT nFlags, CPoint point,
	    CXTPReportBehaviorRowMouseButton* pBehavior)
{

     ...

     if (NULL != clickArgs.pRow)
{
...
if (!bHandled)
{
...
// Row click
if (pBehavior->bClick)
{
clickArgs.pRow->OnClick(point); // NM_CLICK if (pBehavior->bCheckSelectedRows && clickArgs.pItem) { SetSelectionState(clickArgs.pItem->GetIndex(), clickArgs.pItem->GetCheckedState()); } }
} // !bHandled
}
else if (m_bFastDeselectMode) { if (!bKeyControl && !bKeyShift) { m_pSelectedRows->Clear(); } } // Context menu if (pBehavior->bContextMenu) { if (NULL != m_pSections->HitTest(point)) { if (NULL != clickArgs.pRow) { clickArgs.pRow->OnContextMenu(point) // NM_RCLICK } else { SendMessageToParent(NULL, NULL, NULL, NM_RCLICK, &point); // NM_RCLICK } } }
}


If it is made to select row by right click, may be, do it without a sending the message NM_CLICK?

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: 28 September 2011 at 1:11pm
Hi,

the behavior is correct here. You can always set bClick to FALSE. Then the row will be selected, but no click will be performed. If you set bClick to FALSE, then you can for example not check a checkbox with the right mouse button.

Andre

Codejock support
Back to Top
aceproof View Drop Down
Newbie
Newbie


Joined: 24 March 2008
Location: Russian Federation
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote aceproof Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2011 at 2:43am
Thanks :-)
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.