Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - popup menue in GUI_VisualStudio7 Panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

popup menue in GUI_VisualStudio7 Panes

 Post Reply Post Reply
Author
Message
CJnewbie View Drop Down
Newbie
Newbie


Joined: 04 November 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CJnewbie Quote  Post ReplyReply Direct Link To This Post Topic: popup menue in GUI_VisualStudio7 Panes
    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.

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
CJnewbie View Drop Down
Newbie
Newbie


Joined: 04 November 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CJnewbie Quote  Post ReplyReply Direct Link To This Post 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

 

 

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
CJnewbie View Drop Down
Newbie
Newbie


Joined: 04 November 2004
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote CJnewbie Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2004 at 12:07pm
Still doesn't work.  The meu appears but won't respond to a command route (OnTest).
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.