瀏覽代碼

wxGUI: important fixes for wxPython 4.1.0 with wxWidgets 3.1 (#570)

wxWidgets started to throw assert errors for some incorrect combinations of flags in layout, so that's majority of included changes.

Other fixes:

* create wrapper for CheckListCtrlMixin which interferes with ListCtrl in wx 4.1.0

* wxGUI: set fixed position of toolbars in a row, previously, the position was based on the order of 
  adding panes, which was platform dependent. Now, a fixed position is supplied.

* fix r.mapcalc layout

* removed no longer existing SplitterWindow method

* other small breakages in wxwidgets API
Anna Petrasova 5 年之前
父節點
當前提交
9ff008446c
共有 45 個文件被更改,包括 305 次插入320 次删除
  1. 8 8
      gui/wxpython/animation/dialogs.py
  2. 36 42
      gui/wxpython/animation/frame.py
  3. 3 1
      gui/wxpython/animation/mapwindow.py
  4. 1 1
      gui/wxpython/datacatalog/frame.py
  5. 5 9
      gui/wxpython/dbmgr/base.py
  6. 1 1
      gui/wxpython/dbmgr/dialogs.py
  7. 3 3
      gui/wxpython/dbmgr/manager.py
  8. 3 4
      gui/wxpython/dbmgr/sqlbuilder.py
  9. 15 15
      gui/wxpython/gcp/manager.py
  10. 5 5
      gui/wxpython/gmodeler/dialogs.py
  11. 6 6
      gui/wxpython/gmodeler/frame.py
  12. 1 1
      gui/wxpython/gmodeler/model.py
  13. 1 1
      gui/wxpython/gmodeler/preferences.py
  14. 9 10
      gui/wxpython/gui_core/dialogs.py
  15. 13 14
      gui/wxpython/gui_core/forms.py
  16. 1 1
      gui/wxpython/gui_core/ghelp.py
  17. 11 8
      gui/wxpython/gui_core/goutput.py
  18. 2 2
      gui/wxpython/gui_core/gselect.py
  19. 0 1
      gui/wxpython/gui_core/menu.py
  20. 7 7
      gui/wxpython/gui_core/preferences.py
  21. 1 3
      gui/wxpython/gui_core/prompt.py
  22. 7 7
      gui/wxpython/gui_core/widgets.py
  23. 29 0
      gui/wxpython/gui_core/wrap.py
  24. 1 1
      gui/wxpython/iclass/dialogs.py
  25. 13 26
      gui/wxpython/iclass/frame.py
  26. 7 7
      gui/wxpython/image2target/ii2t_manager.py
  27. 1 1
      gui/wxpython/iscatt/dialogs.py
  28. 11 15
      gui/wxpython/lmgr/frame.py
  29. 2 2
      gui/wxpython/lmgr/pyshell.py
  30. 0 5
      gui/wxpython/location_wizard/wizard.py
  31. 1 1
      gui/wxpython/mapswipe/dialogs.py
  32. 34 44
      gui/wxpython/mapswipe/frame.py
  33. 3 3
      gui/wxpython/modules/colorrules.py
  34. 1 1
      gui/wxpython/modules/extensions.py
  35. 2 2
      gui/wxpython/modules/import_export.py
  36. 7 7
      gui/wxpython/modules/mcalc_builder.py
  37. 1 1
      gui/wxpython/nviz/tools.py
  38. 7 7
      gui/wxpython/photo2image/ip2i_manager.py
  39. 9 12
      gui/wxpython/psmap/dialogs.py
  40. 2 0
      gui/wxpython/psmap/frame.py
  41. 7 7
      gui/wxpython/vdigit/dialogs.py
  42. 3 3
      gui/wxpython/vdigit/preferences.py
  43. 4 4
      gui/wxpython/vnet/dialogs.py
  44. 2 2
      gui/wxpython/vnet/widgets.py
  45. 19 19
      gui/wxpython/wxplot/dialogs.py

+ 8 - 8
gui/wxpython/animation/dialogs.py

@@ -204,7 +204,7 @@ class SpeedDialog(wx.Dialog):
         btnStdSizer.Realize()
 
         mainSizer.Add(btnStdSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -367,7 +367,7 @@ class InputDialog(wx.Dialog):
         btnStdSizer.Realize()
 
         sizer.Add(btnStdSizer, proportion=0,
-                  flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5)
+                  flag=wx.EXPAND | wx.ALL, border=5)
         self.SetSizer(sizer)
         sizer.Fit(self)
 
@@ -528,7 +528,7 @@ class InputDialog(wx.Dialog):
         hbox.Add(
             self.fileSelector,
             proportion=1,
-            flag=wx.EXPAND | wx.ALIGN_CENTER)
+            flag=wx.EXPAND)
         dataBoxSizer.Add(
             hbox,
             proportion=0,
@@ -821,7 +821,7 @@ class EditDialog(wx.Dialog):
         btnStdSizer.Realize()
 
         mainSizer.Add(btnStdSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -941,7 +941,7 @@ class ExportDialog(wx.Dialog):
             page=self._createDecorationsPanel(notebook),
             text=_("Decorations"))
         mainSizer.Add(notebook, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.btnExport = Button(self, wx.ID_OK)
         self.btnExport.SetLabel(_("Export"))
@@ -957,7 +957,7 @@ class ExportDialog(wx.Dialog):
         btnStdSizer.Realize()
 
         mainSizer.Add(btnStdSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
         self.SetSizer(mainSizer)
 
         # set the longest option to fit
@@ -1179,7 +1179,7 @@ class ExportDialog(wx.Dialog):
         hSizer.Add(
             self.formatChoice,
             proportion=1,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.ALL,
+            flag=wx.EXPAND | wx.ALL,
             border=2)
         borderSizer.Add(
             hSizer,
@@ -1357,7 +1357,7 @@ class ExportDialog(wx.Dialog):
         borderSizer.Add(
             fpsSizer,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALL,
             border=5)
 
         panel.SetSizer(borderSizer)

+ 36 - 42
gui/wxpython/animation/frame.py

@@ -112,12 +112,7 @@ class AnimationFrame(wx.Frame):
 
         # toolbars
         self.toolbars = {}
-        tb = ['miscToolbar', 'animationToolbar', 'mainToolbar']
-        if sys.platform == 'win32':
-            tb.reverse()
-        for toolb in tb:
-            self._addToolbar(toolb)
-
+        self._addToolbars()
         self._addPanes()
         self._mgr.Update()
 
@@ -146,46 +141,45 @@ class AnimationFrame(wx.Frame):
                     slider.GetBestSize()). DestroyOnClose(True).CloseButton(False).Bottom())
             self._mgr.GetPane('slider_' + name).Hide()
 
-    def _addToolbar(self, name):
-        """Add defined toolbar to the window
+    def _addToolbars(self):
+        """Add toolbars to the window
 
         Currently known toolbars are:
          - 'mainToolbar'          - data management
          - 'animationToolbar'     - animation controls
          - 'miscToolbar'          - help, close
         """
-        if name == "mainToolbar":
-            self.toolbars[name] = MainToolbar(self)
-            self._mgr.AddPane(self.toolbars[name],
-                              wx.aui.AuiPaneInfo().
-                              Name('mainToolbar').Caption(_("Main Toolbar")).
-                              ToolbarPane().Top().
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(True).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
-                              BestSize((self.toolbars['mainToolbar'].GetBestSize())))
-        elif name == 'animationToolbar':
-            self.toolbars[name] = AnimationToolbar(self)
-            self._mgr.AddPane(self.toolbars[name],
-                              wx.aui.AuiPaneInfo().
-                              Name('animationToolbar').Caption(_("Animation Toolbar")).
-                              ToolbarPane().Top().
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(True).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
-                              BestSize((self.toolbars['animationToolbar'].GetBestSize())))
-            self.controller.SetAnimationToolbar(
-                self.toolbars['animationToolbar'])
-        elif name == 'miscToolbar':
-            self.toolbars[name] = MiscToolbar(self)
-            self._mgr.AddPane(self.toolbars[name],
-                              wx.aui.AuiPaneInfo().
-                              Name('miscToolbar').Caption(_("Misc Toolbar")).
-                              ToolbarPane().Top().
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(True).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
-                              BestSize((self.toolbars['miscToolbar'].GetBestSize())))
+        self.toolbars["mainToolbar"] = MainToolbar(self)
+        self._mgr.AddPane(self.toolbars["mainToolbar"],
+                          wx.aui.AuiPaneInfo().
+                          Name('mainToolbar').Caption(_("Main Toolbar")).
+                          ToolbarPane().Top().
+                          LeftDockable(False).RightDockable(False).
+                          BottomDockable(True).TopDockable(True).
+                          CloseButton(False).Layer(2).Row(1).Position(0).
+                          BestSize((self.toolbars['mainToolbar'].GetBestSize())))
+
+        self.toolbars['animationToolbar'] = AnimationToolbar(self)
+        self._mgr.AddPane(self.toolbars['animationToolbar'],
+                          wx.aui.AuiPaneInfo().
+                          Name('animationToolbar').Caption(_("Animation Toolbar")).
+                          ToolbarPane().Top().
+                          LeftDockable(False).RightDockable(False).
+                          BottomDockable(True).TopDockable(True).
+                          CloseButton(False).Layer(2).Row(1).Position(1).
+                          BestSize((self.toolbars['animationToolbar'].GetBestSize())))
+        self.controller.SetAnimationToolbar(
+            self.toolbars['animationToolbar'])
+
+        self.toolbars['miscToolbar'] = MiscToolbar(self)
+        self._mgr.AddPane(self.toolbars['miscToolbar'],
+                          wx.aui.AuiPaneInfo().
+                          Name('miscToolbar').Caption(_("Misc Toolbar")).
+                          ToolbarPane().Top().
+                          LeftDockable(False).RightDockable(False).
+                          BottomDockable(True).TopDockable(True).
+                          CloseButton(False).Layer(2).Row(1).Position(2).
+                          BestSize((self.toolbars['miscToolbar'].GetBestSize())))
 
     def SetAnimations(self, layerLists):
         """Set animation data
@@ -487,7 +481,7 @@ class SimpleAnimationSlider(AnimationSliderBase):
         hbox.Add(
             self.slider,
             proportion=1,
-            flag=wx.ALIGN_CENTER | wx.EXPAND,
+            flag=wx.EXPAND,
             border=0)
         self.SetSizerAndFit(hbox)
 
@@ -541,7 +535,7 @@ class TimeAnimationSlider(AnimationSliderBase):
         hbox.Add(
             self.slider,
             proportion=1,
-            flag=wx.ALIGN_CENTER | wx.EXPAND,
+            flag=wx.EXPAND,
             border=0)
         vbox.Add(hbox, proportion=0, flag=wx.EXPAND, border=0)
 

+ 3 - 1
gui/wxpython/animation/mapwindow.py

@@ -71,7 +71,9 @@ class BufferedWindow(wx.Window):
         # Make new offscreen bitmap: this bitmap will always have the
         # current drawing in it, so it can be used to save the image to
         # a file, or whatever.
-        self._Buffer = EmptyBitmap(*size)
+        w = max(size[0], 20)
+        h = max(size[1], 20)
+        self._Buffer = EmptyBitmap(w, h)
         self.UpdateDrawing()
         # event.Skip()
 

+ 1 - 1
gui/wxpython/datacatalog/frame.py

@@ -81,7 +81,7 @@ class DataCatalogFrame(wx.Frame):
         btnSizer.Add(self.btnClose)
 
         sizer.Add(btnSizer, proportion=0,
-                  flag=wx.ALL | wx.ALIGN_RIGHT | wx.EXPAND,
+                  flag=wx.ALL | wx.EXPAND,
                   border=5)
 
         self.panel.SetSizer(sizer)

+ 5 - 9
gui/wxpython/dbmgr/base.py

@@ -2376,7 +2376,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         btnAddCol.Bind(wx.EVT_BUTTON, self.OnTableItemAdd)
         btnAddCol.Enable(False)
         self.layerPage[layer]['addColButton'] = btnAddCol.GetId()
-        addSizer.Add(btnAddCol, flag=wx.ALL | wx.ALIGN_RIGHT | wx.EXPAND,
+        addSizer.Add(btnAddCol, flag=wx.ALL | wx.EXPAND,
                      border=3)
 
         # manage columns (rename)
@@ -2426,7 +2426,7 @@ class DbMgrTablesPage(DbMgrNotebookBase):
         self.layerPage[layer]['renameColButton'] = btnRenameCol.GetId()
         renameSizer.Add(
             btnRenameCol,
-            flag=wx.ALL | wx.ALIGN_RIGHT | wx.EXPAND,
+            flag=wx.ALL | wx.EXPAND,
             border=3)
 
         tableSizer.Add(tlist,
@@ -3221,7 +3221,7 @@ class LayerBook(wx.Notebook):
 
         btnSizer.Add(btnLayer,
                      proportion=0,
-                     flag=wx.ALL | wx.ALIGN_RIGHT,
+                     flag=wx.ALL,
                      border=5)
 
         layerSizer.Add(btnSizer,
@@ -3246,7 +3246,7 @@ class LayerBook(wx.Notebook):
 
         tableSizer.Add(btnTable,
                        proportion=0,
-                       flag=wx.ALL | wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT,
+                       flag=wx.ALL | wx.ALIGN_RIGHT,
                        border=5)
 
         pageSizer.Add(layerSizer,
@@ -3258,11 +3258,7 @@ class LayerBook(wx.Notebook):
                       proportion=2,
                       flag=wx.TOP | wx.BOTTOM | wx.RIGHT | wx.EXPAND,
                       border=3)
-
-        # SetVirtualSizeHints is deprecated and is
-        # exactly the same as FitInside() in wxWidgets 2.9 and later
-        getattr(layerSizer, 'FitInside',
-                layerSizer.SetVirtualSizeHints)(self.addPanel)
+        layerSizer.FitInside(self.addPanel)
 
         self.addPanel.SetAutoLayout(True)
         self.addPanel.SetSizer(pageSizer)

+ 1 - 1
gui/wxpython/dbmgr/dialogs.py

@@ -162,7 +162,7 @@ class DisplayAttributesDialog(wx.Dialog):
             flag=wx.EXPAND | wx.LEFT | wx.RIGHT,
             border=5)
         mainSizer.Add(btnSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         # bindigs
         btnReset.Bind(wx.EVT_BUTTON, self.OnReset)

+ 3 - 3
gui/wxpython/dbmgr/manager.py

@@ -169,11 +169,11 @@ class AttributeManager(wx.Frame, DbMgrBase):
         # buttons
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         btnSizer.Add(self.btnReset, proportion=1,
-                     flag=wx.ALL | wx.ALIGN_RIGHT, border=5)
+                     flag=wx.ALL, border=5)
         btnSizer.Add(self.btnReload, proportion=1,
-                     flag=wx.ALL | wx.ALIGN_RIGHT, border=5)
+                     flag=wx.ALL, border=5)
         btnSizer.Add(self.btnClose, proportion=1,
-                     flag=wx.ALL | wx.ALIGN_RIGHT, border=5)
+                     flag=wx.ALL, border=5)
 
         mainSizer.Add(self.notebook, proportion=1, flag=wx.EXPAND)
         mainSizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.ALL, border=5)

+ 3 - 4
gui/wxpython/dbmgr/sqlbuilder.py

@@ -242,7 +242,7 @@ class SQLBuilder(wx.Frame):
 
             self.mode.SetSelection(1)  # default 'values'
             modesizer.Add(self.mode, proportion=1,
-                          flag=wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, border=5)
+                          flag=wx.EXPAND, border=5)
 
         # self.list_columns.SetMinSize((-1,130))
         # self.list_values.SetMinSize((-1,100))
