mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 22:04:55 +02:00
Fix Switch-To keyboard shortcuts cannot be used in context menu
Fix #943, close #9436
This commit is contained in:
parent
ca1bcb1ec0
commit
fed1803c78
@ -112,15 +112,18 @@ void ContextMenu::create(HWND hParent, const std::vector<MenuItemUnit> & menuIte
|
|||||||
{
|
{
|
||||||
lastIsSep = true;
|
lastIsSep = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainMenuHandle)
|
if (mainMenuHandle)
|
||||||
{
|
{
|
||||||
bool isEnabled = (::GetMenuState(mainMenuHandle, item._cmdID, MF_BYCOMMAND)&(MF_DISABLED|MF_GRAYED)) == 0;
|
UINT s = ::GetMenuState(mainMenuHandle, item._cmdID, MF_BYCOMMAND);
|
||||||
bool isChecked = (::GetMenuState(mainMenuHandle, item._cmdID, MF_BYCOMMAND)&(MF_CHECKED)) != 0;
|
if (s != -1)
|
||||||
if (!isEnabled)
|
{
|
||||||
enableItem(item._cmdID, isEnabled);
|
bool isEnabled = (s & (MF_DISABLED | MF_GRAYED)) == 0;
|
||||||
if (isChecked)
|
bool isChecked = (s & (MF_CHECKED)) != 0;
|
||||||
checkItem(item._cmdID, isChecked);
|
if (!isEnabled)
|
||||||
|
enableItem(item._cmdID, isEnabled);
|
||||||
|
if (isChecked)
|
||||||
|
checkItem(item._cmdID, isChecked);
|
||||||
|
}
|
||||||
|
|
||||||
// set up any menu item bitmaps in the context menu, using main menu bitmaps
|
// set up any menu item bitmaps in the context menu, using main menu bitmaps
|
||||||
memset(&mii, 0, sizeof(mii));
|
memset(&mii, 0, sizeof(mii));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user