Skip to content

Commit

Permalink
wxGUI vdigit: fix wx.CheckBox widget deprecation warning (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmszi committed Jun 9, 2020
1 parent 19b06c0 commit 90e336d
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions gui/wxpython/vdigit/preferences.py
Expand Up @@ -25,8 +25,8 @@
from gui_core.gselect import ColumnSelect
from core.units import Units
from core.settings import UserSettings
from gui_core.wrap import SpinCtrl, Button, StaticText, \
StaticBox
from gui_core.wrap import Button, CheckBox, SpinCtrl, StaticBox, \
StaticText


class VDigitSettingsDialog(wx.Dialog):
Expand Down Expand Up @@ -114,7 +114,7 @@ def _createSymbologyPage(self, notebook):
isEnabled = UserSettings.Get(group='vdigit', key='symbol',
subkey=[key, 'enabled'])
if isEnabled is not None:
enabled = wx.CheckBox(panel, id=wx.ID_ANY, label="")
enabled = CheckBox(panel, id=wx.ID_ANY, label="")
enabled.SetValue(isEnabled)
self.symbology[key] = (enabled, color)
else:
Expand Down Expand Up @@ -237,8 +237,8 @@ def _createGeneralPage(self, notebook):
flag=wx.ALIGN_RIGHT | wx.FIXED_MINSIZE)

vertexSizer = wx.BoxSizer(wx.VERTICAL)
self.snapVertex = wx.CheckBox(parent=panel, id=wx.ID_ANY,
label=_("Snap also to vertex"))
self.snapVertex = CheckBox(parent=panel, id=wx.ID_ANY,
label=_("Snap also to vertex"))
self.snapVertex.SetValue(
UserSettings.Get(
group='vdigit',
Expand Down Expand Up @@ -273,7 +273,7 @@ def _createGeneralPage(self, notebook):
self.selectFeature = {}
for feature in ('point', 'line',
'centroid', 'boundary'):
chkbox = wx.CheckBox(parent=panel, label=feature)
chkbox = CheckBox(parent=panel, label=feature)
self.selectFeature[feature] = chkbox.GetId()
chkbox.SetValue(UserSettings.Get(group='vdigit', key='selectType',
subkey=[feature, 'enabled']))
Expand Down Expand Up @@ -306,18 +306,18 @@ def _createGeneralPage(self, notebook):
flag=wx.ALIGN_RIGHT | wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL | wx.LEFT,
border=10)

self.selectIn = wx.CheckBox(parent=panel, id=wx.ID_ANY, label=_(
self.selectIn = CheckBox(parent=panel, id=wx.ID_ANY, label=_(
"Select only features inside of selection bounding box"))
self.selectIn.SetValue(
UserSettings.Get(
group='vdigit',
key="selectInside",
subkey='enabled'))
self.selectIn.SetToolTipString(
self.selectIn.SetToolTip(
_("By default are selected all features overlapping selection bounding box "))

self.checkForDupl = wx.CheckBox(parent=panel, id=wx.ID_ANY,
label=_("Check for duplicates"))
self.checkForDupl = CheckBox(parent=panel, id=wx.ID_ANY,
label=_("Check for duplicates"))
self.checkForDupl.SetValue(
UserSettings.Get(
group='vdigit',
Expand Down Expand Up @@ -346,7 +346,7 @@ def _createGeneralPage(self, notebook):
_("Digitize lines/boundaries"))
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

self.intersect = wx.CheckBox(
self.intersect = CheckBox(
parent=panel, label=_("Break lines at intersection"))
self.intersect.SetValue(
UserSettings.Get(
Expand All @@ -373,7 +373,7 @@ def _createGeneralPage(self, notebook):
_("Digitize areas"))
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

self.closeBoundary = wx.CheckBox(
self.closeBoundary = CheckBox(
parent=panel, label=_("Close boundary (snap to the start node)"))
self.closeBoundary.SetValue(
UserSettings.Get(
Expand All @@ -400,7 +400,7 @@ def _createGeneralPage(self, notebook):
_("Save changes"))
# save changes on exit?
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
self.save = wx.CheckBox(parent=panel, label=_("Save changes on exit"))
self.save = CheckBox(parent=panel, label=_("Save changes on exit"))
self.save.SetValue(
UserSettings.Get(
group='vdigit',
Expand Down Expand Up @@ -437,7 +437,7 @@ def _createQueryPage(self, notebook):

LocUnits = self.parent.MapWindow.Map.GetProjInfo()['units']

self.queryBox = wx.CheckBox(
self.queryBox = CheckBox(
parent=panel,
id=wx.ID_ANY,
label=_("Select by box"))
Expand Down Expand Up @@ -595,8 +595,8 @@ def _createAttributesPage(self, notebook):
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

# checkbox
self.addRecord = wx.CheckBox(parent=panel, id=wx.ID_ANY,
label=_("Add new record into table"))
self.addRecord = CheckBox(parent=panel, id=wx.ID_ANY,
label=_("Add new record into table"))
self.addRecord.SetValue(
UserSettings.Get(
group='vdigit',
Expand Down Expand Up @@ -670,7 +670,7 @@ def _createAttributesPage(self, notebook):
sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

# checkbox
self.deleteRecord = wx.CheckBox(parent=panel, id=wx.ID_ANY,
self.deleteRecord = CheckBox(parent=panel, id=wx.ID_ANY,
label=_("Delete record from table"))
self.deleteRecord.SetValue(
UserSettings.Get(
Expand Down Expand Up @@ -711,8 +711,8 @@ def _createAttributesPage(self, notebook):
row = 0
for attrb in ['length', 'area', 'perimeter']:
# checkbox
check = wx.CheckBox(parent=panel, id=wx.ID_ANY,
label=self.geomAttrb[attrb]['label'])
check = CheckBox(parent=panel, id=wx.ID_ANY,
label=self.geomAttrb[attrb]['label'])
### self.deleteRecord.SetValue(UserSettings.Get(group='vdigit', key="delRecord", subkey='enabled'))
check.Bind(wx.EVT_CHECKBOX, self.OnGeomAttrb)
# column (only numeric)
Expand Down

0 comments on commit 90e336d

Please sign in to comment.