Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Show PopUp Menu? Help!!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Show PopUp Menu? Help!!

 Post Reply Post Reply
Author
Message
softz View Drop Down
Newbie
Newbie
Avatar

Joined: 29 December 2003
Location: Singapore
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote softz Quote  Post ReplyReply Direct Link To This Post Topic: Show PopUp Menu? Help!!
    Posted: 29 December 2003 at 5:14am

Hi!

I'm trying to pop-up a dynamic menu from my dialog through CXTPCommandBars::TrackPopupMenu(). The following is my code.

/// ---

CXTMenu popupMenu;

popupMenu.CreatePopupMenu();

for(int i = 0; i < 5; i++)

{

   CMenu subMenu;

   subMenu.CreatePopupMenu();

   subMenu.AppendMenu(MF_STRING, ID_LOGIN + i, "Login");

   subMenu.AppendMenu(MF_SEPARATOR);

   subMenu.AppendMenu(MF_STRING, ID_AUTOIN + i, "Auto In");

   subMenu.AppendMenu(MF_STRING, ID_MANUALIN + i, "Manual In");

   subMenu.AppendMenu(MF_STRING, ID_AFTERCALLWORK + i, "AfterCall Work");

   subMenu.AppendMenu(MF_SEPARATOR);

   subMenu.AppendMenu(MF_STRING, ID_LOGOUT + i, "Logout");

   CString str;

   str.Format("User%d", i);

   popupMenu.AppendMenu(MF_POPUP, (UINT_PTR)subMenu.m_hMenu, str);

}

TRACE("GetMenuItemCount: %d\n", popupMenu.GetMenuItemCount());

CXTPCommandBars::TrackPopupMenu(&popupMenu, 0, 10, 10, this);

/// --

I can't display the menu which I originally wanted through Codejock's CXTPCommandBars. However, it works fine with Win32API. Can anyone help me on this. By the way, "this" is a pointer to my dialog.

 

Regards,

Eric

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 30 December 2003 at 1:20am

If you don't have MainFrame in you application,

try to call CXTPPaintManager::SetTheme(xtpThemeOfficeXP); in the dialog::OnInitDialog

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.062 seconds.