def check_map_menu(self): # make the initial map menu if not mp_util.has_wxpython: return if self.done_map_menu: if not self.module('map'): self.done_map_menu = False return if self.module('map'): self.menu = MPMenuSubMenu( 'CMAC', items=[ MPMenuItem('Load foamy mission CW', 'Load foamy mission CW', '# cmaccheck loadFoamyMissionCW'), MPMenuItem('Load foamy mission CCW', 'Load foamy mission CCW', '# cmaccheck loadFoamyMissionCCW'), MPMenuItem('Load rally points', 'Load rally points', '# cmaccheck loadRally'), MPMenuItem('Load foamy fence', 'Load foamy fence', '# cmaccheck loadFoamyFence'), ]) self.module('map').add_menu(self.menu) self.done_map_menu = True
def __init__(self, state): wx.Frame.__init__(self, None, wx.ID_ANY, state.title) try: self.SetIcon(icon.SimpleIcon("MAP").get_ico()) except Exception: pass self.state = state state.frame = self state.grid = True state.follow = True state.download = True state.popup_object = None state.popup_latlon = None state.popup_started = False state.default_popup = None state.panel = MPSlipMapPanel(self, state) self.last_layout_send = time.time() self.Bind(wx.EVT_IDLE, self.on_idle) self.Bind(wx.EVT_SIZE, state.panel.on_size) self.legend_checkbox_menuitem_added = False # create the View menu self.menu = MPMenuTop([ MPMenuSubMenu('View', items=[ MPMenuCheckbox('Follow\tCtrl+F', 'Follow Aircraft', 'toggleFollow', checked=state.follow), MPMenuCheckbox('Grid\tCtrl+G', 'Enable Grid', 'toggleGrid', checked=state.grid), MPMenuItem('Goto\tCtrl+P', 'Goto Position', 'gotoPosition'), MPMenuItem('Brightness +\tCtrl+B', 'Increase Brightness', 'increaseBrightness'), MPMenuItem('Brightness -\tCtrl+Shift+B', 'Decrease Brightness', 'decreaseBrightness'), MPMenuItem('Zoom +\t+', 'Zoom In', 'zoomIn'), MPMenuItem('Zoom -\t-', 'Zoom Out', 'zoomOut'), MPMenuCheckbox('Download Tiles\tCtrl+D', 'Enable Tile Download', 'toggleDownload', checked=state.download), MPMenuRadio('Service', 'Select map service', returnkey='setService', selected=state.mt.get_service(), items=state.mt.get_service_list()) ]) ]) self.SetMenuBar(self.menu.wx_menu()) self.Bind(wx.EVT_MENU, self.on_menu)
def check_map_menu(self): # make the initial map menu if not mp_util.has_wxpython: return if self.done_map_menu: if not self.module('map'): self.done_map_menu = False return if self.module('map'): self.menu = MPMenuSubMenu( 'FieldCheck', items=[ MPMenuItem('Load foamy mission CW', 'Load foamy mission CW', '# fieldcheck loadFoamyMissionCW'), MPMenuItem('Load foamy mission CCW', 'Load foamy mission CCW', '# fieldcheck loadFoamyMissionCCW'), MPMenuItem('Load rally points', 'Load rally points', '# fieldcheck loadRally'), MPMenuItem('Load foamy fence', 'Load foamy fence', '# fieldcheck loadFoamyFence'), MPMenuItem('Fix Mission+Rally+Fence', 'Fix Mission+Rally+Fence', '# fieldcheck fixMissionRallyFence'), MPMenuItem('Fix EVERYTHING', 'Fix EVERYTHING', '# fieldcheck fixEVERYTHING'), ]) self.module('map').add_menu(self.menu) self.done_map_menu = True