From 61d8804bead23b2fdaae2420ed4dc410e47a73d3 Mon Sep 17 00:00:00 2001 From: Anna Petrasova Date: Sun, 6 Nov 2022 23:11:57 -0500 Subject: [PATCH] wxGUI: BaseToolbar.OnTool needs to be explicitly defined --- gui/wxpython/gui_core/toolbars.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gui/wxpython/gui_core/toolbars.py b/gui/wxpython/gui_core/toolbars.py index c88c0b0aab5..28c02d3a795 100644 --- a/gui/wxpython/gui_core/toolbars.py +++ b/gui/wxpython/gui_core/toolbars.py @@ -87,7 +87,12 @@ class ToolbarController: - """Controller specialized for wx.ToolBar subclass.""" + """Controller specialized for wx.ToolBar subclass. + + Toolbar subclasses must delegate methods to controller. + Methods inherited from toolbar class must be delegated explicitly + and other methods can be delegated by @c __getattr__. + """ def __init__(self, classObject, widget, parent, toolSwitcher): """ @@ -372,6 +377,10 @@ def CreateTool(self, *args, **kwargs): """@copydoc ToolbarController::CreateTool()""" self.controller.CreateTool(*args, **kwargs) + def OnTool(self, event): + """@copydoc ToolbarController::OnTool()""" + self.controller.OnTool(event) + def __getattr__(self, name): return getattr(self.controller, name) @@ -416,6 +425,10 @@ def CreateTool(self, *args, **kwargs): """@copydoc ToolbarController::CreateTool()""" self.controller.CreateTool(*args, **kwargs) + def OnTool(self, event): + """@copydoc ToolbarController::OnTool()""" + self.controller.OnTool(event) + def __getattr__(self, name): return getattr(self.controller, name)