@@ -271,9 +271,8 @@ class SQLBuilder(wx.Frame):
 
         buttonsizer3 = wx.BoxSizer(wx.HORIZONTAL)
         buttonsizer3.Add(self.btn_uniquesample, proportion=0,
-                         flag=wx.ALIGN_CENTER_HORIZONTAL | wx.RIGHT, border=5)
-        buttonsizer3.Add(self.btn_unique, proportion=0,
-                         flag=wx.ALIGN_CENTER_HORIZONTAL)
+                         flag=wx.RIGHT, border=5)
+        buttonsizer3.Add(self.btn_unique, proportion=0)
 
         valuesizer.Add(buttonsizer3, proportion=0,
                        flag=wx.TOP, border=5)

+ 15 - 15
gui/wxpython/gcp/manager.py

@@ -35,7 +35,7 @@ import six
 from copy import copy
 
 import wx
-from wx.lib.mixins.listctrl import CheckListCtrlMixin, ColumnSorterMixin, ListCtrlAutoWidthMixin
+from wx.lib.mixins.listctrl import ColumnSorterMixin, ListCtrlAutoWidthMixin
 import wx.lib.colourselect as csel
 
 from core import globalvar
@@ -58,7 +58,7 @@ from core.settings import UserSettings
 from gcp.mapdisplay import MapFrame
 from core.giface import Notification
 from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
-    CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage
+    CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage, CheckListCtrlMixin
 
 from location_wizard.wizard import TitledPage as TitledPage
 
@@ -1295,7 +1295,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         # changed
         itemIndex += 1
 
-        if not self.list.IsChecked(key - 1):
+        if not self.list.IsItemChecked(key - 1):
             wxPen = "unused"
             if not self.show_unused:
                 item.SetPropertyVal('hide', True)
@@ -1395,7 +1395,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 "#-----------------------     -----------------------     ---------------\n")
 
             for index in range(self.list.GetItemCount()):
-                if self.list.IsChecked(index):
+                if self.list.IsItemChecked(index):
                     check = "1"
                     self.GCPcount += 1
                 else:
@@ -1696,7 +1696,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         highest_idx = 0
 
         for index in range(self.list.GetItemCount()):
-            if self.list.IsChecked(index):
+            if self.list.IsItemChecked(index):
                 key = self.list.GetItemData(index)
                 fwd_err = self.mapcoordlist[key][5]
 
@@ -1829,7 +1829,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
         for index in range(self.list.GetItemCount()):
             key = self.list.GetItemData(index)
-            if self.list.IsChecked(index):
+            if self.list.IsItemChecked(index):
                 fwd_err, bkw_err = errlist[GCPcount].split()
                 self.list.SetItem(index, 5, fwd_err)
                 self.list.SetItem(index, 6, bkw_err)
@@ -1867,7 +1867,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             self.list.SetItemTextColour(highest_idx, wx.RED)
         elif GCPcount > 0 and self.rmsthresh > 0 and not self.highest_only:
             for index in range(self.list.GetItemCount()):
-                if self.list.IsChecked(index):
+                if self.list.IsItemChecked(index):
                     key = self.list.GetItemData(index)
                     if (self.mapcoordlist[key][5] > self.rmsthresh):
                         self.list.SetItemTextColour(index, wx.RED)
