Beispiel #1
0
    def _createAttributesPage(self, notebook):
        """Create notebook page for attributes"""
        panel = wx.Panel(parent=notebook, id=wx.ID_ANY)
        notebook.AddPage(page=panel, text=_("Attributes"))

        border = wx.BoxSizer(wx.VERTICAL)

        #
        # add new record
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Digitize new feature"))
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

        # checkbox
        self.addRecord = CheckBox(parent=panel,
                                  id=wx.ID_ANY,
                                  label=_("Add new record into table"))
        self.addRecord.SetValue(
            UserSettings.Get(group="vdigit", key="addRecord",
                             subkey="enabled"))
        sizer.Add(self.addRecord,
                  proportion=0,
                  flag=wx.ALL | wx.EXPAND,
                  border=1)
        # settings
        flexSizer = wx.FlexGridSizer(cols=2, hgap=3, vgap=3)
        flexSizer.AddGrowableCol(0)
        settings = ((_("Layer"), 1), (_("Category"), 1), (_("Mode"),
                                                          _("Next to use")))
        # layer
        text = StaticText(parent=panel, id=wx.ID_ANY, label=_("Layer"))
        self.layer = SpinCtrl(parent=panel,
                              id=wx.ID_ANY,
                              size=(125, -1),
                              min=1,
                              max=1e3)
        self.layer.SetValue(
            int(UserSettings.Get(group="vdigit", key="layer", subkey="value")))
        flexSizer.Add(text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        flexSizer.Add(self.layer,
                      proportion=0,
                      flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL)
        # category number
        text = StaticText(parent=panel,
                          id=wx.ID_ANY,
                          label=_("Category number"))
        self.category = SpinCtrl(
            parent=panel,
            id=wx.ID_ANY,
            size=(125, -1),
            initial=UserSettings.Get(group="vdigit",
                                     key="category",
                                     subkey="value"),
            min=-1e9,
            max=1e9,
        )
        if (UserSettings.Get(
                group="vdigit", key="categoryMode", subkey="selection") != 1):
            self.category.Enable(False)
        flexSizer.Add(text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        flexSizer.Add(
            self.category,
            proportion=0,
            flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL,
        )
        # category mode
        text = StaticText(parent=panel, id=wx.ID_ANY, label=_("Category mode"))
        self.categoryMode = wx.Choice(
            parent=panel,
            id=wx.ID_ANY,
            size=(125, -1),
            choices=[_("Next to use"),
                     _("Manual entry"),
                     _("No category")],
        )
        self.categoryMode.SetSelection(
            UserSettings.Get(group="vdigit",
                             key="categoryMode",
                             subkey="selection"))
        flexSizer.Add(text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        flexSizer.Add(
            self.categoryMode,
            proportion=0,
            flag=wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL,
        )

        sizer.Add(flexSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=1)
        border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)

        #
        # delete existing record
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Delete existing feature(s)"))
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

        # checkbox
        self.deleteRecord = CheckBox(parent=panel,
                                     id=wx.ID_ANY,
                                     label=_("Delete record from table"))
        self.deleteRecord.SetValue(
            UserSettings.Get(group="vdigit", key="delRecord",
                             subkey="enabled"))
        sizer.Add(self.deleteRecord,
                  proportion=0,
                  flag=wx.ALL | wx.EXPAND,
                  border=1)
        border.Add(
            sizer,
            proportion=0,
            flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
            border=5,
        )

        #
        # geometry attributes (currently only length and area are supported)
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Geometry attributes"))
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        gridSizer = wx.GridBagSizer(hgap=3, vgap=3)
        self.geomAttrb = {
            "length": {
                "label": _("length")
            },
            "area": {
                "label": _("area")
            },
            "perimeter": {
                "label": _("perimeter")
            },
        }

        digitToolbar = self.parent.toolbars["vdigit"]
        try:
            vectorName = digitToolbar.GetLayer().GetName()
        except AttributeError:
            vectorName = None  # no vector selected for editing
        layer = UserSettings.Get(group="vdigit", key="layer", subkey="value")
        mapLayer = self.parent.toolbars["vdigit"].GetLayer()
        tree = self.parent.tree
        if tree:
            item = tree.FindItemByData("maplayer", mapLayer)
        else:
            item = None
        row = 0
        for attrb in ["length", "area", "perimeter"]:
            # checkbox
            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)
            column = ColumnSelect(parent=panel, size=(200, -1))
            column.InsertColumns(
                vector=vectorName,
                layer=layer,
                excludeKey=True,
                type=["integer", "double precision"],
            )
            # units
            if attrb == "area":
                choices = Units.GetUnitsList("area")
            else:
                choices = Units.GetUnitsList("length")
            win_units = wx.Choice(parent=panel,
                                  id=wx.ID_ANY,
                                  choices=choices,
                                  size=(120, -1))

            # default values
            check.SetValue(False)
            if (item and tree.GetLayerInfo(item, key="vdigit")
                    and "geomAttr" in tree.GetLayerInfo(item, key="vdigit")
                    and attrb in tree.GetLayerInfo(item,
                                                   key="vdigit")["geomAttr"]):
                check.SetValue(True)
                column.SetStringSelection(
                    tree.GetLayerInfo(
                        item, key="vdigit")["geomAttr"][attrb]["column"])
                if attrb == "area":
                    type = "area"
                else:
                    type = "length"
                unitsIdx = Units.GetUnitsIndex(
                    type,
                    tree.GetLayerInfo(
                        item, key="vdigit")["geomAttr"][attrb]["units"],
                )
                win_units.SetSelection(unitsIdx)

            if not vectorName:
                check.Enable(False)
                column.Enable(False)

            if not check.IsChecked():
                column.Enable(False)

            self.geomAttrb[attrb]["check"] = check.GetId()
            self.geomAttrb[attrb]["column"] = column.GetId()
            self.geomAttrb[attrb]["units"] = win_units.GetId()

            gridSizer.Add(check, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 0))
            gridSizer.Add(column, pos=(row, 1))
            gridSizer.Add(win_units, pos=(row, 2))
            row += 1

        note = "\n".join(
            textwrap.wrap(
                _("Note: These settings are stored "
                  "in the workspace not in the vector digitizer "
                  "preferences."),
                55,
            ))
        gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, label=note),
                      pos=(3, 0),
                      span=(1, 3))

        gridSizer.AddGrowableCol(0)
        sizer.Add(gridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=1)
        border.Add(
            sizer,
            proportion=0,
            flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
            border=5,
        )

        # bindings
        self.Bind(wx.EVT_CHECKBOX, self.OnChangeAddRecord, self.addRecord)
        self.Bind(wx.EVT_CHOICE, self.OnChangeCategoryMode, self.categoryMode)
        self.Bind(wx.EVT_SPINCTRL, self.OnChangeLayer, self.layer)

        panel.SetSizer(border)

        return panel
