Print Page | Close Window

popup menue in GUI_VisualStudio7 Panes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=1369
Printed Date: 06 November 2025 at 11:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: popup menue in GUI_VisualStudio7 Panes
Posted By: CJnewbie
Subject: popup menue in GUI_VisualStudio7 Panes
Date Posted: 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.




Replies:
Posted By: Oleg
Date Posted: 05 November 2004 at 1:30am

See Advanced Sample:

 VERIFY(m_wndToolBar.CreateToolBar(WS_VISIBLE|WS_CHILD| CBRS_TOOLTIPS, this));
 VERIFY(m_wndToolBar.LoadToolBar(IDR_TOOLBAR_HEROES));
 
 m_wndToolBar.GetControls()->Remove(m_wndToolBar.Get Control(0));
 CXTPControl* pControl = m_wndToolBar.GetControls()->Add(xtpControlButtonPopup, IDR_HEROES_FAMILY, _T(""), 0);



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: CJnewbie
Date 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

 

 



Posted By: Oleg
Date 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


Posted By: CJnewbie
Date Posted: 05 November 2004 at 12:07pm
Still doesn't work.  The meu appears but won't respond to a command route (OnTest).


Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net