@@ -2883,12 +2883,12 @@ class GrSettingsDialog(wx.Dialog):
                 id=wx.ID_ANY,
                 label=_('Select source map to display:')),
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
         sizer.Add(
             self.srcselection,
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
         self.srcselection.SetValue(src_map)
         sizer.Add(
@@ -2897,12 +2897,12 @@ class GrSettingsDialog(wx.Dialog):
                 id=wx.ID_ANY,
                 label=_('Select target raster map to display:')),
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
         sizer.Add(
             self.tgtrastselection,
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
         self.tgtrastselection.SetValue(tgt_map['raster'])
         sizer.Add(
@@ -2911,12 +2911,12 @@ class GrSettingsDialog(wx.Dialog):
                 id=wx.ID_ANY,
                 label=_('Select target vector map to display:')),
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
         sizer.Add(
             self.tgtvectselection,
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
         self.tgtvectselection.SetValue(tgt_map['vector'])
 
@@ -2988,7 +2988,7 @@ class GrSettingsDialog(wx.Dialog):
                 id=wx.ID_ANY,
                 label=_('Extension for output maps:')),
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
         self.ext_txt = TextCtrl(
             parent=panel, id=wx.ID_ANY, value="", size=(
@@ -2997,7 +2997,7 @@ class GrSettingsDialog(wx.Dialog):
         sizer.Add(
             self.ext_txt,
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALIGN_LEFT | wx.ALL,
             border=5)
 
         # bindings

+ 5 - 5
gui/wxpython/gmodeler/dialogs.py

@@ -40,7 +40,7 @@ from gui_core.gselect import Select, ElementSelect
 from gmodeler.model import *
 from lmgr.menudata import LayerManagerMenuData
 from gui_core.wrap import Button, StaticText, StaticBox, TextCtrl, \
-    Menu, ListCtrl, NewId
+    Menu, ListCtrl, NewId, CheckListCtrlMixin
 
 from grass.script import task as gtask
 
@@ -258,7 +258,7 @@ class ModelSearchDialog(wx.Dialog):
         mainSizer.Add(labelSizer, proportion=1,
                       flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=3)
         mainSizer.Add(btnSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.panel.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -1067,7 +1067,7 @@ class ItemListCtrl(ModelListCtrl):
                 wx.LIST_STATE_SELECTED | wx.LIST_STATE_FOCUSED)
 
 
-class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
+class ItemCheckListCtrl(ItemListCtrl, CheckListCtrlMixin):
 
     def __init__(self, parent, shape, columns, frame, **kwargs):
         self.parent = parent
@@ -1075,7 +1075,7 @@ class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
 
         ItemListCtrl.__init__(self, parent, columns, frame,
                               disablePopup=True, **kwargs)
-        listmix.CheckListCtrlMixin.__init__(self)
+        CheckListCtrlMixin.__init__(self)
         self.SetColumnWidth(0, 100)
 
         self.shape = shape
@@ -1099,7 +1099,7 @@ class ItemCheckListCtrl(ItemListCtrl, listmix.CheckListCtrlMixin):
 
         # action ids start at 1
         for i in range(self.GetItemCount()):
-            if self.IsChecked(i):
+            if self.IsItemChecked(i):
                 ids['checked'].append(self.itemIdMap[i])
             else:
                 ids['unchecked'].append(self.itemIdMap[i])

+ 6 - 6
gui/wxpython/gmodeler/frame.py

@@ -1815,9 +1815,9 @@ class VariablePanel(wx.Panel):
 
         mainSizer = wx.BoxSizer(wx.VERTICAL)
         mainSizer.Add(listSizer, proportion=1,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
         mainSizer.Add(addSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALIGN_CENTER |
+                      flag=wx.EXPAND |
                       wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5)
 
         self.SetSizer(mainSizer)
@@ -1924,9 +1924,9 @@ class ItemPanel(wx.Panel):
 
         mainSizer = wx.BoxSizer(wx.HORIZONTAL)
         mainSizer.Add(listSizer, proportion=1,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=3)
+                      flag=wx.EXPAND | wx.ALL, border=3)
         mainSizer.Add(manageSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=3)
+                      flag=wx.EXPAND | wx.ALL, border=3)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -2011,9 +2011,9 @@ class PythonPanel(wx.Panel):
                      flag=wx.LEFT | wx.RIGHT, border=5)
         btnSizer.AddStretchSpacer()
         btnSizer.Add(self.btnSaveAs, proportion=0,
-                     flag=wx.RIGHT | wx.ALIGN_RIGHT, border=5)
+                     flag=wx.RIGHT, border=5)
         btnSizer.Add(self.btnRun, proportion=0,
-                     flag=wx.RIGHT | wx.ALIGN_RIGHT, border=5)
+                     flag=wx.RIGHT, border=5)
 
         sizer.Add(bodySizer, proportion=1,
                   flag=wx.EXPAND | wx.ALL, border=3)

+ 1 - 1
gui/wxpython/gmodeler/model.py

@@ -2926,7 +2926,7 @@ class ModelParamDialog(wx.Dialog):
                           flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5)
 
         mainSizer.Add(btnSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)

+ 1 - 1
gui/wxpython/gmodeler/preferences.py

@@ -751,7 +751,7 @@ class PropertiesDialog(wx.Dialog):
             flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
             border=5)
         mainSizer.Add(btnStdSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)

+ 9 - 10
gui/wxpython/gui_core/dialogs.py

@@ -87,7 +87,7 @@ class SimpleDialog(wx.Dialog):
         btnSizer.Realize()
 
         self.sizer.Add(self.dataSizer, proportion=1,
-                       flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                       flag=wx.EXPAND | wx.ALL, border=5)
 
         # self.sizer.Add(item = self.informLabel, proportion = 0, flag = wx.ALL, border = 5)
         self.sizer.Add(btnSizer, proportion=0,
@@ -734,7 +734,7 @@ class GroupDialog(wx.Dialog):
         bodySizer.Add(StaticText(parent=self, id=wx.ID_ANY,
                                  label=_("Select existing group or "
                                             "enter name of new group:")),
-                      flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP, border=10)
+                      flag=wx.TOP, border=10)
         self.groupSelect = Select(parent=self, type='group',
                                   mapsets=[grass.gisenv()['MAPSET']],
                                   size=globalvar.DIALOG_GSELECT_SIZE,
@@ -746,7 +746,7 @@ class GroupDialog(wx.Dialog):
                                       label=_("Edit/create subgroup"))
 
         bodySizer.Add(self.subg_chbox,
-                      flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP, border=10)
+                      flag=wx.TOP, border=10)
 
         self.subg_panel = wx.Panel(self)
         subg_sizer = wx.BoxSizer(wx.VERTICAL)
@@ -757,8 +757,7 @@ class GroupDialog(wx.Dialog):
                 id=wx.ID_ANY,
                 label=_(
                     "Select existing subgroup or "
-                    "enter name of new subgroup:")),
-            flag=wx.ALIGN_CENTER_VERTICAL)
+                    "enter name of new subgroup:")))
 
         self.subGroupSelect = SubGroupSelect(parent=self.subg_panel)
 
@@ -898,7 +897,7 @@ class GroupDialog(wx.Dialog):
         self.infoLabel = StaticText(parent=self, id=wx.ID_ANY)
         bodySizer.Add(
             self.infoLabel,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.BOTTOM,
+            flag=wx.TOP | wx.BOTTOM,
             border=5)
 
         # bindings
@@ -1424,7 +1423,7 @@ class MapLayersDialogBase(wx.Dialog):
         self.btnSizer.Realize()
 
         self.mainSizer.Add(self.btnSizer, proportion=0,
-                           flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                           flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(self.mainSizer)
         self.mainSizer.Fit(self)
@@ -1800,12 +1799,12 @@ class SetOpacityDialog(wx.Dialog):
                 pos=(1, 1))
 
         sizer.Add(box, proportion=0,
-                  flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5)
+                  flag=wx.EXPAND | wx.ALL, border=5)
 
         line = wx.StaticLine(parent=panel, id=wx.ID_ANY,
                              style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0,
-                  flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5)
+                  flag=wx.EXPAND | wx.ALL, border=5)
 
         # buttons
         btnsizer = wx.StdDialogButtonSizer()
@@ -1823,7 +1822,7 @@ class SetOpacityDialog(wx.Dialog):
         btnsizer.Realize()
 
         sizer.Add(btnsizer, proportion=0,
-                  flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=5)
+                  flag=wx.EXPAND | wx.ALL, border=5)
 
         panel.SetSizer(sizer)
         sizer.Fit(panel)

+ 13 - 14
gui/wxpython/gui_core/forms.py

@@ -535,7 +535,7 @@ class TaskFrame(wx.Frame):
         self.description = StaticWrapText(parent=self.panel,
                                           label=module_desc)
         topsizer.Add(self.description, proportion=1, border=5,
-                     flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
+                     flag=wx.ALL | wx.EXPAND)
 
         guisizer.Add(topsizer, proportion=0, flag=wx.EXPAND)
 
@@ -1067,7 +1067,7 @@ class CmdPanel(wx.Panel):
             title_sizer.Add(chk, proportion=1,
                             flag=wx.EXPAND)
             title_sizer.Add(rtitle_txt, proportion=0,
-                            flag=wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL)
+                            flag=wx.ALIGN_CENTER_VERTICAL)
             which_sizer.Add(
                 title_sizer,
                 proportion=0,
@@ -1161,7 +1161,7 @@ class CmdPanel(wx.Panel):
                 title_sizer.Add(
                     rtitle_txt,
                     proportion=0,
-                    flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.TOP,
+                    flag=wx.RIGHT | wx.TOP,
                     border=5)
                 which_sizer.Add(title_sizer, proportion=0,
                                 flag=wx.EXPAND)
@@ -1536,7 +1536,7 @@ class CmdPanel(wx.Panel):
                         which_sizer.Add(
                             selection,
                             proportion=0,
-                            flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                            flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP,
                             border=5)
                     elif prompt == 'group':
                         win = self.FindWindowById(p['wxId'][0])
@@ -1545,7 +1545,7 @@ class CmdPanel(wx.Panel):
                         which_sizer.Add(
                             selection,
                             proportion=0,
-                            flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                            flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP,
                             border=5)
                     else:
                         if prompt in ('stds', 'strds', 'stvds', 'str3ds'):
@@ -1576,19 +1576,19 @@ class CmdPanel(wx.Panel):
                             hSizer.Add(
                                 selection,
                                 proportion=0,
-                                flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                                flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP,
                                 border=5)
                             hSizer.Add(
                                 bb,
                                 proportion=0,
-                                flag=wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                                flag=wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.TOP,
                                 border=5)
                             which_sizer.Add(hSizer)
                         else:
                             which_sizer.Add(
                                 selection,
                                 proportion=0,
-                                flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                                flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP,
                                 border=5)
 
                 # subgroup
@@ -1600,7 +1600,7 @@ class CmdPanel(wx.Panel):
                     which_sizer.Add(
                         selection,
                         proportion=0,
-                        flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                        flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP,
                         border=5)
 
                 # sigrature file
@@ -1613,7 +1613,7 @@ class CmdPanel(wx.Panel):
                     which_sizer.Add(
                         selection,
                         proportion=0,
-                        flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                        flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP,
                         border=5)
 
                 # separator
@@ -1627,7 +1627,7 @@ class CmdPanel(wx.Panel):
                     which_sizer.Add(
                         win,
                         proportion=0,
-                        flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                        flag=wx.ADJUST_MINSIZE | wx.BOTTOM | wx.LEFT | wx.RIGHT | wx.TOP,
                         border=5)
 
                 # layer, dbdriver, dbname, dbcolumn, dbtable entry
@@ -1908,9 +1908,8 @@ class CmdPanel(wx.Panel):
                             border=5)
                         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
                         btnSizer.Add(btnLoad, proportion=0,
-                                     flag=wx.ALIGN_RIGHT | wx.RIGHT, border=10)
-                        btnSizer.Add(btnSave, proportion=0,
-                                     flag=wx.ALIGN_RIGHT)
+                                     flag=wx.RIGHT, border=10)
+                        btnSizer.Add(btnSave, proportion=0)
                         which_sizer.Add(
                             btnSizer,
                             proportion=0,

+ 1 - 1
gui/wxpython/gui_core/ghelp.py

@@ -825,7 +825,7 @@ class HelpPanel(wx.Panel):
                      flag=wx.ALL, border=5)
         btnSizer.Add(wx.Size(1, 1), proportion=1)
         btnSizer.Add(self.btnNext, proportion=0,
-                     flag=wx.ALIGN_RIGHT | wx.ALL, border=5)
+                     flag=wx.ALL, border=5)
 
         sizer.Add(self.content, proportion=1,
                   flag=wx.EXPAND)