Beispiel #2
0
    def _createVectorPage(self, notebook):
        """Create notebook page for vector settings"""
        panel = wx.Panel(parent=notebook, id=wx.ID_ANY)

        notebook.AddPage(page=panel, text=" %s " % _("Vector"))

        pageSizer = wx.BoxSizer(wx.VERTICAL)

        # vector lines
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % (_("Vector lines")))
        boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        gridSizer = wx.GridBagSizer(vgap=3, hgap=3)

        row = 0
        # icon size
        gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY,
                                 label=_("Width:")),
                      pos=(row, 0),
                      flag=wx.ALIGN_CENTER_VERTICAL)

        iwidth = SpinCtrl(parent=panel,
                          id=wx.ID_ANY,
                          size=(65, -1),
                          initial=12,
                          min=1,
                          max=100)
        self.winId['nviz:vector:lines:width'] = iwidth.GetId()
        iwidth.SetValue(
            UserSettings.Get(group='nviz',
                             key='vector',
                             subkey=['lines', 'width']))
        gridSizer.Add(iwidth, pos=(row, 1), flag=wx.ALIGN_CENTER_VERTICAL)

        # icon color
        gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY,
                                 label=_("Color:")),
                      pos=(row, 4),
                      flag=wx.ALIGN_CENTER_VERTICAL)
        icolor = csel.ColourSelect(panel,
                                   id=wx.ID_ANY,
                                   size=globalvar.DIALOG_COLOR_SIZE)
        icolor.SetName('GetColour')
        self.winId['nviz:vector:lines:color'] = icolor.GetId()
        icolor.SetColour(
            UserSettings.Get(group='nviz',
                             key='vector',
                             subkey=['lines', 'color']))
        gridSizer.Add(icolor, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 5))
        boxSizer.Add(gridSizer,
                     proportion=1,
                     flag=wx.ALL | wx.EXPAND,
                     border=5)
        pageSizer.Add(boxSizer,
                      proportion=0,
                      flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
                      border=5)

        # vector points
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % (_("Vector points")))
        boxSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        gridSizer = wx.GridBagSizer(vgap=3, hgap=5)

        row = 0
        # icon size
        autosize = CheckBox(parent=panel, label=_("Automatic size"))
        autosize.SetToolTip(
            _("Icon size is set automatically based on landscape dimensions."))
        gridSizer.Add(autosize, pos=(row, 0), flag=wx.ALIGN_CENTER_VERTICAL)
        self.winId['nviz:vector:points:autosize'] = autosize.GetId()
        autosize.SetValue(
            UserSettings.Get(group='nviz',
                             key='vector',
                             subkey=['points', 'autosize']))

        row += 1
        gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY, label=_("Size:")),
                      pos=(row, 0),
                      flag=wx.ALIGN_CENTER_VERTICAL)

        isize = SpinCtrl(parent=panel,
                         id=wx.ID_ANY,
                         size=(65, -1),
                         initial=100,
                         min=1,
                         max=1e6)
        self.winId['nviz:vector:points:size'] = isize.GetId()
        isize.SetValue(
            UserSettings.Get(group='nviz',
                             key='vector',
                             subkey=['points', 'size']))
        gridSizer.Add(isize, pos=(row, 1), flag=wx.ALIGN_CENTER_VERTICAL)

        # icon symbol
        row += 1
        gridSizer.Add(StaticText(parent=panel,
                                 id=wx.ID_ANY,
                                 label=_("Marker:")),
                      pos=(row, 0),
                      flag=wx.ALIGN_CENTER_VERTICAL)
        isym = wx.Choice(parent=panel,
                         id=wx.ID_ANY,
                         size=(100, -1),
                         choices=UserSettings.Get(group='nviz',
                                                  key='vector',
                                                  subkey=['points', 'marker'],
                                                  settings_type='internal'))
        isym.SetName("GetSelection")
        self.winId['nviz:vector:points:marker'] = isym.GetId()
        isym.SetSelection(
            UserSettings.Get(group='nviz',
                             key='vector',
                             subkey=['points', 'marker']))
        gridSizer.Add(isym, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 1))

        # icon color
        row += 1
        gridSizer.Add(StaticText(parent=panel, id=wx.ID_ANY,
                                 label=_("Color:")),
                      pos=(row, 0),
                      flag=wx.ALIGN_CENTER_VERTICAL)
        icolor = csel.ColourSelect(panel,
                                   id=wx.ID_ANY,
                                   size=globalvar.DIALOG_COLOR_SIZE)
        icolor.SetName('GetColour')
        self.winId['nviz:vector:points:color'] = icolor.GetId()
        icolor.SetColour(
            UserSettings.Get(group='nviz',
                             key='vector',
                             subkey=['points', 'color']))
        gridSizer.Add(icolor, flag=wx.ALIGN_CENTER_VERTICAL, pos=(row, 1))

        boxSizer.Add(gridSizer,
                     proportion=1,
                     flag=wx.ALL | wx.EXPAND,
                     border=5)
        pageSizer.Add(boxSizer,
                      proportion=0,
                      flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
                      border=5)

        panel.SetSizer(pageSizer)

        return panel
