![]() |
popup menue in GUI_VisualStudio7 Panes |
Post Reply
|
| Author | |
CJnewbie
Newbie
Joined: 04 November 2004 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Topic: popup menue in GUI_VisualStudio7 PanesPosted: 04 November 2004 at 9:04pm |
|
I need to add a POPUP MENU to the panes (like ClassView,..) in a similar GUI_visualstudio 7. Can anyone please help me or direct me the right place for info. Thanks in advance. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 1:30am |
|
See Advanced Sample: VERIFY(m_wndToolBar.CreateToolBar(WS_VISIBLE|WS_CHILD| CBRS_TOOLTIPS, this)); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
CJnewbie
Newbie
Joined: 04 November 2004 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 8:00am |
|
Oleg, thanks for your quick response. I think my post wasn't clear. The right-click popup menu I need is in the tree area. Here is what I got so far ( picking up from some of the posts), but still not there yet. I derived CMatTreeCtrl from CXTTreeCtrl and used it in place of CXTTreeCtrl in mainframe (of GUI-visual 7). In CMatTreeCtrl, I have: void CMatTreeCtrl::OnNMRclick(NMHDR *pNMHDR, LRESULT *pResult) { CPoint point; GetCursorPos(&point); CMenu menu; VERIFY(menu.LoadMenu(IDR_POPUP_MATTREE)); CMenu* pPopup = menu.GetSubMenu(0); ASSERT(pPopup != NULL); CWnd* pWndPopupOwner = this; while (pWndPopupOwner->GetStyle() & WS_CHILD) pWndPopupOwner = pWndPopupOwner->GetParent(); pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, pWndPopupOwner); *pResult = 0; } When I right-click the tree control area, the popup menu (IDR_POPUP_MATTREE) appears, BUT I CAN'T ROUTE ANY COMMAND SUCH AS: void CMatTreeCtrl:OnTest() { AfxMessageBox("Clicked"); } where Test is an item on the menu (ID_TEST) Any more helps are appreciated. Thanks
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 10:49am |
|
hmm, try comment your while (pWndPopupOwner->GetStyle() & WS_CHILD) pWndPopupOwner = pWndPopupOwner->GetParent(); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
CJnewbie
Newbie
Joined: 04 November 2004 Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 November 2004 at 12:07pm |
|
Still doesn't work. The meu appears but won't respond to a command route (OnTest).
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 November 2004 at 12:19pm |
|
Try to use our Themed menus: BOOL CXTPComamndBars:TrackPopupMenu(CMenu* pMenu, UINT nFlags, int x, int y, CWnd* pWnd, LPCRECT rcExclude = NULL, CWnd* pWndOwner = NULL, CXTPCommandBars* pCommandBars = NULL); |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
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 |