+ 11 - 8
gui/wxpython/gui_core/goutput.py

@@ -230,7 +230,7 @@ class GConsoleWindow(wx.SplitterWindow):
             border=5)
 
         outBtnSizer.Add(self.btnOutputSave, proportion=proportion,
-                        flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, border=5)
+                        flag=wx.RIGHT | wx.BOTTOM, border=5)
 
         cmdBtnSizer.Add(
             self.btnCmdProtocol,
@@ -265,11 +265,7 @@ class GConsoleWindow(wx.SplitterWindow):
         self.outputSizer.Fit(self)
         self.outputSizer.SetSizeHints(self)
         self.panelOutput.SetSizer(self.outputSizer)
-        # eliminate gtk_widget_size_allocate() warnings
-        # avoid to use a deprecated method in wxPython >= 2.9
-        getattr(self.outputSizer, 'FitInside',
-                self.outputSizer.SetVirtualSizeHints)(self.panelOutput)
-
+        self.outputSizer.FitInside(self.panelOutput)
         if self._gcstyle & GC_PROMPT:
             promptSizer.Fit(self)
             promptSizer.SetSizeHints(self)
@@ -364,7 +360,11 @@ class GConsoleWindow(wx.SplitterWindow):
 
             p2 = self.cmdOutput.GetCurrentPos()
 
-            self.cmdOutput.StartStyling(p1, 0xff)
+            # between wxWidgets 3.0 and 3.1 they dropped mask param
+            try:
+                self.cmdOutput.StartStyling(p1)
+            except TypeError:
+                self.cmdOutput.StartStyling(p1, 0xff)
             self.cmdOutput.SetStyling(p2 - p1, style)
 
         self.cmdOutput.EnsureCaretVisible()
@@ -773,7 +773,10 @@ class GStc(stc.StyledTextCtrl):
         p2 = self.GetCurrentPos()
 
         if p2 >= p1:
-            self.StartStyling(p1, 0xff)
+            try:
+                self.StartStyling(p1)
+            except TypeError:
+                self.StartStyling(p1, 0xff)
 
             if style == 'error':
                 self.SetStyling(p2 - p1, self.StyleError)

+ 2 - 2
gui/wxpython/gui_core/gselect.py

@@ -1686,7 +1686,7 @@ class GdalSelect(wx.Panel):
         paddingSizer = wx.BoxSizer(wx.VERTICAL)
         sizer = wx.GridBagSizer(vgap=5, hgap=10)
         paddingSizer.Add(self.fileWidgets['browse'],
-                         flag=wx.BOTTOM | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
+                         flag=wx.BOTTOM | wx.EXPAND,
                          border=35)
         sizer.Add(paddingSizer, flag=wx.EXPAND, pos=(0, 0), span=(1, 2))
         sizer.AddGrowableCol(0)
@@ -1828,7 +1828,7 @@ class GdalSelect(wx.Panel):
         sizer = wx.BoxSizer(wx.VERTICAL)
         sizer.Add(StaticText(parent=self.nativePanel,
                              label=_("No settings available")),
-                  flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND, border=5)
+                  flag=wx.ALL | wx.EXPAND, border=5)
         self.nativePanel.SetSizer(sizer)
 
         for panel in (self.nativePanel, self.filePanel,

+ 0 - 1
gui/wxpython/gui_core/menu.py

@@ -123,7 +123,6 @@ class Menu(wx.MenuBar):
         id = event.GetMenuId()
         item = self.FindItemById(id)
         if item:
-            text = item.GetText()
             help = item.GetHelp()
 
         # but in this case just call Skip so the default is done

+ 7 - 7
gui/wxpython/gui_core/preferences.py

@@ -52,7 +52,7 @@ from gui_core.dialogs import SymbolDialog, DefaultFontDialog
 from gui_core.widgets import IntegerValidator, ColorTablesComboBox
 from core.debug import Debug
 from gui_core.wrap import SpinCtrl, Button, BitmapButton, StaticText, \
-    StaticBox, TextCtrl, ListCtrl
+    StaticBox, TextCtrl, ListCtrl, CheckListCtrlMixin
 
 
 class PreferencesBaseDialog(wx.Dialog):
@@ -127,7 +127,7 @@ class PreferencesBaseDialog(wx.Dialog):
         mainSizer.Add(btnSizer, proportion=0,
                       flag=wx.EXPAND, border=0)
         mainSizer.Add(btnStdSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -2144,7 +2144,7 @@ class MapsetAccess(wx.Dialog):
         line = wx.StaticLine(parent=self, id=wx.ID_ANY,
                              style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0,
-                  flag=wx.EXPAND | wx.ALIGN_CENTRE | wx.ALL, border=5)
+                  flag=wx.EXPAND | wx.ALL, border=5)
 
         btnsizer = wx.StdDialogButtonSizer()
         okbtn = Button(self, wx.ID_OK)
@@ -2156,7 +2156,7 @@ class MapsetAccess(wx.Dialog):
         btnsizer.Realize()
 
         sizer.Add(btnsizer, proportion=0,
-                  flag=wx.EXPAND | wx.ALIGN_RIGHT | wx.ALL, border=5)
+                  flag=wx.EXPAND | wx.ALL, border=5)
 
         # do layout
         self.Layout()
@@ -2170,7 +2170,7 @@ class MapsetAccess(wx.Dialog):
         ms = []
         i = 0
         for mset in self.all_mapsets_ordered:
-            if self.mapsetlb.IsChecked(i):
+            if self.mapsetlb.IsItemChecked(i):
                 ms.append(mset)
             i += 1
 
@@ -2178,7 +2178,7 @@ class MapsetAccess(wx.Dialog):
 
 
 class CheckListMapset(
-        ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin):
+        ListCtrl, listmix.ListCtrlAutoWidthMixin, CheckListCtrlMixin):
     """List of mapset/owner/group"""
 
     def __init__(self, parent, log=None):
@@ -2186,7 +2186,7 @@ class CheckListMapset(
 
         ListCtrl.__init__(self, parent, wx.ID_ANY,
                           style=wx.LC_REPORT)
-        listmix.CheckListCtrlMixin.__init__(self)
+        CheckListCtrlMixin.__init__(self)
         self.log = log
 
         # setup mixins

+ 1 - 3
gui/wxpython/gui_core/prompt.py

@@ -384,9 +384,7 @@ class GPromptSTC(GPrompt, wx.stc.StyledTextCtrl):
         """Show sorted auto-completion list if it is not empty"""
         if len(self.autoCompList) > 0:
             self.autoCompList.sort()
-            self.AutoCompShow(
-                lenEntered=0, itemList=' '.join(
-                    self.autoCompList))
+            self.AutoCompShow(0, itemList=' '.join(self.autoCompList))
 
     def OnKeyPressed(self, event):
         """Key pressed capture special treatment for tabulator to show help"""

+ 7 - 7
gui/wxpython/gui_core/widgets.py

@@ -90,7 +90,7 @@ from core import globalvar
 from core.gcmd import GMessage, GError
 from core.debug import Debug
 from gui_core.wrap import Button, SearchCtrl, StaticText, StaticBox, \
-    TextCtrl, Menu, Rect, EmptyBitmap, ListCtrl, NewId
+    TextCtrl, Menu, Rect, EmptyBitmap, ListCtrl, NewId, CheckListCtrlMixin
 
 
 class NotebookController:
@@ -935,7 +935,7 @@ class SingleSymbolPanel(wx.Panel):
 
 
 class GListCtrl(ListCtrl, listmix.ListCtrlAutoWidthMixin,
-                listmix.CheckListCtrlMixin):
+                CheckListCtrlMixin):
     """Generic ListCtrl with popup menu to select/deselect all
     items"""
 
