New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxGUI/digitizer: fix digitizer - VDigitToolbar.OnTool method was not called #3027
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
539e378
wxGUI/digitizer: fix digitizer - VDigitToolbar.OnTool method was not …
petrasovaa 41e71aa
wxGUI/vdigit: dynamically bind keyboard shortcuts to the actual tools
tmszi ef5d9e7
simplify tool key binding, fix copy-paste error
petrasovaa bfe3547
fix additional cases
petrasovaa File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
||
|
@@ -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: | ||
|
@@ -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() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as previous comment. code line should be: if event:
event.Skip() |
||
|
||
def OnAddPoint(self, event): | ||
"""Add point to the vector map Laier""" | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you try activate Digitize new boundary (Ctrl+B) or Digitize new centroid (Ctrl+C) tool by keyboard shortcut you get error:
code line should be: