Skip to content

Commit

Permalink
wxGUI/digitizer: fix digitizer - VDigitToolbar.OnTool method was not …
Browse files Browse the repository at this point in the history
…called
  • Loading branch information
petrasovaa committed Jun 6, 2023
1 parent a5f8548 commit fff7177
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gui/wxpython/vdigit/toolbars.py
Expand Up @@ -54,6 +54,9 @@ def __init__(self, parent, toolSwitcher, MapWindow, digitClass, giface, tools=[]
self.editingStopped.connect(layerTree.StopEditing)
self.editingBgMap.connect(layerTree.SetBgMapForEditing)

# replace OnTool from controller
self.controller.OnTool = self.OnTool

# bind events
self.Bind(wx.EVT_SHOW, self.OnShow)

Expand Down Expand Up @@ -446,14 +449,15 @@ def OnTool(self, event):
3,
f"VDigitToolbar.OnTool(): id = {event.GetId() if event else event}",
)
if self.toolSwitcher:
self.toolSwitcher.ToolChanged(event.GetId())

# set cursor
self.MapWindow.SetNamedCursor("cross")
self.MapWindow.mouse["box"] = "point"
self.MapWindow.mouse["use"] = "pointer"

aId = self.action.get("id", -1)
if event:
BaseToolbar.OnTool(self, event)

# clear tmp canvas
if self.action["id"] != aId or aId == -1:
Expand All @@ -467,8 +471,7 @@ def OnTool(self, event):
if self.action["id"] == -1:
self.action = {"desc": "", "type": "", "id": -1}

# set focus
self.MapWindow.SetFocus()
event.Skip()

def OnAddPoint(self, event):
"""Add point to the vector map Laier"""
Expand Down

0 comments on commit fff7177

Please sign in to comment.