Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - MFC C++ Dialog-based right click SubMenu Issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MFC C++ Dialog-based right click SubMenu Issue

 Post Reply Post Reply
Author
Message
SubDrag View Drop Down
Groupie
Groupie


Joined: 19 December 2014
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote SubDrag Quote  Post ReplyReply Direct Link To This Post Topic: MFC C++ Dialog-based right click SubMenu Issue
    Posted: 19 December 2014 at 10:55pm
I'm using the latest Skin framework for MFC C++ VS 2008 in a dialog-based application.  It works great, except for right click submenus.  Instead of showing the menu, it just shows a little button.  This happens on all themes, cjstyles or msstyles.  It happens in a CMenu, TrackPopupMenu call.

What do I do to fix this?

http://gyazo.com/4deb0b885df1607bc05f9bdbfd22e5fa
Back to Top
SubDrag View Drop Down
Groupie
Groupie


Joined: 19 December 2014
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote SubDrag Quote  Post ReplyReply Direct Link To This Post Posted: 19 December 2014 at 11:28pm
I have an update to the problem - it only happens on submenus that are not statically defined but added on the fly before showing.   

I have recreated it in the test Skin Controls app.  

void CSkinControlsDlg::OnToolbarDropDown(NMHDR* /*pNotifyStruct*/, LRESULT* /*result*/ )
{
RECT rc;
m_wndToolBar.GetItemRect(1, &rc);
m_wndToolBar.ClientToScreen(&rc);

CMenu menu;
menu.LoadMenu(IDR_MENU_POPUP);

UINT startBitFlags = 10000;
CMenu tempMenu1Main;
tempMenu1Main.CreatePopupMenu();

CMenu* menuLoaded = menu.GetSubMenu(0);

for (int y = 0; y < 50; y+=50)
{
CMenu tempSubMenu1;
tempSubMenu1.CreatePopupMenu();

for (int x = 0; x < 50; x=x++)
{
CString tempStr;
tempStr.Format("Item %04X", x+y);
tempSubMenu1.AppendMenu(MF_STRING | MF_ENABLED, (startBitFlags+x+y), "Item");
}

tempMenu1Main.InsertMenu(y/50, MF_BYPOSITION | MF_POPUP, (UINT_PTR)tempSubMenu1.m_hMenu, "SubMenu");
}

CString csMnuText;
menuLoaded->GetMenuString(2, csMnuText, MF_BYPOSITION);
menuLoaded->DeleteMenu(2, MF_BYPOSITION); //delete old popup
menuLoaded->InsertMenu(2, MF_BYPOSITION | MF_POPUP, (UINT_PTR)tempMenu1Main.m_hMenu, csMnuText);

TrackPopupMenu(menuLoaded->GetSafeHmenu(), 0, rc.left, rc.bottom, 0, m_hWnd, 0);
}


It seems the predefined submenus are working, but not these - it does work without loading any skins.  This is done, then the menu is shown.  It works without code jock skinning. 

There must be a way to fix this.

Also, when I tried to just disable popup menus just as a test using SetApplyOptions (1 | 2 | 4)...the popup menus reverted fine...but the main menu didn't work at all.
Back to Top
mcmastl View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 April 2015
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote mcmastl Quote  Post ReplyReply Direct Link To This Post Posted: 20 April 2015 at 1:53pm
We have informed our development team of the issue and will be looking into it.  Thank you for bringing this to our attention.  If the issue has been resolved please let us know.  
Luke McMasters, 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.156 seconds.