Skip to content

Commit

Permalink
wxGUI: BaseToolbar.OnTool needs to be explicitly defined (OSGeo#2632)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa authored and ninsbl committed Feb 17, 2023
1 parent 859cda4 commit edd1f35
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion gui/wxpython/gui_core/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit edd1f35

Please sign in to comment.