Path: blob/main/tools/contributed/sumopy/plugins/common/wxgui.py
169689 views
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo1# Copyright (C) 2016-2025 German Aerospace Center (DLR) and others.2# SUMOPy module3# Copyright (C) 2012-2021 University of Bologna - DICAM4# This program and the accompanying materials are made available under the5# terms of the Eclipse Public License 2.0 which is available at6# https://www.eclipse.org/legal/epl-2.0/7# This Source Code may also be made available under the following Secondary8# Licenses when the conditions for such availability set forth in the Eclipse9# Public License 2.0 are satisfied: GNU General Public License, version 210# or later which is available at11# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html12# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1314# @file wxgui.py15# @author Joerg Schweizer16# @date 20121718import os1920from agilepy.lib_wx.modulegui import ModuleGui212223class WxGui(ModuleGui):24"""Contains functions that communicate between the widgets of the main wx gui25and the functions of the plugin.26"""2728def __init__(self, ident):29self._init_common(ident, priority=100000,30icondirpath=os.path.join(os.path.dirname(__file__), 'images'))3132def get_module(self):33return None3435def init_widgets(self, mainframe):36"""37Set mainframe and initialize widgets to various places.38"""39self._mainframe = mainframe40#self._neteditor = mainframe.add_view("Network", Neteditor)4142# mainframe.browse_obj(self._module)43self.make_menu()44self.make_toolbar()4546def refresh_widgets(self):47"""48Check through mainframe what the state of the application is49and reset widgets. For exampe enable/disable widgets50dependent on the availability of data.51"""52pass5354def make_menu(self):55menubar = self._mainframe.menubar56menubar.append_menu('plugins')5758# menubar.append_item( 'demand/browse',59# self.on_browse_obj, # common function in modulegui60# info='View and browse demand in object panel.',61# bitmap = self.get_agileicon('icon_browse_24px.png'),#,62# )636465