From cb66bdf8195d5bf3b3ef5d0ad9d6f93279f03292 Mon Sep 17 00:00:00 2001 From: Tomas Zigo <50632337+tmszi@users.noreply.github.com> Date: Fri, 15 May 2020 05:26:03 +0200 Subject: [PATCH] wxGUI dbmgr: Fix dbmgr widgets layout on the wxMSW (#637) * wxGUI dbmgr: fix sql simple where sizer widgets layout on the wxMSW * wxGUI dbmgr: fix ComboBox widget vertical position on the wxMSW --- gui/wxpython/dbmgr/base.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gui/wxpython/dbmgr/base.py b/gui/wxpython/dbmgr/base.py index 6583a1bc84a..6fda59f30db 100644 --- a/gui/wxpython/dbmgr/base.py +++ b/gui/wxpython/dbmgr/base.py @@ -61,8 +61,8 @@ from core.debug import Debug from dbmgr.dialogs import ModifyTableRecord, AddColumnDialog from core.settings import UserSettings -from gui_core.wrap import SpinCtrl, Button, TextCtrl, ListCtrl, CheckBox, \ - StaticText, StaticBox, Menu, NewId +from gui_core.wrap import Button, CheckBox, ComboBox, ListCtrl, Menu, \ + NewId, SpinCtrl, StaticBox, StaticText, TextCtrl from core.utils import cmp if sys.version_info.major >= 3: @@ -1208,9 +1208,9 @@ def AddLayer(self, layer, pos=-1): parent=simpleSqlPanel, id=wx.ID_ANY, name='wherePanel') - sqlWhereColumn = wx.ComboBox( + sqlWhereColumn = ComboBox( parent=whereSimpleSqlPanel, id=wx.ID_ANY, size=(150, -1), - style=wx.CB_SIMPLE | wx.CB_READONLY, + style=wx.CB_READONLY, choices=self.dbMgrData['mapDBInfo'].GetColumns( self.dbMgrData['mapDBInfo'].layers[layer]['table'])) sqlWhereColumn.SetSelection(0) @@ -1262,16 +1262,16 @@ def AddLayer(self, layer, pos=-1): sqlSimpleWhereSizer.Add( sqlWhereColumn, - flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, + flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=3) sqlSimpleWhereSizer.Add( sqlWhereCond, - flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, + flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=3) sqlSimpleWhereSizer.Add( sqlWhereValue, proportion=1, - flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.LEFT, + flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=3) whereSimpleSqlPanel.SetSizer(sqlSimpleWhereSizer) simpleSqlSizer.Add(sqlLabel, border=5, pos=(0, 0), @@ -2384,9 +2384,9 @@ def AddLayer(self, layer, pos=-1): label=" %s " % _("Rename column")) renameSizer = wx.StaticBoxSizer(renameBox, wx.HORIZONTAL) - columnFrom = wx.ComboBox( + columnFrom = ComboBox( parent=panel, id=wx.ID_ANY, size=(150, -1), - style=wx.CB_SIMPLE | wx.CB_READONLY, + style=wx.CB_READONLY, choices=self.dbMgrData['mapDBInfo'].GetColumns(table)) columnFrom.SetSelection(0) self.layerPage[layer]['renameCol'] = columnFrom.GetId() @@ -3276,9 +3276,9 @@ def _createDeletePage(self): label = StaticText(parent=self.deletePanel, id=wx.ID_ANY, label='%s:' % _("Layer to remove")) - self.deleteLayer = wx.ComboBox( + self.deleteLayer = ComboBox( parent=self.deletePanel, id=wx.ID_ANY, size=(100, -1), - style=wx.CB_SIMPLE | wx.CB_READONLY, + style=wx.CB_READONLY, choices=list(map(str, self.mapDBInfo.layers.keys()))) self.deleteLayer.SetSelection(0) self.deleteLayer.Bind(wx.EVT_COMBOBOX, self.OnChangeLayer) @@ -3351,9 +3351,9 @@ def _createModifyPage(self): self.modifyLayerWidgets = {'layer': (StaticText(parent=self.modifyPanel, id=wx.ID_ANY, label='%s:' % _("Layer")), - wx.ComboBox(parent=self.modifyPanel, id=wx.ID_ANY, + ComboBox(parent=self.modifyPanel, id=wx.ID_ANY, size=(100, -1), - style=wx.CB_SIMPLE | wx.CB_READONLY, + style=wx.CB_READONLY, choices=list(map(str, self.mapDBInfo.layers.keys())))), 'driver':