MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / UpdateMenu

Method UpdateMenu

Source/MainFrm.cpp:2737–2766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2735}
2736
2737void CMainFrame::UpdateMenu(CMenu *pMenu)
2738{
2739 CAccelerator *pAccel = FTEnv.GetAccelerator();
2740
2741 for (UINT i = 0; i < static_cast<unsigned int>(pMenu->GetMenuItemCount()); ++i) { // // //
2742 UINT state = pMenu->GetMenuState(i, MF_BYPOSITION);
2743 if (state & MF_POPUP) {
2744 // Update sub menu
2745 UpdateMenu(pMenu->GetSubMenu(i));
2746 }
2747 else if ((state & MFT_SEPARATOR) == 0) {
2748 // Change menu name
2749 UINT id = pMenu->GetMenuItemID(i);
2750
2751 if (CStringW shortcut = pAccel->GetShortcutString(id); !shortcut.IsEmpty()) { // // //
2752 CStringW string;
2753 pMenu->GetMenuStringW(i, string, MF_BYPOSITION);
2754
2755 int tab = string.Find(L'\t');
2756
2757 if (tab != -1) {
2758 string = string.Left(tab);
2759 }
2760
2761 string += shortcut;
2762 pMenu->ModifyMenuW(i, MF_BYPOSITION, id, string);
2763 }
2764 }
2765 }
2766}
2767
2768void CMainFrame::OnEditCut()
2769{

Callers 3

OnContextMenuMethod · 0.80
OnRButtonUpMethod · 0.80

Calls 4

GetShortcutStringMethod · 0.80
IsEmptyMethod · 0.80
FindMethod · 0.80
GetAcceleratorMethod · 0.45

Tested by

no test coverage detected