Skip to content

Commit

Permalink
wxGUI: fix map display combobox option after switching between toolba…
Browse files Browse the repository at this point in the history
…rs (#2625)
  • Loading branch information
tmszi committed Jan 19, 2023
1 parent cf284fa commit be4349e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions gui/wxpython/mapdisp/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,11 @@ def AddToolbar(self, name, fixed=False):
.BestSize((self.toolbars["map"].GetBestSize())),
)

# nviz
elif name == "nviz":
self.toolbars["map"].combo.SetValue(_("3D view"))
self.AddNviz()

# vector digitizer
elif name == "vdigit":
self.toolbars["map"].combo.SetValue(_("Vector digitizer"))
Expand Down
7 changes: 5 additions & 2 deletions gui/wxpython/mapdisp/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,14 @@ def OnSelectTool(self, event):
if tool == self.toolId["2d"]:
self.ExitToolbars()
self.Enable2D(True)
self.parent.MapWindow.SetFocus()

elif tool == self.toolId["3d"] and not (
self.parent.MapWindow3D and self.parent.IsPaneShown("3d")
):
self.ExitToolbars()
self.parent.AddNviz()
self.parent.AddToolbar("nviz")
self.parent.MapWindow.SetFocus()

elif tool == self.toolId["vdigit"] and not self.parent.GetToolbar("vdigit"):
self.ExitToolbars()
Expand All @@ -308,7 +310,8 @@ def OnSelectTool(self, event):

elif tool == self.toolId["rdigit"]:
self.ExitToolbars()
self.parent.AddRDigit()
self.parent.AddToolbar("rdigit")
self.parent.MapWindow.SetFocus()

def OnAnalyze(self, event):
"""Analysis tools menu"""
Expand Down

0 comments on commit be4349e

Please sign in to comment.