Beispiel #3
0
    def _createGeneralPage(self, notebook):
        """Create notebook page concerning general settings"""
        panel = wx.Panel(parent=notebook, id=wx.ID_ANY)
        notebook.AddPage(page=panel, text=_("General"))

        border = wx.BoxSizer(wx.VERTICAL)

        #
        # display section
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Display"))
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        flexSizer = wx.FlexGridSizer(cols=3, hgap=5, vgap=5)
        flexSizer.AddGrowableCol(0)
        # line width
        text = StaticText(parent=panel, id=wx.ID_ANY, label=_("Line width"))
        self.lineWidthValue = SpinCtrl(
            parent=panel,
            id=wx.ID_ANY,
            size=(75, -1),
            initial=UserSettings.Get(group="vdigit",
                                     key="lineWidth",
                                     subkey="value"),
            min=1,
            max=1e6,
        )
        units = StaticText(
            parent=panel,
            id=wx.ID_ANY,
            size=(115, -1),
            label=UserSettings.Get(group="vdigit",
                                   key="lineWidth",
                                   subkey="units"),
            style=wx.ALIGN_LEFT,
        )
        flexSizer.Add(text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        flexSizer.Add(self.lineWidthValue,
                      proportion=0,
                      flag=wx.ALIGN_CENTER | wx.FIXED_MINSIZE)
        flexSizer.Add(
            units,
            proportion=0,
            flag=wx.ALIGN_RIGHT | wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL
            | wx.LEFT,
            border=10,
        )

        sizer.Add(flexSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=1)
        border.Add(sizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=5)

        #
        # snapping section
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Snapping"))
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        flexSizer = wx.FlexGridSizer(cols=3, hgap=5, vgap=5)
        flexSizer.AddGrowableCol(0)

        # snapping
        text = StaticText(parent=panel,
                          id=wx.ID_ANY,
                          label=_("Snapping threshold"))
        self.snappingValue = FloatSpin(
            parent=panel,
            id=wx.ID_ANY,
            size=(75, -1),
            value=UserSettings.Get(group="vdigit",
                                   key="snapping",
                                   subkey="value"),
            min_val=-1,
            max_val=1e6,
            digits=7,
        )
        self.snappingValue.Bind(wx.EVT_SPINCTRL, self.OnChangeSnappingValue)
        self.snappingValue.Bind(wx.EVT_TEXT, self.OnChangeSnappingValue)
        self.snappingUnit = wx.Choice(
            parent=panel,
            id=wx.ID_ANY,
            size=(125, -1),
            choices=[_("screen pixels"), _("map units")],
        )
        try:
            self.snappingUnit.SetSelection(
                UserSettings.Get(group="vdigit", key="snapping",
                                 subkey="unit"))
        except:
            self.snappingUnit.SetSelection(0)
        self.snappingUnit.Bind(wx.EVT_CHOICE, self.OnChangeSnappingUnits)
        flexSizer.Add(text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        flexSizer.Add(self.snappingValue,
                      proportion=0,
                      flag=wx.ALIGN_CENTER | wx.FIXED_MINSIZE)
        flexSizer.Add(self.snappingUnit,
                      proportion=0,
                      flag=wx.ALIGN_RIGHT | wx.FIXED_MINSIZE)

        vertexSizer = wx.BoxSizer(wx.VERTICAL)
        self.snapVertex = CheckBox(parent=panel,
                                   id=wx.ID_ANY,
                                   label=_("Snap also to vertex"))
        self.snapVertex.SetValue(
            UserSettings.Get(group="vdigit",
                             key="snapToVertex",
                             subkey="enabled"))
        vertexSizer.Add(self.snapVertex, proportion=0, flag=wx.EXPAND)
        self.mapUnits = self.parent.MapWindow.Map.GetProjInfo()["units"]
        self.snappingInfo = StaticText(
            parent=panel,
            id=wx.ID_ANY,
            label=_("Snapping threshold is %(value).1f %(units)s") % {
                "value": self.digit.GetDisplay().GetThreshold(),
                "units": self.mapUnits
            },
        )
        vertexSizer.Add(self.snappingInfo,
                        proportion=0,
                        flag=wx.ALL | wx.EXPAND,
                        border=1)

        sizer.Add(flexSizer, proportion=1, flag=wx.EXPAND)
        sizer.Add(vertexSizer, proportion=1, flag=wx.EXPAND)
        border.Add(
            sizer,
            proportion=0,
            flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
            border=5,
        )

        #
        # select box
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Select vector features"))
        # feature type
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        inSizer = wx.BoxSizer(wx.HORIZONTAL)
        self.selectFeature = {}
        for feature in ("point", "line", "centroid", "boundary"):
            chkbox = CheckBox(parent=panel, label=feature)
            self.selectFeature[feature] = chkbox.GetId()
            chkbox.SetValue(
                UserSettings.Get(group="vdigit",
                                 key="selectType",
                                 subkey=[feature, "enabled"]))
            inSizer.Add(chkbox,
                        proportion=0,
                        flag=wx.EXPAND | wx.ALL,
                        border=5)
        sizer.Add(inSizer, proportion=0, flag=wx.EXPAND)
        # threshold
        flexSizer = wx.FlexGridSizer(cols=3, hgap=5, vgap=5)
        flexSizer.AddGrowableCol(0)
        text = StaticText(parent=panel,
                          id=wx.ID_ANY,
                          label=_("Select threshold"))
        self.selectThreshValue = SpinCtrl(
            parent=panel,
            id=wx.ID_ANY,
            size=(75, -1),
            initial=UserSettings.Get(group="vdigit",
                                     key="selectThresh",
                                     subkey="value"),
            min=1,
            max=1e6,
        )
        units = StaticText(
            parent=panel,
            id=wx.ID_ANY,
            size=(115, -1),
            label=UserSettings.Get(group="vdigit",
                                   key="lineWidth",
                                   subkey="units"),
            style=wx.ALIGN_LEFT,
        )
        flexSizer.Add(text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        flexSizer.Add(
            self.selectThreshValue,
            proportion=0,
            flag=wx.ALIGN_CENTER | wx.FIXED_MINSIZE,
        )
        flexSizer.Add(
            units,
            proportion=0,
            flag=wx.ALIGN_RIGHT | wx.FIXED_MINSIZE | wx.ALIGN_CENTER_VERTICAL
            | wx.LEFT,
            border=10,
        )

        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.SetToolTip(
            _("By default are selected all features overlapping selection bounding box "
              ))

        self.checkForDupl = CheckBox(parent=panel,
                                     id=wx.ID_ANY,
                                     label=_("Check for duplicates"))
        self.checkForDupl.SetValue(
            UserSettings.Get(group="vdigit",
                             key="checkForDupl",
                             subkey="enabled"))

        sizer.Add(flexSizer, proportion=0, flag=wx.EXPAND)
        sizer.Add(self.selectIn,
                  proportion=0,
                  flag=wx.EXPAND | wx.ALL,
                  border=1)
        sizer.Add(self.checkForDupl,
                  proportion=0,
                  flag=wx.EXPAND | wx.ALL,
                  border=1)
        border.Add(
            sizer,
            proportion=0,
            flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
            border=5,
        )

        #
        # digitize lines box
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Digitize lines/boundaries"))
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

        self.intersect = CheckBox(parent=panel,
                                  label=_("Break lines at intersection"))
        self.intersect.SetValue(
            UserSettings.Get(group="vdigit",
                             key="breakLines",
                             subkey="enabled"))

        sizer.Add(self.intersect,
                  proportion=0,
                  flag=wx.ALL | wx.EXPAND,
                  border=1)

        border.Add(
            sizer,
            proportion=0,
            flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
            border=5,
        )

        #
        # digitize areas box
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Digitize areas"))
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

        self.closeBoundary = CheckBox(
            parent=panel, label=_("Close boundary (snap to the start node)"))
        self.closeBoundary.SetValue(
            UserSettings.Get(group="vdigit",
                             key="closeBoundary",
                             subkey="enabled"))

        sizer.Add(self.closeBoundary,
                  proportion=0,
                  flag=wx.ALL | wx.EXPAND,
                  border=1)

        border.Add(
            sizer,
            proportion=0,
            flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
            border=5,
        )

        #
        # save-on-exit box
        #
        box = StaticBox(parent=panel,
                        id=wx.ID_ANY,
                        label=" %s " % _("Save changes"))
        # save changes on exit?
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)
        self.save = CheckBox(parent=panel, label=_("Save changes on exit"))
        self.save.SetValue(
            UserSettings.Get(group="vdigit",
                             key="saveOnExit",
                             subkey="enabled"))
        sizer.Add(self.save, proportion=0, flag=wx.ALL | wx.EXPAND, border=1)
        border.Add(
            sizer,
            proportion=0,
            flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
            border=5,
        )

        panel.SetSizer(border)

        return panel