@@ -944,7 +944,7 @@ class GListCtrl(ListCtrl, listmix.ListCtrlAutoWidthMixin,
 
         ListCtrl.__init__(self, parent, id=wx.ID_ANY,
                              style=wx.LC_REPORT)
-        listmix.CheckListCtrlMixin.__init__(self)
+        CheckListCtrlMixin.__init__(self)
 
         # setup mixins
         listmix.ListCtrlAutoWidthMixin.__init__(self)
@@ -1009,7 +1009,7 @@ class GListCtrl(ListCtrl, listmix.ListCtrlAutoWidthMixin,
             if item == -1:
                 break
 
-            isChecked = self.IsChecked(item)
+            isChecked = self.IsItemChecked(item)
             if checked is not None and checked != isChecked:
                 continue
 
@@ -1106,18 +1106,18 @@ class SearchModuleWidget(wx.Panel):
         boxSizer = wx.BoxSizer(wx.VERTICAL)
 
         boxSizer.Add(self._search,
-                     flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.BOTTOM,
+                     flag=wx.EXPAND | wx.BOTTOM,
                      border=5)
         if self._showChoice:
             hSizer = wx.BoxSizer(wx.HORIZONTAL)
             hSizer.Add(self._searchChoice,
-                       flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND | wx.BOTTOM,
+                       flag=wx.EXPAND | wx.BOTTOM,
                        border=5)
             hSizer.AddStretchSpacer()
             boxSizer.Add(hSizer, flag=wx.EXPAND)
         if self._showTip:
             boxSizer.Add(self._searchTip,
-                         flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND)
+                         flag=wx.EXPAND)
 
         sizer.Add(boxSizer, proportion=1)
 

+ 29 - 0
gui/wxpython/gui_core/wrap.py

@@ -313,6 +313,35 @@ class ListCtrl(wx.ListCtrl):
         else:
             return wx.ListCtrl.SetStringItem(self, index=index, col=column, label=label, imageId=imageId)
 
+    def CheckItem(self, item, check=True):
+        """Uses either deprecated listmix.CheckListCtrlMixin
+        or new checkbox implementation in wx.ListCtrl since 4.1.0"""
+        if hasattr(self, 'HasCheckBoxes'):
+            wx.ListCtrl.CheckItem(self, item, check)
+        else:
+            super(ListCtrl, self).CheckItem(item, check)
+
+    def IsItemChecked(self, item):
+        if hasattr(self, 'HasCheckBoxes'):
+            return wx.ListCtrl.IsItemChecked(self, item)
+        else:
+            return super(ListCtrl, self).IsChecked(item)
+
+           
+if CheckWxVersion([4, 1, 0]):
+    class CheckListCtrlMixin():
+        """This class pretends to be deprecated CheckListCtrlMixin mixin and
+        only enables checkboxes in new versions of ListCtrl"""
+        def __init__(self):
+            self.EnableCheckBoxes(True)
+            self.AssignImageList(wx.ImageList(16, 16), wx.IMAGE_LIST_SMALL)
+else:
+    import wx.lib.mixins.listctrl as listmix
+    class CheckListCtrlMixin(listmix.CheckListCtrlMixin):
+        """Wrapper for deprecated mixin"""
+        def __init__(self):
+            listmix.CheckListCtrlMixin.__init__(self)
+
 
 class TreeCtrl(wx.TreeCtrl):
     """Wrapper around wx.TreeCtrl to have more control

+ 1 - 1
gui/wxpython/iclass/dialogs.py

@@ -324,7 +324,7 @@ class IClassCategoryManagerDialog(wx.Dialog):
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         closeButton = Button(panel, id=wx.ID_CLOSE)
         btnSizer.Add(wx.Size(-1, -1), proportion=1, flag=wx.EXPAND)
-        btnSizer.Add(closeButton, proportion=0, flag=wx.ALIGN_RIGHT)
+        btnSizer.Add(closeButton, proportion=0)
         mainSizer.Add(
             btnSizer,
             proportion=0,

+ 13 - 26
gui/wxpython/iclass/frame.py

@@ -132,14 +132,7 @@ class IClassMapFrame(DoubleMapFrame):
         #
         # Add toolbars
         #
-
-        toolbarsCopy = toolbars[:]
-        if sys.platform == 'win32':
-            self.AddToolbar(toolbarsCopy.pop(1))
-            toolbarsCopy.reverse()
-        else:
-            self.AddToolbar(toolbarsCopy.pop(0))
-        for toolb in toolbarsCopy:
+        for toolb in toolbars:
             self.AddToolbar(toolb)
         self.firstMapWindow.SetToolbar(self.toolbars['vdigit'])
 
@@ -313,7 +306,7 @@ class IClassMapFrame(DoubleMapFrame):
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
+                              CloseButton(False).Layer(2).Row(1).Position(0).
                               BestSize((self.toolbars[name].GetBestSize())))
 
         if name == "iClass":
@@ -326,7 +319,7 @@ class IClassMapFrame(DoubleMapFrame):
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(2).
+                              CloseButton(False).Layer(2).Row(2).Position(0).
                               BestSize((self.toolbars[name].GetBestSize())))
 
         if name == "iClassMisc":
@@ -338,7 +331,7 @@ class IClassMapFrame(DoubleMapFrame):
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
+                              CloseButton(False).Layer(2).Row(1).Position(1).
                               BestSize((self.toolbars[name].GetBestSize())))
 
         if name == "vdigit":
@@ -365,21 +358,15 @@ class IClassMapFrame(DoubleMapFrame):
                               ToolbarPane().Top().
                               LeftDockable(False).RightDockable(False).
                               BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(2).
+                              CloseButton(False).Layer(2).Row(2).Position(1).
                               BestSize((self.toolbars[name].GetBestSize())))
 
     def _addPanes(self):
         """Add mapwindows and toolbars to aui manager"""
-        if sys.platform == 'win32':
-            self._addPaneMapWindow(name='training')
-            self._addPaneToolbar(name='iClassTrainingMapManager')
-            self._addPaneMapWindow(name='preview')
-            self._addPaneToolbar(name='iClassPreviewMapManager')
-        else:
-            self._addPaneToolbar(name='iClassPreviewMapManager')
-            self._addPaneMapWindow(name='preview')
-            self._addPaneToolbar(name='iClassTrainingMapManager')
-            self._addPaneMapWindow(name='training')
+        self._addPaneMapWindow(name='training', position=0)
+        self._addPaneToolbar(name='iClassTrainingMapManager', position=1)
+        self._addPaneMapWindow(name='preview', position=2)
+        self._addPaneToolbar(name='iClassPreviewMapManager', position=3)
 
         # otherwise best size was ignored
         self._mgr.SetDockSizeConstraint(0.5, 0.5)
@@ -389,7 +376,7 @@ class IClassMapFrame(DoubleMapFrame):
                           Dockable(False).Floatable(False).CloseButton(False).
                           Left().Layer(1).BestSize((335, -1)))
 
-    def _addPaneToolbar(self, name):
+    def _addPaneToolbar(self, name, position):
         if name == 'iClassPreviewMapManager':
             parent = self.previewMapManager
         else:
@@ -399,10 +386,10 @@ class IClassMapFrame(DoubleMapFrame):
         self._mgr.AddPane(self.toolbars[name],
                           wx.aui.AuiPaneInfo().ToolbarPane().Movable().
                           Name(name).
-                          CloseButton(False).Center().Layer(0).
+                          CloseButton(False).Center().Layer(0).Position(position).
                           BestSize((self.toolbars[name].GetBestSize())))
 
-    def _addPaneMapWindow(self, name):
+    def _addPaneMapWindow(self, name, position):
         if name == 'preview':
             window = self.GetSecondWindow()
             caption = _("Preview Display")
@@ -413,7 +400,7 @@ class IClassMapFrame(DoubleMapFrame):
         self._mgr.AddPane(window, wx.aui.AuiPaneInfo().
                           Name(name).Caption(caption).
                           Dockable(False).Floatable(False).CloseButton(False).
-                          Center().Layer(0))
+                          Center().Layer(0).Position(position))
 
     def IsStandalone(self):
         """Check if Map display is standalone"""

+ 7 - 7
gui/wxpython/image2target/ii2t_manager.py

@@ -40,7 +40,7 @@ import shutil
 from copy import copy
 
 import wx
-from wx.lib.mixins.listctrl import CheckListCtrlMixin, ColumnSorterMixin, ListCtrlAutoWidthMixin
+from wx.lib.mixins.listctrl import ColumnSorterMixin, ListCtrlAutoWidthMixin
 import wx.lib.colourselect as csel
 
 from core import globalvar
@@ -63,7 +63,7 @@ from core.settings import UserSettings
 from gcp.mapdisplay import MapFrame
 from core.giface import Notification
 from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
-    CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage
+    CheckListBox, TextCtrl, Menu, ListCtrl, BitmapFromImage, CheckListCtrlMixin
 
 from location_wizard.wizard import TitledPage as TitledPage
 
@@ -1327,7 +1327,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         # changed
         itemIndex += 1
 
-        if not self.list.IsChecked(key - 1):
+        if not self.list.IsItemChecked(key - 1):
             wxPen = "unused"
             if not self.show_unused:
                 item.SetPropertyVal('hide', True)
@@ -1453,7 +1453,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 "#----------------------------     ---------------------------     ---------------\n")
 
             for index in range(self.list.GetItemCount()):
-                if self.list.IsChecked(index):
+                if self.list.IsItemChecked(index):
                     check = "1"
                     self.GCPcount += 1
                 else:
@@ -1763,7 +1763,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         highest_idx = 0
 
         for index in range(self.list.GetItemCount()):
-            if self.list.IsChecked(index):
+            if self.list.IsItemChecked(index):
                 key = self.list.GetItemData(index)
                 fwd_err = self.mapcoordlist[key][5]
 
@@ -1894,7 +1894,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
         for index in range(self.list.GetItemCount()):
             key = self.list.GetItemData(index)
-            if self.list.IsChecked(index):
+            if self.list.IsItemChecked(index):
                 fwd_err, bkw_err = errlist[GCPcount].split()
                 self.list.SetItem(index, 7, fwd_err)
                 self.list.SetItem(index, 8, bkw_err)
@@ -1932,7 +1932,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             self.list.SetItemTextColour(highest_idx, wx.RED)
         elif GCPcount > 0 and self.rmsthresh > 0 and not self.highest_only:
             for index in range(self.list.GetItemCount()):
-                if self.list.IsChecked(index):
+                if self.list.IsItemChecked(index):
                     key = self.list.GetItemData(index)
                     if (self.mapcoordlist[key][7] > self.rmsthresh):
                         self.list.SetItemTextColour(index, wx.RED)

+ 1 - 1
gui/wxpython/iscatt/dialogs.py

@@ -172,7 +172,7 @@ class AddScattPlotDialog(wx.Dialog):
                      flag=wx.EXPAND)
 
         selSizer.Add(sel, proportion=1,
-                     flag=wx.EXPAND | wx.TOP | wx.ALIGN_CENTER_VERTICAL,
+                     flag=wx.EXPAND | wx.TOP,
                      border=5)
 
         return selSizer

+ 11 - 15
gui/wxpython/lmgr/frame.py

@@ -149,35 +149,31 @@ class GMFrame(wx.Frame):
                          'nviz': LMNvizToolbar(parent=self)}
         self._toolbarsData = {'workspace': ("toolbarWorkspace",     # name
                                             _("Workspace Toolbar"),  # caption
-                                            1),                     # row
+                                            1, 0),                   # row, position
                               'data': ("toolbarData",
                                        _("Data Toolbar"),
-                                       1),
+                                       1, 1),
                               'misc': ("toolbarMisc",
                                        _("Misc Toolbar"),
-                                       2),
+                                       2, 2),
                               'tools': ("toolbarTools",
                                         _("Tools Toolbar"),
-                                        2),
+                                        2, 1),
                               'vector': ("toolbarVector",
                                          _("Vector Toolbar"),
-                                         2),
+                                         2, 0),
                               'nviz': ("toolbarNviz",
                                        _("3D view Toolbar"),
-                                       2),
+                                       2, 3),
                               }
-        if sys.platform == 'win32':
-            self._toolbarsList = ('workspace', 'data',
-                                  'vector', 'tools', 'misc', 'nviz')
-        else:
-            self._toolbarsList = ('data', 'workspace',
-                                  'nviz', 'misc', 'tools', 'vector')
-        for toolbar in self._toolbarsList:
-            name, caption, row = self._toolbarsData[toolbar]
+        toolbarsList = ('workspace', 'data',
+                        'vector', 'tools', 'misc', 'nviz')
+        for toolbar in toolbarsList:
+            name, caption, row, position = self._toolbarsData[toolbar]
             self._auimgr.AddPane(self.toolbars[toolbar],
                                  wx.aui.AuiPaneInfo().
                                  Name(name).Caption(caption).
-                                 ToolbarPane().Top().Row(row).
+                                 ToolbarPane().Top().Row(row).Position(position).
                                  LeftDockable(False).RightDockable(False).
                                  BottomDockable(False).TopDockable(True).
                                  CloseButton(False).Layer(2).

+ 2 - 2
gui/wxpython/lmgr/pyshell.py

@@ -80,9 +80,9 @@ class PyShellWindow(wx.Panel):
                          flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5)
         btnSizer.AddStretchSpacer()
         btnSizer.Add(self.btnClear, proportion=0,
-                     flag=wx.EXPAND | wx.ALIGN_RIGHT, border=5)
+                     flag=wx.EXPAND, border=5)
         sizer.Add(btnSizer, proportion=0,
-                  flag=wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND, border=5)
+                  flag=wx.ALL | wx.EXPAND, border=5)
 
         sizer.Fit(self)
         sizer.SetSizeHints(self)

+ 0 - 5
gui/wxpython/location_wizard/wizard.py

@@ -500,7 +500,6 @@ class ProjectionsPage(TitledPage):
 
         # events
         self.tproj.Bind(wx.EVT_TEXT, self.OnText)
-        self.tproj.Bind(wx.EVT_TEXT_ENTER, self.OnText)
         self.searchb.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
         self.projlist.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
@@ -1039,7 +1038,6 @@ class DatumPage(TitledPage):
         self.datumlist.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnDatumSelected)
         self.searchb.Bind(wx.EVT_TEXT_ENTER, self.OnDSearch)
         self.tdatum.Bind(wx.EVT_TEXT, self.OnDText)
-        self.tdatum.Bind(wx.EVT_TEXT_ENTER, self.OnDText)
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGED, self.OnEnterPage)
 
@@ -1226,7 +1224,6 @@ class EllipsePage(TitledPage):
         # events
         self.ellipselist.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
         self.tellipse.Bind(wx.EVT_TEXT, self.OnText)
-        self.tellipse.Bind(wx.EVT_TEXT_ENTER, self.OnText)
         self.searchb.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
 
         self.radio1.Bind(
@@ -1557,7 +1554,6 @@ class EPSGPage(TitledPage):
         self.bbrowse.Bind(wx.EVT_BUTTON, self.OnBrowse)
         self.tfile.Bind(wx.EVT_TEXT_ENTER, self.OnBrowseCodes)
         self.tcode.Bind(wx.EVT_TEXT, self.OnText)
-        self.tcode.Bind(wx.EVT_TEXT_ENTER, self.OnText)
         self.epsglist.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
         self.searchb.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
@@ -1785,7 +1781,6 @@ class IAUPage(TitledPage):
         self.bbrowse.Bind(wx.EVT_BUTTON, self.OnBrowse)
         self.tfile.Bind(wx.EVT_TEXT_ENTER, self.OnBrowseCodes)
         self.tcode.Bind(wx.EVT_TEXT, self.OnText)
-        self.tcode.Bind(wx.EVT_TEXT_ENTER, self.OnText)
         self.epsglist.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected)
         self.searchb.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
         self.Bind(wiz.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)

+ 1 - 1
gui/wxpython/mapswipe/dialogs.py

@@ -104,7 +104,7 @@ class SwipeMapDialog(wx.Dialog):
         mainSizer.Add(self.btnSwitch, proportion=0,
                       flag=wx.ALL | wx.ALIGN_LEFT, border=5)
         mainSizer.Add(self.btnSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
         self.mainSizer = mainSizer
         self._switchMode(simple=True)
         self.SetSizer(mainSizer)

+ 34 - 44
gui/wxpython/mapswipe/frame.py

@@ -46,14 +46,7 @@ class SwipeMapFrame(DoubleMapFrame):
         #
         # Add toolbars
         #
-        toolbars = ['swipeMisc', 'swipeMap', 'swipeMain']
-        if sys.platform == 'win32':
-            self.AddToolbar(toolbars.pop(1))
-            toolbars.reverse()
-        else:
-            self.AddToolbar(toolbars.pop(0))
-        for toolb in toolbars:
-            self.AddToolbar(toolb)
+        self.AddToolbars()
         self._giface = giface
         #
         # create widgets
@@ -275,47 +268,45 @@ class SwipeMapFrame(DoubleMapFrame):
         style ^= wx.SP_LIVE_UPDATE
         self.splitter.SetWindowStyle(style)
 
-    def AddToolbar(self, name):
+    def AddToolbars(self):
         """Add defined toolbar to the window
 
         Currently known toolbars are:
          - 'swipeMap'          - basic map toolbar
          - 'swipeMain'         - swipe functionality
+         - 'swipeMisc'         - misc (settings, help)
         """
-        if name == "swipeMap":
-            self.toolbars[name] = SwipeMapToolbar(self, self._toolSwitcher)
-            self._mgr.AddPane(self.toolbars[name],
-                              wx.aui.AuiPaneInfo().
-                              Name(name).Caption(_("Map Toolbar")).
-                              ToolbarPane().Top().
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
-                              BestSize((self.toolbars[name].GetBestSize())))
-
-        if name == "swipeMain":
-            self.toolbars[name] = SwipeMainToolbar(self)
-
-            self._mgr.AddPane(self.toolbars[name],
-                              wx.aui.AuiPaneInfo().
-                              Name(name).Caption(_("Main Toolbar")).
-                              ToolbarPane().Top().
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
-                              BestSize((self.toolbars[name].GetBestSize())))
-
-        if name == "swipeMisc":
-            self.toolbars[name] = SwipeMiscToolbar(self)
-
-            self._mgr.AddPane(self.toolbars[name],
-                              wx.aui.AuiPaneInfo().
-                              Name(name).Caption(_("Misc Toolbar")).
-                              ToolbarPane().Top().
-                              LeftDockable(False).RightDockable(False).
-                              BottomDockable(False).TopDockable(True).
-                              CloseButton(False).Layer(2).Row(1).
-                              BestSize((self.toolbars[name].GetBestSize())))
+        self.toolbars["swipeMap"] = SwipeMapToolbar(self, self._toolSwitcher)
+        self._mgr.AddPane(self.toolbars["swipeMap"],
+                          wx.aui.AuiPaneInfo().
+                          Name("swipeMap").Caption(_("Map Toolbar")).
+                          ToolbarPane().Top().
+                          LeftDockable(False).RightDockable(False).
+                          BottomDockable(False).TopDockable(True).
+                          CloseButton(False).Layer(2).Row(1).Position(1).
+                          BestSize((self.toolbars["swipeMap"].GetBestSize())))
+
+        self.toolbars["swipeMain"] = SwipeMainToolbar(self)
+
+        self._mgr.AddPane(self.toolbars["swipeMain"],
+                          wx.aui.AuiPaneInfo().
+                          Name("swipeMain").Caption(_("Main Toolbar")).
+                          ToolbarPane().Top().
+                          LeftDockable(False).RightDockable(False).
+                          BottomDockable(False).TopDockable(True).
+                          CloseButton(False).Layer(2).Row(1).Position(0).
+                          BestSize((self.toolbars["swipeMain"].GetBestSize())))
+
+        self.toolbars["swipeMisc"] = SwipeMiscToolbar(self)
+
+        self._mgr.AddPane(self.toolbars["swipeMisc"],
+                          wx.aui.AuiPaneInfo().
+                          Name("swipeMisc").Caption(_("Misc Toolbar")).
+                          ToolbarPane().Top().
+                          LeftDockable(False).RightDockable(False).
+                          BottomDockable(False).TopDockable(True).
+                          CloseButton(False).Layer(2).Row(1).Position(2).
+                          BestSize((self.toolbars["swipeMisc"].GetBestSize())))
 
     def _addPanes(self):
         """Add splitter window and sliders to aui manager"""
@@ -790,7 +781,6 @@ class MapSplitter(wx.SplitterWindow):
     def Init(self):
         self.OnSashChanged(evt=None)
         self.SetMinimumPaneSize(0)
-        self.SetSashSize(self.sashWidthMin)
 
     # def OnMotion(self, event):
     #     w = self.GetSashSize()

+ 3 - 3
gui/wxpython/modules/colorrules.py

@@ -424,7 +424,7 @@ class ColorTable(wx.Frame):
         # layout
         inputSizer.Add(
             self.selectionInput,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND,
+            flag=wx.ALL | wx.EXPAND,
             border=5)
 
         return inputSizer
@@ -1177,7 +1177,7 @@ class VectorColorTable(ColorTable):
                    flag=wx.ALIGN_CENTER_VERTICAL)
         inputSizer.Add(
             vSizer,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL | wx.EXPAND,
+            flag=wx.ALL | wx.EXPAND,
             border=5)
         self.colorColumnSizer = vSizer
         return inputSizer
@@ -1242,7 +1242,7 @@ class VectorColorTable(ColorTable):
                                     style=wx.LI_HORIZONTAL), proportion=0,
                       flag=wx.EXPAND | wx.ALL, border=5)
         mainsizer.Add(btnSizer, proportion=0,
-                      flag=wx.ALL | wx.ALIGN_RIGHT | wx.EXPAND, border=5)
+                      flag=wx.ALL | wx.EXPAND, border=5)
 
         self.panel.SetSizer(mainsizer)
         mainsizer.Layout()

+ 1 - 1
gui/wxpython/modules/extensions.py

@@ -175,7 +175,7 @@ class InstallExtensionWindow(wx.Frame):
         sizer.Add(optionSizer, proportion=0,
                   flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=3)
         sizer.Add(btnSizer, proportion=0,
-                  flag=wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND, border=5)
+                  flag=wx.ALL | wx.EXPAND, border=5)
 
         self.panel.SetSizer(sizer)
         sizer.Fit(self.panel)

+ 2 - 2
gui/wxpython/modules/import_export.py

@@ -213,7 +213,7 @@ class ImportDialog(wx.Dialog):
         dialogSizer.Add(
             btnsizer,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.ALIGN_RIGHT,
+            flag=wx.BOTTOM | wx.ALIGN_RIGHT,
             border=10)
 
         # dialogSizer.SetSizeHints(self.panel)
@@ -946,7 +946,7 @@ class ReprojectionDialog(wx.Dialog):
         dialogSizer.Add(
             btnsizer,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.BOTTOM | wx.ALIGN_RIGHT,
+            flag=wx.BOTTOM | wx.ALIGN_RIGHT,
             border=10)
 
         self.panel.SetSizer(dialogSizer)

+ 7 - 7
gui/wxpython/modules/mcalc_builder.py

@@ -245,7 +245,7 @@ class MapCalcFrame(wx.Frame):
         # Text area
         #
         self.text_mcalc = TextCtrl(
-            parent=self.panel, id=wx.ID_ANY, size=(-1, 75),
+            parent=self.panel, id=wx.ID_ANY, size=(-1, 100),
             style=wx.TE_MULTILINE)
         wx.CallAfter(self.text_mcalc.SetFocus)
 
@@ -339,9 +339,9 @@ class MapCalcFrame(wx.Frame):
 
         self._layout()
 
-        self.SetMinSize(self.GetBestSize())
+        self.SetMinSize(self.panel.GetBestSize())
         # workaround for http://trac.wxwidgets.org/ticket/13628
-        self.SetSize(self.GetBestSize())
+        self.SetSize(self.panel.GetBestSize())
 
     def _return_funct(self, event):
         i = event.GetString()
@@ -388,15 +388,15 @@ class MapCalcFrame(wx.Frame):
 
         outputSizer = wx.StaticBoxSizer(self.outputBox, wx.VERTICAL)
         outputSizer.Add(self.newmaplabel,
-                        flag=wx.ALIGN_CENTER | wx.BOTTOM | wx.TOP, border=5)
+                        flag=wx.ALIGN_CENTER | wx.TOP, border=5)
         outputSizer.Add(self.newmaptxt,
-                        flag=wx.EXPAND)
+                        flag=wx.EXPAND | wx.ALL, border=5)
 
         operandSizer = wx.StaticBoxSizer(self.operandBox, wx.HORIZONTAL)
 
         buttonSizer3 = wx.GridBagSizer(7, 1)
         buttonSizer3.Add(self.functlabel, pos=(0, 0),
-                         span=(1, 2), flag=wx.ALIGN_CENTER)
+                         span=(1, 2), flag=wx.ALIGN_CENTER | wx.EXPAND)
         buttonSizer3.Add(self.function, pos=(1, 0),
                          span=(1, 2))
         buttonSizer3.Add(self.mapsellabel, pos=(2, 0),
@@ -437,7 +437,7 @@ class MapCalcFrame(wx.Frame):
             border=5)
 
         operandSizer.Add(buttonSizer3, proportion=0,
-                         flag=wx.TOP | wx.BOTTOM | wx.RIGHT, border=5)
+                         flag=wx.ALL, border=5)
 
         controlSizer.Add(operatorSizer, proportion=1,
                          flag=wx.RIGHT | wx.EXPAND, border=5)

+ 1 - 1
gui/wxpython/nviz/tools.py

@@ -441,7 +441,7 @@ class NvizToolWindow(FN.FlatNotebook):
         reset.SetToolTip(_("Reset to default view"))
         reset.Bind(wx.EVT_BUTTON, self.OnResetView)
         viewSizer.Add(reset, proportion=0,
-                      flag=wx.TOP | wx.BOTTOM | wx.RIGHT | wx.ALIGN_RIGHT,
+                      flag=wx.TOP | wx.BOTTOM | wx.RIGHT,
                       border=5)
 
         gridSizer.Add(viewSizer, pos=(4, 0), span=(1, 3),

+ 7 - 7
gui/wxpython/photo2image/ip2i_manager.py

@@ -33,7 +33,7 @@ import shutil
 from copy import copy
 
 import wx
-from wx.lib.mixins.listctrl import CheckListCtrlMixin, ColumnSorterMixin, ListCtrlAutoWidthMixin
+from wx.lib.mixins.listctrl import ColumnSorterMixin, ListCtrlAutoWidthMixin
 import wx.lib.colourselect as csel
 
 import grass.script as grass
@@ -47,7 +47,7 @@ from core.settings import UserSettings
 from photo2image.ip2i_mapdisplay import MapFrame
 from core.giface import Notification
 from gui_core.wrap import SpinCtrl, Button, StaticText, StaticBox, \
-    TextCtrl, Menu, ListCtrl, BitmapFromImage
+    TextCtrl, Menu, ListCtrl, BitmapFromImage, CheckListCtrlMixin
 
 from location_wizard.wizard import TitledPage as TitledPage
 
@@ -711,7 +711,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         # changed
         itemIndex += 1
 
-        if not self.list.IsChecked(key - 1):
+        if not self.list.IsItemChecked(key - 1):
             wxPen = "unused"
             if not self.show_unused:
                 item.SetPropertyVal('hide', True)
@@ -811,7 +811,7 @@ class GCP(MapFrame, ColumnSorterMixin):
                 "#-----------------------     -----------------------     ---------------\n")
 
             for index in range(self.list.GetItemCount()):
-                if self.list.IsChecked(index):
+                if self.list.IsItemChecked(index):
                     check = "1"
                     self.GCPcount += 1
                 else:
@@ -1080,7 +1080,7 @@ class GCP(MapFrame, ColumnSorterMixin):
         highest_idx = 0
 
         for index in range(self.list.GetItemCount()):
-            if self.list.IsChecked(index):
+            if self.list.IsItemChecked(index):
                 key = self.list.GetItemData(index)
                 fwd_err = self.mapcoordlist[key][5]
 
@@ -1209,7 +1209,7 @@ class GCP(MapFrame, ColumnSorterMixin):
 
         for index in range(self.list.GetItemCount()):
             key = self.list.GetItemData(index)
-            if self.list.IsChecked(index):
+            if self.list.IsItemChecked(index):
                 fwd_err, bkw_err = errlist[GCPcount].split()
                 self.list.SetItem(index, 5, fwd_err)
                 self.list.SetItem(index, 6, bkw_err)
@@ -1247,7 +1247,7 @@ class GCP(MapFrame, ColumnSorterMixin):
             self.list.SetItemTextColour(highest_idx, wx.RED)
         elif GCPcount > 0 and self.rmsthresh > 0 and not self.highest_only:
             for index in range(self.list.GetItemCount()):
-                if self.list.IsChecked(index):
+                if self.list.IsItemChecked(index):
                     key = self.list.GetItemData(index)
                     if (self.mapcoordlist[key][5] > self.rmsthresh):
                         self.list.SetItemTextColour(index, wx.RED)

+ 9 - 12
gui/wxpython/psmap/dialogs.py

@@ -41,7 +41,7 @@ from copy import deepcopy
 
 import wx
 import wx.lib.agw.floatspin as fs
-from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin
+from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin
 
 from core import globalvar
 
@@ -63,7 +63,7 @@ from gui_core.wrap import (
     EmptyBitmap, ExpandoTextCtrl, FileBrowseButton, FloatSpin, ListBox,
     ListCtrl, NewId, Notebook, OwnerDrawnComboBox, Panel, RadioButton,
     Rect, ScrolledPanel, SpinCtrl, StaticBox, StaticText, TextCtrl,
-    TextEntryDialog, EmptyImage
+    TextEntryDialog, EmptyImage, CheckListCtrlMixin
 )
 from psmap.utils import *
 from psmap.instructions import *
@@ -490,7 +490,7 @@ class PsmapDialog(Dialog):
             flag=wx.EXPAND | wx.ALL,
             border=5)
         mainSizer.Add(btnSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(mainSizer)
         mainSizer.Layout()
@@ -679,7 +679,7 @@ class PageSetupDialog(PsmapDialog):
         mainSizer.Add(
             btnSizer,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_RIGHT | wx.ALL,
+            flag=wx.ALIGN_RIGHT | wx.ALL,
             border=10)
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -3573,7 +3573,6 @@ class LegendDialog(PsmapDialog):
         sizer.Add(
             gridBagSizer,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL,
             border=0)
         border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
 
@@ -3675,7 +3674,7 @@ class LegendDialog(PsmapDialog):
         sizer.Add(
             gridBagSizer,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.EXPAND,
+            flag=wx.EXPAND,
             border=0)
         border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
 
@@ -3772,7 +3771,6 @@ class LegendDialog(PsmapDialog):
         sizer.Add(
             unitBox,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL,
             border=0)
 
         hBox = wx.BoxSizer(wx.HORIZONTAL)
@@ -4298,7 +4296,7 @@ class LegendDialog(PsmapDialog):
             # reindex order
             idx = 1
             for item in range(self.vectorListCtrl.GetItemCount()):
-                if self.vectorListCtrl.IsChecked(item):
+                if self.vectorListCtrl.IsItemChecked(item):
                     self.vectorListCtrl.SetItemData(item, idx)
                     idx += 1
                 else:
@@ -5009,7 +5007,6 @@ class ScalebarDialog(PsmapDialog):
         sizer.Add(
             gridBagSizer,
             proportion=1,
-            flag=wx.ALIGN_CENTER_VERTICAL,
             border=5)
         border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
 
@@ -5824,7 +5821,7 @@ class ImageDialog(PsmapDialog):
         sizer.Add(
             epsInfo,
             proportion=0,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALL,
             border=3)
 
         border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
@@ -5940,7 +5937,7 @@ class ImageDialog(PsmapDialog):
         sizer.Add(
             gridBagSizer,
             proportion=1,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALL,
             border=5)
         border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
 
@@ -6516,7 +6513,7 @@ class PointDialog(PsmapDialog):
         sizer.Add(
             gridBagSizer,
             proportion=1,
-            flag=wx.ALIGN_CENTER_VERTICAL | wx.ALL,
+            flag=wx.ALL,
             border=5)
         border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)
 

+ 2 - 0
gui/wxpython/psmap/frame.py

@@ -2528,6 +2528,8 @@ class PsMapBufferedWindow(wx.Window):
         # Make new off screen bitmap: this bitmap will always have the
         # current drawing in it, so it can be used to save the image
         # to a file, or whatever.
+        width = max(width, 20)
+        height = max(height, 20)
         self._buffer = EmptyBitmap(width, height)
         # re-render image on idle
         self.resize = True

+ 7 - 7
gui/wxpython/vdigit/dialogs.py

@@ -29,7 +29,7 @@ from core.gcmd import RunCommand, GError
 from core.debug import Debug
 from core.settings import UserSettings
 from gui_core.wrap import SpinCtrl, Button, StaticText, \
-    StaticBox, Menu, ListCtrl, NewId
+    StaticBox, Menu, ListCtrl, NewId, CheckListCtrlMixin
 
 
 class VDigitCategoryDialog(wx.Dialog, listmix.ColumnSorterMixin):
@@ -167,9 +167,9 @@ class VDigitCategoryDialog(wx.Dialog, listmix.ColumnSorterMixin):
 
         mainSizer = wx.BoxSizer(wx.VERTICAL)
         mainSizer.Add(listSizer, proportion=1,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
         mainSizer.Add(addSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALIGN_CENTER |
+                      flag=wx.EXPAND |
                       wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5)
         fidSizer = wx.BoxSizer(wx.HORIZONTAL)
         fidSizer.Add(StaticText(parent=self, id=wx.ID_ANY,
@@ -183,7 +183,7 @@ class VDigitCategoryDialog(wx.Dialog, listmix.ColumnSorterMixin):
         mainSizer.Add(fidSizer, proportion=0,
                       flag=wx.EXPAND | wx.ALL, border=5)
         mainSizer.Add(btnSizer, proportion=0,
-                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER, border=5)
+                      flag=wx.EXPAND | wx.ALL, border=5)
 
         self.SetSizer(mainSizer)
         mainSizer.Fit(self)
@@ -768,14 +768,14 @@ class VDigitDuplicatesDialog(wx.Dialog):
             wlist = self.FindWindowById(id)
 
             for item in range(wlist.GetItemCount()):
-                if not wlist.IsChecked(item):
+                if not wlist.IsItemChecked(item):
                     ids.append(int(wlist.GetItem(item, 0).GetText()))
 
         return ids
 
 
 class CheckListFeature(
-        ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.CheckListCtrlMixin):
+        ListCtrl, listmix.ListCtrlAutoWidthMixin, CheckListCtrlMixin):
 
     def __init__(self, parent, data,
                  pos=wx.DefaultPosition, log=None):
@@ -786,7 +786,7 @@ class CheckListFeature(
 
         ListCtrl.__init__(self, parent, wx.ID_ANY, style=wx.LC_REPORT)
 
-        listmix.CheckListCtrlMixin.__init__(self)
+        CheckListCtrlMixin.__init__(self)
 
         self.log = log
 

+ 3 - 3
gui/wxpython/vdigit/preferences.py

@@ -73,11 +73,11 @@ class VDigitSettingsDialog(wx.Dialog):
         # sizers
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
         btnSizer.Add(btnCancel, proportion=0,
-                     flag=wx.ALIGN_RIGHT | wx.ALL, border=5)
+                     flag=wx.ALL, border=5)
         btnSizer.Add(btnApply, proportion=0,
-                     flag=wx.ALIGN_RIGHT | wx.ALL, border=5)
+                     flag=wx.ALL, border=5)
         btnSizer.Add(btnSave, proportion=0,
-                     flag=wx.ALIGN_RIGHT | wx.ALL, border=5)
+                     flag=wx.ALL, border=5)
 
         mainSizer = wx.BoxSizer(wx.VERTICAL)
         mainSizer.Add(

+ 4 - 4
gui/wxpython/vnet/dialogs.py

@@ -502,11 +502,11 @@ class VNETDialog(wx.Dialog):
                               flag=wx.EXPAND | wx.ALL)
 
             selSizer.Add(selFiledSizer, proportion=0,
-                         flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL,
+                         flag=wx.EXPAND | wx.ALL,
                          border=5)
         else:
             selSizer.Add(sel, proportion=1,
-                         flag=wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_VERTICAL,
+                         flag=wx.EXPAND | wx.ALL,
                          border=5)
         return selSizer
 
@@ -1169,9 +1169,9 @@ class PtsList(PointsList):
         for k, v in six.iteritems(data):
             if k == "use":
 
-                if v and not self.IsChecked(idx):
+                if v and not self.IsItemChecked(idx):
                     self.CheckItem(idx, True)
-                elif not v and self.IsChecked(idx):
+                elif not v and self.IsItemChecked(idx):
                     self.CheckItem(idx, False)
             else:
                 found = 0

+ 2 - 2
gui/wxpython/vnet/widgets.py

@@ -24,13 +24,13 @@ import six
 from copy import copy, deepcopy
 
 import wx
-from wx.lib.mixins.listctrl import CheckListCtrlMixin, ColumnSorterMixin, \
+from wx.lib.mixins.listctrl import ColumnSorterMixin, \
     ListCtrlAutoWidthMixin, TextEditMixin
 
 from core import globalvar
 from gui_core.wrap import (
     BitmapFromImage, Button, ComboBox, ListCtrl, Panel, StaticBox,
-    StaticText, TextCtrl,
+    StaticText, TextCtrl, CheckListCtrlMixin
 )
 
 if sys.version_info.major >= 3:

+ 19 - 19
gui/wxpython/wxplot/dialogs.py

@@ -98,7 +98,7 @@ class ProfileRasterDialog(wx.Dialog):
             parent=self, id=wx.ID_ANY, size=(
                 20, -1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0, flag=wx.GROW |
-                  wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5)
+                  wx.LEFT | wx.RIGHT, border=5)
 
         btnsizer = wx.StdDialogButtonSizer()
 
@@ -224,7 +224,7 @@ class ScatterRasterDialog(wx.Dialog):
             parent=self, id=wx.ID_ANY, size=(
                 20, -1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0, flag=wx.GROW |
-                  wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5)
+                  wx.LEFT | wx.RIGHT, border=5)
 
         btnsizer = wx.StdDialogButtonSizer()
 
@@ -319,25 +319,25 @@ class PlotStatsFrame(wx.Frame):
             id=wx.ID_ANY,
             label=self.title)
         sizer.Add(statstitle, proportion=0,
-                  flag=wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=3)
+                  flag=wx.GROW | wx.ALL, border=3)
         line = wx.StaticLine(
             parent=self.panel, id=wx.ID_ANY, size=(
                 20, -1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0,
-                  flag=wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=3)
+                  flag=wx.GROW | wx.ALL, border=3)
         for stats in self.message:
             statstxt = StaticText(parent=sp, id=wx.ID_ANY, label=stats)
             statstxt.SetBackgroundColour("WHITE")
             txtSizer.Add(
                 statstxt,
                 proportion=1,
-                flag=wx.EXPAND | wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT,
+                flag=wx.EXPAND | wx.LEFT | wx.RIGHT,
                 border=3)
             line = wx.StaticLine(
                 parent=sp, id=wx.ID_ANY, size=(
                     20, -1), style=wx.LI_HORIZONTAL)
             txtSizer.Add(line, proportion=0, flag=wx.GROW |
-                         wx.ALIGN_CENTER_VERTICAL | wx.ALL, border=3)
+                         wx.ALL, border=3)
 
         sp.SetSizer(txtSizer)
         sp.SetAutoLayout(1)
@@ -350,7 +350,7 @@ class PlotStatsFrame(wx.Frame):
             parent=self.panel, id=wx.ID_ANY, size=(
                 20, -1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0, flag=wx.GROW |
-                  wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=3)
+                  wx.LEFT | wx.RIGHT, border=3)
 
         #
         # buttons
@@ -363,7 +363,7 @@ class PlotStatsFrame(wx.Frame):
         btnSizer.Add(
             btn_clipboard,
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALL,
+            flag=wx.ALL,
             border=5)
 
         btnCancel = Button(self.panel, wx.ID_CLOSE)
@@ -371,13 +371,13 @@ class PlotStatsFrame(wx.Frame):
         btnSizer.Add(
             btnCancel,
             proportion=0,
-            flag=wx.ALIGN_RIGHT | wx.ALL,
+            flag=wx.ALL,
             border=5)
 
         sizer.Add(
             btnSizer,
             proportion=0,
-            flag=wx.ALIGN_RIGHT | wx.ALL,
+            flag=wx.ALL,
             border=5)
 
         # bindings
@@ -529,7 +529,7 @@ class HistRasterDialog(wx.Dialog):
             parent=self, id=wx.ID_ANY, size=(
                 20, -1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0, flag=wx.GROW |
-                  wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5)
+                 wx.LEFT | wx.RIGHT, border=5)
 
         btnsizer = wx.StdDialogButtonSizer()
 
@@ -814,7 +814,7 @@ class TextDialog(wx.Dialog):
             parent=self, id=wx.ID_ANY, size=(
                 20, -1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0, flag=wx.GROW |
-                  wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=3)
+                  wx.LEFT | wx.RIGHT, border=3)
 
         #
         # buttons
@@ -848,17 +848,17 @@ class TextDialog(wx.Dialog):
         btnSizer.Add(
             btnSave,
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALL,
+            flag=wx.ALL,
             border=5)
         btnSizer.Add(
             btnStdSizer,
             proportion=0,
-            flag=wx.ALIGN_RIGHT | wx.ALL,
+            flag=wx.ALL,
             border=5)
         sizer.Add(
             btnSizer,
             proportion=0,
-            flag=wx.ALIGN_RIGHT | wx.ALL,
+            flag=wx.ALL,
             border=5)
 
         #
@@ -1413,7 +1413,7 @@ class OptDialog(wx.Dialog):
             parent=self, id=wx.ID_ANY, size=(
                 20, -1), style=wx.LI_HORIZONTAL)
         sizer.Add(line, proportion=0, flag=wx.GROW |
-                  wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=3)
+                  wx.LEFT | wx.RIGHT, border=3)
 
         #
         # buttons
@@ -1443,17 +1443,17 @@ class OptDialog(wx.Dialog):
         btnSizer.Add(
             btnSave,
             proportion=0,
-            flag=wx.ALIGN_LEFT | wx.ALL,
+            flag=wx.ALL,
             border=5)
         btnSizer.Add(
             btnStdSizer,
             proportion=0,
-            flag=wx.ALIGN_RIGHT | wx.ALL,
+            flag=wx.ALL,
             border=5)
         sizer.Add(
             btnSizer,
             proportion=0,
-            flag=wx.ALIGN_RIGHT | wx.ALL,
+            flag=wx.ALL,
             border=5)
 
         #