How can capture MDI Tab LBUTTONDBCLK |
Post Reply |
Author | |
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Posted: 24 November 2004 at 12:04am |
If groups enabled, MDIClient has no CS_DBLCLICK style. to fix it for groups add: SetClassLong(m_MTIClientWnd.GetSafeHwnd(), GCL_STYLE, GetClassLong(m_MTIClientWnd.GetSafeHwnd(), GCL_STYLE) | CS_DBLCLKS); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Thanks oleg!
I solve it! Now, I disable Groups Option on MTIClientWnd like this, as you said! m_MTIClientWnd.Attach(this)// I had used m_MTIClientWnd.Attach(this, TRUE), so can't capture &nbs p; &nbs p; &nbs p; &nbs p; // the double clicks on MDITab Now It works! And why this happens? Why groups enable, The WM_LBUTTONDBCLK is missed! |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hmm. I think you have EnableGroups option enabled do you have VERIFY(m_MTIClientWnd.Attach(this)); or VERIFY(m_MTIClientWnd.Attach(this, TRUE)); |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
oleg!
I failed! I did what you said! I replaced 0->CS_DBCLKS in XTPClientWnd.cpp's Addworkspace(); But i must emphasized I used XTP8.7! We used different version or you patch more than the only file! |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Yes, I tested it. Be sure you rebuild dll and _use it_ (may be you need to copy it in debug folder)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
Sorry Oleg, I tried as you told!
But nothing changed! And I checked MSDN, AfxRegisterWndClass(0, LoadCursor(0, IDC_ARROW) if the first input parameter is NULL, that means the style is CS_DBLCLKS! Is this the solution for my question after testing? |
|
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
It proved that you didnt't try your solution before you replied:) You are so kind:) THanks a lot ! I'll try it |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ok, you catch me, I didn't test it. :) You need to patch source code to make it work. Find AfxRegisterWndClass(0, LoadCursor(0, IDC_ARROW) in XTPTabClientWnd.cpp and replace it to AfxRegisterWndClass(CS_DBLCLKS, LoadCursor(0, IDC_ARROW)
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
I had done that before I asked here!
Actually, I wrote as LRESULT CMainFrame::OnTabbarMouseMsg(WPARAM wParam,LPARAM lParam) if (wParam == WM_LBUTTONDBCLK) { return TRUE; Even in your mditab sample, i just add a branch do deal WM_LBUTTONDBCLK, it doesn't work too! I try another message WM_LBUTTONDOWN, it can be captured in ON_MESSAGE(WM_XTP_PRETRANSLATEMOUSEMSG, OnTabbarMouseMsg) Why this happens? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
ON_MESSAGE(WM_XTP_PRETRANSLATEMOUSEMSG, OnTabbarMouseMsg) LRESULT CMainFrame::OnTabbarMouseMsg(WPARAM wParam,LPARAM lParam) if (wParam == WM_LBUTTONDBCLK) { ... return TRUE; return FALSE } |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
zhou_wz
Groupie Joined: 11 December 2003 Status: Offline Points: 44 |
Post Options
Thanks(0)
|
I capture left button double click in TabMouseMsg() to close currenct view as samples do on RBUTTONDOWN to create a popup menu on MDITab but it doesnt work! I use XTP 8.70 I check the code and find LBUTTONDBCLK is the same position as RBUTTONDOWN, but why can't i catch LBUTTONDBCLK as sample does in MainFrm.cpp |
|
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 |