MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / SetDefault

Method SetDefault

source/script_menu.cpp:905–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

903
904
905ResultType UserMenu::SetDefault(UserMenuItem *aMenuItem, bool aUpdateGuiMenuBars)
906{
907 if (mDefault == aMenuItem)
908 return OK;
909 mDefault = aMenuItem;
910 if (!mMenu) // No further action required: the new setting will be in effect when the menu is created.
911 return OK;
912 if (aMenuItem) // A user-defined menu item is being made the default.
913 SetMenuDefaultItem(mMenu, aMenuItem->mMenuID, FALSE); // This also ensures that only one is default at a time.
914 else
915 SetMenuDefaultItem(mMenu, -1, FALSE);
916 if (aUpdateGuiMenuBars)
917 UPDATE_GUI_MENU_BARS(mMenuType, mMenu) // Testing shows that menu bars themselves can have default items, and that this is necessary.
918 return OK;
919}
920
921
922

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected