|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Hans Peter Miedeck
|
Jan 11, 2007 - 4:16 AM
|
Dear Support,
I’ve looked everywhere for a sample how to use OnGbwAnalyzeCellMouseClickEvent but I cannto find anyone.
I’ve got a CScrollSortGridWnd object which has to enable diferrent buttons when a row was clicked. So I have to ask for the left mouse click.
I tried it so:
//Header CScrollSortGridWnd m_cTest;
//CPP
... ... /* Add some rows*/ ..... .....
BOOL CPruefreihenfolge::PreTranslateMessage(MSG* pMsg) { if ( pMsg->message == WM_LBUTTONDOWN ) { if ( this->m_cTest.OnGbwAnalyzeCellMouseClickEvent(VK_LBUTTON,1,NULL,NULL) ) { MessageBox("jepp",NULL,MB_OK); } }
return CExtResizableDialog::PreTranslateMessage(pMsg); }
But nothing happens.
How can I get events that were send in my CScrollSortGridWnd object?
|
|
Hans Peter Miedeck
|
Jan 12, 2007 - 5:45 AM
|
Thanks,
it works very well. ;-)
But now I’ve a new problem :-)
The choosen row was not selected. :-(
|
|
Suhai Gyorgy
|
Jan 12, 2007 - 6:46 AM
|
Just a guess: In Sergiy’s code it says: if( nColType == 0 && nRowType == 0)
{
// if we are here, then the inner data cell is clicked by the left mouse button
if( "this event is handled by your code" ) return true;
}
I think in your case "this event is handled by your code" should always be false, meaning that return shouldn’t be called here, only after CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent.
|
|
Sergiy Lavrynenko
|
Jan 11, 2007 - 5:02 AM
|
Dear Hans,
You should add the OnGbwAnalyzeCellMouseClickEvent() virtual method into your CScrollSortGridWnd class instead of invoking it explicitly. Sample:bool CScrollSortGridWnd::OnGbwAnalyzeCellMouseClickEvent(
UINT nChar, // VK_LBUTTON, VK_RBUTTON or VK_MBUTTON only
UINT nRepCnt, // 0 - button up, 1 - single click, 2 - double click, 3 - post single click & begin editing
UINT nFlags, // mouse event flags
CPoint point // mouse pointer in client coordinates
)
{
ASSERT_VALID( this );
ASSERT( 0 <= nRepCnt && nRepCnt <= 3 );
if( nChar == VK_LBUTTON )
{
CExtGridHitTestInfo htInfo( point );
HitTest( htInfo, false, true );
if( htInfo.IsHoverEmpty()
|| (! htInfo.IsValidRect() )
)
return false;
INT nColType = htInfo.GetInnerOuterTypeOfColumn();
INT nRowType = htInfo.GetInnerOuterTypeOfRow();
if( nColType == 0
&& nRowType == 0
)
{
// if we are here, then the inner data cell is clicked by the left mouse button
if( this event is handled by your code )
return true;
}
}
if( CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(
nChar,
nRepCnt,
nFlags,
point
)
)
return true;
return false;
}
|
|