MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / makeMenu

Method makeMenu

gui/builtinContextMenus/moduleRahPattern.py:61–81  ·  view source on GitHub ↗
(container, parentMenu, root=False)

Source from the content-addressed store, hash-verified

59 msw = "wxMSW" in wx.PlatformInfo
60
61 def makeMenu(container, parentMenu, root=False):
62 menu = wx.Menu()
63 if root:
64 menuItem, checked = self._addPattern(rootMenu if msw else parentMenu, None, 'Fit Pattern')
65 menu.Append(menuItem)
66 menuItem.Check(checked)
67 menuItem, checked = self._addPattern(rootMenu if msw else parentMenu, 'disable', 'Do Not Adapt')
68 menu.Append(menuItem)
69 menuItem.Check(checked)
70 menu.AppendSeparator()
71 for name, subcontainer in container[1].items():
72 menuItem = self._addCategory(rootMenu if msw else parentMenu, name)
73 subMenu = makeMenu(subcontainer, menu)
74 menuItem.SetSubMenu(subMenu)
75 menu.Append(menuItem)
76 for name, pattern in container[0].items():
77 menuItem, checked = self._addPattern(rootMenu if msw else parentMenu, pattern, name)
78 menu.Append(menuItem)
79 menuItem.Check(checked)
80 menu.Bind(wx.EVT_MENU, self.handlePatternSwitch)
81 return menu
82
83 subMenu = makeMenu(self.items, rootMenu, root=True)
84 return subMenu

Callers

nothing calls this directly

Calls 3

_addPatternMethod · 0.95
_addCategoryMethod · 0.95
itemsMethod · 0.80

Tested by

no test coverage detected