Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tools/contributed/sumopy/plugins/common/wxgui.py
169689 views
1
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
2
# Copyright (C) 2016-2025 German Aerospace Center (DLR) and others.
3
# SUMOPy module
4
# Copyright (C) 2012-2021 University of Bologna - DICAM
5
# This program and the accompanying materials are made available under the
6
# terms of the Eclipse Public License 2.0 which is available at
7
# https://www.eclipse.org/legal/epl-2.0/
8
# This Source Code may also be made available under the following Secondary
9
# Licenses when the conditions for such availability set forth in the Eclipse
10
# Public License 2.0 are satisfied: GNU General Public License, version 2
11
# or later which is available at
12
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
13
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
14
15
# @file wxgui.py
16
# @author Joerg Schweizer
17
# @date 2012
18
19
import os
20
21
from agilepy.lib_wx.modulegui import ModuleGui
22
23
24
class WxGui(ModuleGui):
25
"""Contains functions that communicate between the widgets of the main wx gui
26
and the functions of the plugin.
27
"""
28
29
def __init__(self, ident):
30
self._init_common(ident, priority=100000,
31
icondirpath=os.path.join(os.path.dirname(__file__), 'images'))
32
33
def get_module(self):
34
return None
35
36
def init_widgets(self, mainframe):
37
"""
38
Set mainframe and initialize widgets to various places.
39
"""
40
self._mainframe = mainframe
41
#self._neteditor = mainframe.add_view("Network", Neteditor)
42
43
# mainframe.browse_obj(self._module)
44
self.make_menu()
45
self.make_toolbar()
46
47
def refresh_widgets(self):
48
"""
49
Check through mainframe what the state of the application is
50
and reset widgets. For exampe enable/disable widgets
51
dependent on the availability of data.
52
"""
53
pass
54
55
def make_menu(self):
56
menubar = self._mainframe.menubar
57
menubar.append_menu('plugins')
58
59
# menubar.append_item( 'demand/browse',
60
# self.on_browse_obj, # common function in modulegui
61
# info='View and browse demand in object panel.',
62
# bitmap = self.get_agileicon('icon_browse_24px.png'),#,
63
# )
64
65