From ec7e8a6249bc3cdb10e6332e41101830e14143ff Mon Sep 17 00:00:00 2001 From: Anna Petrasova Date: Fri, 11 Nov 2022 00:12:13 -0500 Subject: [PATCH] wxGUI: BaseToolbar.OnTool needs to be explicitly defined (#2632) Fixes #2626 --- 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)