From 71b20dbf569b9bd0768d8dfb47ca48e78a063618 Mon Sep 17 00:00:00 2001 From: Tomas Zigo <50632337+tmszi@users.noreply.github.com> Date: Sat, 16 Jul 2022 18:03:14 +0200 Subject: [PATCH] wxGUI/gui_core: fix imagery create/edit group dialog deselect all maps (#2465) --- gui/wxpython/gui_core/dialogs.py | 10 +++++++--- gui/wxpython/gui_core/wrap.py | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gui/wxpython/gui_core/dialogs.py b/gui/wxpython/gui_core/dialogs.py index 2f298dfc740..60c6f186182 100644 --- a/gui/wxpython/gui_core/dialogs.py +++ b/gui/wxpython/gui_core/dialogs.py @@ -60,6 +60,7 @@ StaticBox, StaticText, TextCtrl, + ListBox, ) @@ -834,9 +835,12 @@ def _createDialogBody(self): sizer = wx.BoxSizer(wx.HORIZONTAL) - self.gLayerBox = wx.ListBox( - parent=self.gListPanel, id=wx.ID_ANY, size=(-1, 150), - style=wx.LB_MULTIPLE | wx.LB_NEEDED_SB) + self.gLayerBox = ListBox( + parent=self.gListPanel, + id=wx.ID_ANY, + size=(-1, 150), + style=wx.LB_MULTIPLE | wx.LB_NEEDED_SB, + ) sizer.Add(self.gLayerBox, proportion=1, flag=wx.EXPAND) self.addLayer = Button(self.gListPanel, id=wx.ID_ADD) diff --git a/gui/wxpython/gui_core/wrap.py b/gui/wxpython/gui_core/wrap.py index 7cc2282d59b..72324ee8364 100644 --- a/gui/wxpython/gui_core/wrap.py +++ b/gui/wxpython/gui_core/wrap.py @@ -762,6 +762,10 @@ def SetToolTip(self, tip): else: wx.ListBox.SetToolTipString(self, tip) + def DeselectAll(self): + for i in range(self.GetCount()): + self.Deselect(i) + class HyperlinkCtrl(HyperlinkCtrl_): """Wrapper around HyperlinkCtrl to have more control