![]() |
CXTPReportControl inside pane causes problems! |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() Posted: 01 March 2008 at 4:35pm |
I have a report control in a pane. Now I want to handle double-clicks. In my frame window, I have the following:
ON_NOTIFY(NM_DBLCLK, IDR_PANE_MY_REPORT, OnReportDblClick)
...
m_wndReport.Create(..., this);
if (pPane->GetID() == IDR_PANE_MY_REPORT)
pPane->Attach(&m_wndReport); Problem
CMyFrame::OnReportDblClick will not be called since the parent of m_wndReport changed in the call to Attach().
How do you catch double-clicks in a report control inside a pane? I would like to use this NM_DBLCLK message.
Thanks!
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, I see only one good solution:
Add additional CWnd derived host window, add m_wndReport to this CWnd, attach this CWnd to Pane instead of Report. And catch all mesages in this CWnd.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Yeah, good idea. I thought of a CView, but I just stripped them from my project so I don't feel like it :P.
Thanks for your hint.
|
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
A better solution would be to have this function in the report control:
SetNotifyWindow(CWnd *pWndNotify)
And then redirect all notify messages to that window.
|
|
![]() |
|
mgampi ![]() Senior Member ![]() ![]() Joined: 14 July 2003 Status: Offline Points: 1201 |
![]() ![]() ![]() ![]() ![]() |
Hi;
Have you tried to call SetOwner()? Parent is the pane, but owner is your frame window.
I didn't check this; take a look at the report control sources, whether the control notifys the parent or the owner...
This is built in and requires no additional code in the core XT library.
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Yeah, you're right. It does send the message to the owner. The question remaining is; will everything work if I change the owner to my frame?
I'll test this as soon as possible.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |