浏览代码

wxGUI: Use Map Display settings in other Map Display applications (#2155)

Linda Kladivova 3 年之前
父节点
当前提交
af20745947

+ 0 - 4
doc/gui/wxpython/example/frame.py

@@ -114,13 +114,9 @@ class ExampleMapPanel(SingleMapPanel):
             sb.SbCoordinates,
             sb.SbCoordinates,
             sb.SbRegionExtent,
             sb.SbRegionExtent,
             sb.SbCompRegionExtent,
             sb.SbCompRegionExtent,
-            sb.SbShowRegion,
-            sb.SbAlignExtent,
-            sb.SbResolution,
             sb.SbDisplayGeometry,
             sb.SbDisplayGeometry,
             sb.SbMapScale,
             sb.SbMapScale,
             sb.SbGoTo,
             sb.SbGoTo,
-            sb.SbProjection,
         ]
         ]
         self.statusbar = self.CreateStatusbar(statusbarItems)
         self.statusbar = self.CreateStatusbar(statusbarItems)
 
 

+ 1 - 1
gui/wxpython/core/workspace.py

@@ -950,7 +950,7 @@ class WriteWorkspaceFile(object):
                 )
                 )
             )
             )
             # projection statusbar info
             # projection statusbar info
-            if mapdisp.GetProperty("projection") and UserSettings.Get(
+            if mapdisp.GetProperty("useDefinedProjection") and UserSettings.Get(
                 group="display", key="projection", subkey="proj4"
                 group="display", key="projection", subkey="proj4"
             ):
             ):
                 self.indent += 4
                 self.indent += 4

+ 1 - 4
gui/wxpython/gcp/mapdisplay.py

@@ -100,16 +100,13 @@ class MapPanel(SingleMapPanel):
             sb.SbCoordinates,
             sb.SbCoordinates,
             sb.SbRegionExtent,
             sb.SbRegionExtent,
             sb.SbCompRegionExtent,
             sb.SbCompRegionExtent,
-            sb.SbShowRegion,
-            sb.SbResolution,
             sb.SbDisplayGeometry,
             sb.SbDisplayGeometry,
             sb.SbMapScale,
             sb.SbMapScale,
-            sb.SbProjection,
             sbgcp.SbGoToGCP,
             sbgcp.SbGoToGCP,
             sbgcp.SbRMSError,
             sbgcp.SbRMSError,
         ]
         ]
         self.statusbar = self.CreateStatusbar(statusbarItems)
         self.statusbar = self.CreateStatusbar(statusbarItems)
-        self.statusbarManager.SetMode(8)  # goto GCP
+        self.statusbarManager.SetMode(5)  # goto GCP
 
 
         #
         #
         # Init map display (buffered DC & set default cursor)
         # Init map display (buffered DC & set default cursor)

+ 6 - 0
gui/wxpython/gcp/toolbars.py

@@ -126,6 +126,12 @@ class GCPDisplayToolbar(BaseToolbar):
                 ("zoomback", BaseIcons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomback", BaseIcons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomtomap", BaseIcons["zoomExtent"], self.parent.OnZoomToMap),
                 ("zoomtomap", BaseIcons["zoomExtent"], self.parent.OnZoomToMap),
                 (None,),
                 (None,),
+                (
+                    "mapDispSettings",
+                    BaseIcons["mapDispSettings"],
+                    self.parent.OnMapDisplayProperties,
+                ),
+                (None,),
                 ("settings", icons["settings"], self.parent.OnSettings),
                 ("settings", icons["settings"], self.parent.OnSettings),
                 ("help", icons["help"], self.parent.OnHelp),
                 ("help", icons["help"], self.parent.OnHelp),
                 (None,),
                 (None,),

+ 16 - 6
gui/wxpython/gui_core/mapdisp.py

@@ -169,17 +169,17 @@ class MapPanelBase(wx.Panel):
 
 
     def SetProperty(self, name, value):
     def SetProperty(self, name, value):
         """Sets property"""
         """Sets property"""
-        if self.HasProperty("projection"):
-            self.statusbarManager.SetProperty(name, value)
+        if hasattr(self.mapWindowProperties, name):
+            setattr(self.mapWindowProperties, name, value)
         else:
         else:
-            self.mapWindowProperties.useDefinedProjection = value
+            self.statusbarManager.SetProperty(name, value)
 
 
     def GetProperty(self, name):
     def GetProperty(self, name):
         """Returns property"""
         """Returns property"""
-        if self.HasProperty("projection"):
-            return self.statusbarManager.GetProperty(name)
+        if hasattr(self.mapWindowProperties, name):
+            return getattr(self.mapWindowProperties, name)
         else:
         else:
-            return self.mapWindowProperties.useDefinedProjection
+            return self.statusbarManager.GetProperty(name)
 
 
     def HasProperty(self, name):
     def HasProperty(self, name):
         """Checks whether object has property"""
         """Checks whether object has property"""
@@ -493,6 +493,16 @@ class MapPanelBase(wx.Panel):
         """Set display geometry to match default region settings"""
         """Set display geometry to match default region settings"""
         self.MapWindow.ZoomToDefault()
         self.MapWindow.ZoomToDefault()
 
 
+    def OnMapDisplayProperties(self, event):
+        """Show Map Display Properties dialog"""
+        from mapdisp.properties import MapDisplayPropertiesDialog
+
+        dlg = MapDisplayPropertiesDialog(
+            parent=self, mapframe=self, properties=self.mapWindowProperties
+        )
+        dlg.CenterOnParent()
+        dlg.Show()
+
 
 
 class SingleMapPanel(MapPanelBase):
 class SingleMapPanel(MapPanelBase):
     """Panel with one map window.
     """Panel with one map window.

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

@@ -79,6 +79,7 @@ BaseIcons = {
         img="layer-raster-histogram", label=_("Create histogram with d.histogram")
         img="layer-raster-histogram", label=_("Create histogram with d.histogram")
     ),
     ),
     "settings": MetaIcon(img="settings", label=_("Settings")),
     "settings": MetaIcon(img="settings", label=_("Settings")),
+    "mapDispSettings": MetaIcon(img="map-settings", label=_("Map Display Settings")),
 }
 }
 
 
 
 

+ 0 - 4
gui/wxpython/iclass/frame.py

@@ -193,13 +193,9 @@ class IClassMapPanel(DoubleMapPanel):
             sb.SbCoordinates,
             sb.SbCoordinates,
             sb.SbRegionExtent,
             sb.SbRegionExtent,
             sb.SbCompRegionExtent,
             sb.SbCompRegionExtent,
-            sb.SbShowRegion,
-            sb.SbAlignExtent,
-            sb.SbResolution,
             sb.SbDisplayGeometry,
             sb.SbDisplayGeometry,
             sb.SbMapScale,
             sb.SbMapScale,
             sb.SbGoTo,
             sb.SbGoTo,
-            sb.SbProjection,
         ]
         ]
         self.statusbar = self.CreateStatusbar(statusbarItems)
         self.statusbar = self.CreateStatusbar(statusbarItems)
         self._addPanes()
         self._addPanes()

+ 5 - 0
gui/wxpython/iclass/toolbars.py

@@ -112,6 +112,11 @@ class IClassMapToolbar(BaseToolbar):
                 (None,),
                 (None,),
                 ("zoomBack", icons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomBack", icons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomToMap", icons["zoomExtent"], self.parent.OnZoomToMap),
                 ("zoomToMap", icons["zoomExtent"], self.parent.OnZoomToMap),
+                (
+                    "mapDispSettings",
+                    icons["mapDispSettings"],
+                    self.parent.OnMapDisplayProperties,
+                ),
             )
             )
         )
         )
 
 

+ 1 - 4
gui/wxpython/image2target/ii2t_mapdisplay.py

@@ -102,11 +102,8 @@ class MapPanel(SingleMapPanel):
             sb.SbCoordinates,
             sb.SbCoordinates,
             sb.SbRegionExtent,
             sb.SbRegionExtent,
             sb.SbCompRegionExtent,
             sb.SbCompRegionExtent,
-            sb.SbShowRegion,
-            sb.SbResolution,
             sb.SbDisplayGeometry,
             sb.SbDisplayGeometry,
             sb.SbMapScale,
             sb.SbMapScale,
-            sb.SbProjection,
             sbgcp.SbGoToGCP,
             sbgcp.SbGoToGCP,
             sbgcp.SbRMSError,
             sbgcp.SbRMSError,
         ]
         ]
@@ -114,7 +111,7 @@ class MapPanel(SingleMapPanel):
         # create statusbar and its manager
         # create statusbar and its manager
         self.statusbar = self.CreateStatusbar(statusbarItems)
         self.statusbar = self.CreateStatusbar(statusbarItems)
 
 
-        self.statusbarManager.SetMode(8)  # goto GCP
+        self.statusbarManager.SetMode(5)  # goto GCP
 
 
         #
         #
         # Init map display (buffered DC & set default cursor)
         # Init map display (buffered DC & set default cursor)

+ 6 - 0
gui/wxpython/image2target/ii2t_toolbars.py

@@ -126,6 +126,12 @@ class GCPDisplayToolbar(BaseToolbar):
                 ("zoomback", BaseIcons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomback", BaseIcons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomtomap", BaseIcons["zoomExtent"], self.parent.OnZoomToMap),
                 ("zoomtomap", BaseIcons["zoomExtent"], self.parent.OnZoomToMap),
                 (None,),
                 (None,),
+                (
+                    "mapDispSettings",
+                    BaseIcons["mapDispSettings"],
+                    self.parent.OnMapDisplayProperties,
+                ),
+                (None,),
                 ("settings", icons["settings"], self.parent.OnSettings),
                 ("settings", icons["settings"], self.parent.OnSettings),
                 ("help", icons["help"], self.parent.OnHelp),
                 ("help", icons["help"], self.parent.OnHelp),
                 (None,),
                 (None,),

+ 1 - 11
gui/wxpython/mapdisp/frame.py

@@ -1550,16 +1550,6 @@ class MapPanel(SingleMapPanel):
         self.PopupMenu(zoommenu)
         self.PopupMenu(zoommenu)
         zoommenu.Destroy()
         zoommenu.Destroy()
 
 
-    def OnMapDisplayProperties(self, event):
-        """Show Map Display Properties dialog"""
-        from mapdisp.properties import MapDisplayPropertiesDialog
-
-        dlg = MapDisplayPropertiesDialog(
-            parent=self, giface=self._giface, properties=self.mapWindowProperties
-        )
-        dlg.CenterOnParent()
-        dlg.Show()
-
     def SetProperties(
     def SetProperties(
         self,
         self,
         render=False,
         render=False,
@@ -1574,7 +1564,7 @@ class MapPanel(SingleMapPanel):
         if self.statusbarManager:
         if self.statusbarManager:
             self.statusbarManager.SetMode(mode)
             self.statusbarManager.SetMode(mode)
             self.StatusbarUpdate()
             self.StatusbarUpdate()
-            self.SetProperty("projection", projection)
+        self.mapWindowProperties.useDefinedProjection = projection
         self.mapWindowProperties.showRegion = showCompExtent
         self.mapWindowProperties.showRegion = showCompExtent
         self.mapWindowProperties.alignExtent = alignExtent
         self.mapWindowProperties.alignExtent = alignExtent
         self.mapWindowProperties.resolution = constrainRes
         self.mapWindowProperties.resolution = constrainRes

+ 12 - 12
gui/wxpython/mapdisp/properties.py

@@ -140,9 +140,9 @@ class ChBAlignExtent(PropertyItem):
 class ChBResolution(PropertyItem):
 class ChBResolution(PropertyItem):
     """Checkbox to select used display resolution."""
     """Checkbox to select used display resolution."""
 
 
-    def __init__(self, parent, giface, mapWindowProperties):
+    def __init__(self, parent, mapframe, mapWindowProperties):
         PropertyItem.__init__(self, mapWindowProperties)
         PropertyItem.__init__(self, mapWindowProperties)
-        self.giface = giface
+        self.mapFrame = mapframe
         self.name = "resolution"
         self.name = "resolution"
         self.widget = wx.CheckBox(
         self.widget = wx.CheckBox(
             parent=parent,
             parent=parent,
@@ -180,16 +180,16 @@ class ChBResolution(PropertyItem):
 
 
         # redraw map if auto-rendering is enabled
         # redraw map if auto-rendering is enabled
         if self._properties.autoRender:
         if self._properties.autoRender:
-            self.giface.updateMap.emit()
+            self.mapFrame.GetWindow().UpdateMap()
 
 
 
 
 class ChBShowRegion(PropertyItem):
 class ChBShowRegion(PropertyItem):
     """Checkbox to enable and disable showing of computational region."""
     """Checkbox to enable and disable showing of computational region."""
 
 
-    def __init__(self, parent, giface, mapWindowProperties):
+    def __init__(self, parent, mapframe, mapWindowProperties):
         PropertyItem.__init__(self, mapWindowProperties)
         PropertyItem.__init__(self, mapWindowProperties)
-        self.giface = giface
-        self.name = "region"
+        self.mapFrame = mapframe
+        self.name = "showRegion"
         self.widget = wx.CheckBox(
         self.widget = wx.CheckBox(
             parent=parent, id=wx.ID_ANY, label=_("Show computational extent")
             parent=parent, id=wx.ID_ANY, label=_("Show computational extent")
         )
         )
@@ -229,7 +229,7 @@ class ChBShowRegion(PropertyItem):
 
 
         # redraw map if auto-rendering is enabled
         # redraw map if auto-rendering is enabled
         if self._properties.autoRender:
         if self._properties.autoRender:
-            self.giface.updateMap.emit(render=False)
+            self.mapFrame.GetWindow().UpdateMap(render=False)
 
 
 
 
 class ChBProjection(PropertyItem):
 class ChBProjection(PropertyItem):
@@ -237,7 +237,7 @@ class ChBProjection(PropertyItem):
 
 
     def __init__(self, parent, mapWindowProperties):
     def __init__(self, parent, mapWindowProperties):
         PropertyItem.__init__(self, mapWindowProperties)
         PropertyItem.__init__(self, mapWindowProperties)
-        self.name = "projection"
+        self.name = "useDefinedProjection"
         self.defaultLabel = _("Display coordinates in different CRS")
         self.defaultLabel = _("Display coordinates in different CRS")
         self.widget = wx.CheckBox(parent=parent, id=wx.ID_ANY, label=self.defaultLabel)
         self.widget = wx.CheckBox(parent=parent, id=wx.ID_ANY, label=self.defaultLabel)
         self.widget.SetValue(self.mapWindowProperty)
         self.widget.SetValue(self.mapWindowProperty)
@@ -283,7 +283,7 @@ class MapDisplayPropertiesDialog(wx.Dialog):
     def __init__(
     def __init__(
         self,
         self,
         parent,
         parent,
-        giface,
+        mapframe,
         properties,
         properties,
         title=_("Map Display Settings"),
         title=_("Map Display Settings"),
         size=(-1, 250),
         size=(-1, 250),
@@ -294,7 +294,7 @@ class MapDisplayPropertiesDialog(wx.Dialog):
         self.parent = parent
         self.parent = parent
         self.title = title
         self.title = title
         self.size = size
         self.size = size
-        self.giface = giface
+        self.mapframe = mapframe
         self.mapWindowProperties = properties
         self.mapWindowProperties = properties
 
 
         # notebook
         # notebook
@@ -353,7 +353,7 @@ class MapDisplayPropertiesDialog(wx.Dialog):
 
 
         # Use computation resolution
         # Use computation resolution
         self.compResolution = ChBResolution(
         self.compResolution = ChBResolution(
-            panel, self.giface, self.mapWindowProperties
+            panel, self.mapframe, self.mapWindowProperties
         )
         )
         sizer.Add(
         sizer.Add(
             self.compResolution.GetWidget(),
             self.compResolution.GetWidget(),
@@ -364,7 +364,7 @@ class MapDisplayPropertiesDialog(wx.Dialog):
 
 
         # Show computation extent
         # Show computation extent
         self.showCompExtent = ChBShowRegion(
         self.showCompExtent = ChBShowRegion(
-            panel, self.giface, self.mapWindowProperties
+            panel, self.mapframe, self.mapWindowProperties
         )
         )
         sizer.Add(
         sizer.Add(
             self.showCompExtent.GetWidget(),
             self.showCompExtent.GetWidget(),

+ 6 - 226
gui/wxpython/mapdisp/statusbar.py

@@ -8,12 +8,8 @@ Classes:
  - statusbar::SbManager
  - statusbar::SbManager
  - statusbar::SbItem
  - statusbar::SbItem
  - statusbar::SbRender
  - statusbar::SbRender
- - statusbar::SbShowRegion
- - statusbar::SbAlignExtent
- - statusbar::SbResolution
  - statusbar::SbMapScale
  - statusbar::SbMapScale
  - statusbar::SbGoTo
  - statusbar::SbGoTo
- - statusbar::SbProjection
  - statusbar::SbTextItem
  - statusbar::SbTextItem
  - statusbar::SbDisplayGeometry
  - statusbar::SbDisplayGeometry
  - statusbar::SbCoordinates
  - statusbar::SbCoordinates
@@ -298,12 +294,6 @@ class SbManager:
     def OnToggleStatus(self, event):
     def OnToggleStatus(self, event):
         """Toggle status text"""
         """Toggle status text"""
         self.Update()
         self.Update()
-        if event.GetSelection() == 3 and self.HasProperty("region"):
-            # show computation region extent by default
-            self.statusbarItems["region"].SetValue(True)
-            # redraw map if auto-rendering is enabled
-            if self.mapFrame.IsAutoRendered():
-                self.mapFrame.GetWindow().UpdateMap(render=False)
 
 
     def SetMode(self, modeIndex):
     def SetMode(self, modeIndex):
         """Sets current mode
         """Sets current mode
@@ -434,172 +424,6 @@ class SbRender(SbItem):
         self.Show()
         self.Show()
 
 
 
 
-class SbShowRegion(SbItem):
-    """Checkbox to enable and disable showing of computational region.
-
-    Requires MapFrame.OnRender, MapFrame.IsAutoRendered, MapFrame.GetWindow.
-    """
-
-    def __init__(self, mapframe, statusbar, position=0):
-        SbItem.__init__(self, mapframe, statusbar, position)
-        self.name = "region"
-        self.label = _("Show comp. extent")
-        self._properties = mapframe.mapWindowProperties
-
-        self.widget = wx.CheckBox(
-            parent=self.statusbar, id=wx.ID_ANY, label=_("Show computational extent")
-        )
-        self.widget.SetValue(self._properties.showRegion)
-        self.widget.Hide()
-        self.widget.SetToolTip(
-            wx.ToolTip(
-                _(
-                    "Show/hide computational "
-                    "region extent (set with g.region). "
-                    "Display region drawn as a blue box inside the "
-                    "computational region, "
-                    "computational region inside a display region "
-                    "as a red box)."
-                )
-            )
-        )
-        self.widget.Bind(wx.EVT_CHECKBOX, self.OnToggleShowRegion)
-        self._connectShowRegion()
-
-    def _setValue(self, value):
-        self.widget.SetValue(value)
-
-    def _connectShowRegion(self):
-        self._properties.showRegionChanged.connect(self._setValue)
-
-    def _disconnectShowRegion(self):
-        self._properties.showRegionChanged.disconnect(self._setValue)
-
-    def OnToggleShowRegion(self, event):
-        """Shows/Hides extent (comp. region) in map canvas.
-
-        Shows or hides according to checkbox value.
-
-        .. todo::
-            needs refactoring
-        """
-        self._disconnectShowRegion()
-        self._properties.showRegion = self.widget.GetValue()
-        self._connectShowRegion()
-
-        # redraw map if auto-rendering is enabled
-        if self.mapFrame.IsAutoRendered():
-            self.mapFrame.GetWindow().UpdateMap(render=False)
-
-    def SetValue(self, value):
-        self._disconnectShowRegion()
-        self._properties.showRegion = value
-        SbItem.SetValue(self, value)
-        self._connectShowRegion()
-
-
-class SbAlignExtent(SbItem):
-    """Checkbox to select zoom behavior.
-
-    Used by BufferedWindow (through MapFrame property).
-    See tooltip for explanation.
-    """
-
-    def __init__(self, mapframe, statusbar, position=0):
-        SbItem.__init__(self, mapframe, statusbar, position)
-        self.name = "alignExtent"
-        self.label = _("Display mode")
-        self._properties = mapframe.mapWindowProperties
-
-        self.widget = wx.CheckBox(
-            parent=self.statusbar,
-            id=wx.ID_ANY,
-            label=_("Align region extent based on display size"),
-        )
-        self.widget.SetValue(self._properties.alignExtent)
-        self.widget.Hide()
-        self.widget.SetToolTip(
-            wx.ToolTip(
-                _(
-                    "Align region extent based on display "
-                    "size from center point. "
-                    "Default value for new map displays can "
-                    "be set up in 'User GUI settings' dialog."
-                )
-            )
-        )
-        self._connectAlignExtent()
-        self.widget.Bind(wx.EVT_CHECKBOX, self._onCheckbox)
-
-    # TODO: these four methods are in many stitems
-    # some generalization?
-    # passing properties as stings and set/get attr would work, but it is nice?
-    def _setValue(self, value):
-        self.widget.SetValue(value)
-
-    def _connectAlignExtent(self):
-        self._properties.alignExtentChanged.connect(self._setValue)
-
-    def _disconnectAlignExtent(self):
-        self._properties.alignExtentChanged.disconnect(self._setValue)
-
-    def _onCheckbox(self, event):
-        self._disconnectAlignExtent()
-        self._properties.alignExtent = self.widget.GetValue()
-        self._connectAlignExtent()
-
-
-class SbResolution(SbItem):
-    """Checkbox to select used display resolution.
-
-    Requires MapFrame.OnRender method.
-    """
-
-    def __init__(self, mapframe, statusbar, position=0):
-        SbItem.__init__(self, mapframe, statusbar, position)
-        self.name = "resolution"
-        self.label = _("Display resolution")
-        self._properties = self.mapFrame.mapWindowProperties
-        self.widget = wx.CheckBox(
-            parent=self.statusbar,
-            id=wx.ID_ANY,
-            label=_("Constrain display resolution to computational settings"),
-        )
-        self.widget.SetValue(self._properties.resolution)
-        self.widget.Hide()
-        self.widget.SetToolTip(
-            wx.ToolTip(
-                _(
-                    "Constrain display resolution "
-                    "to computational region settings. "
-                    "Default value for new map displays can "
-                    "be set up in 'User GUI settings' dialog."
-                )
-            )
-        )
-
-        self.widget.Bind(wx.EVT_CHECKBOX, self.OnToggleUpdateMap)
-        self._connectResolutionChange()
-
-    def _setValue(self, value):
-        self.widget.SetValue(value)
-
-    def _connectResolutionChange(self):
-        self._properties.resolutionChanged.connect(self._setValue)
-
-    def _disconnectResolutionChange(self):
-        self._properties.resolutionChanged.disconnect(self._setValue)
-
-    def OnToggleUpdateMap(self, event):
-        """Update display when toggle display mode"""
-        self._disconnectResolutionChange()
-        self._properties.resolution = self.widget.GetValue()
-        self._connectResolutionChange()
-        # redraw map if auto-rendering is enabled
-        if self.mapFrame.IsAutoRendered():
-            self.mapFrame.GetWindow().UpdateMap()
-
-
 class SbMapScale(SbItem):
 class SbMapScale(SbItem):
     """Editable combobox to get/set current map scale.
     """Editable combobox to get/set current map scale.
 
 
@@ -744,7 +568,9 @@ class SbGoTo(SbItem):
         """Go to position"""
         """Go to position"""
         try:
         try:
             e, n = self.GetValue().split(";")
             e, n = self.GetValue().split(";")
-            e, n = self.ReprojectENToMap(e, n, self.mapFrame.GetProperty("projection"))
+            e, n = self.ReprojectENToMap(
+                e, n, self.mapFrame.GetProperty("useDefinedProjection")
+            )
             self.mapFrame.GetWindow().GoTo(e, n)
             self.mapFrame.GetWindow().GoTo(e, n)
             self.widget.SetFocus()
             self.widget.SetFocus()
         except ValueError:
         except ValueError:
@@ -790,7 +616,7 @@ class SbGoTo(SbItem):
             group="projection", key="statusbar", subkey="proj4"
             group="projection", key="statusbar", subkey="proj4"
         )
         )
 
 
-        if self.mapFrame.GetProperty("projection"):
+        if self.mapFrame.GetProperty("useDefinedProjection"):
             if not projection:
             if not projection:
                 raise SbException(_("Projection not defined (check the settings)"))
                 raise SbException(_("Projection not defined (check the settings)"))
             else:
             else:
@@ -841,52 +667,6 @@ class SbGoTo(SbItem):
         self.mapFrame.StatusbarEnableLongHelp(False)
         self.mapFrame.StatusbarEnableLongHelp(False)
 
 
 
 
-class SbProjection(SbItem):
-    """Checkbox to enable user defined projection (can be set in settings)"""
-
-    def __init__(self, mapframe, statusbar, position=0):
-        SbItem.__init__(self, mapframe, statusbar, position)
-        self.name = "projection"
-        self.label = _("Projection")
-
-        self.defaultLabel = _("Use defined projection")
-
-        self.widget = wx.CheckBox(
-            parent=self.statusbar, id=wx.ID_ANY, label=self.defaultLabel
-        )
-
-        self.widget.SetValue(False)
-
-        # necessary?
-        size = self.widget.GetSize()
-        self.widget.SetMinSize((size[0] + 150, size[1]))
-
-        self.widget.Hide()
-        self.widget.SetToolTip(
-            wx.ToolTip(
-                _(
-                    "Reproject coordinates displayed "
-                    "in the statusbar. Projection can be "
-                    "defined in GUI preferences dialog "
-                    "(tab 'Projection')"
-                )
-            )
-        )
-
-    def Update(self):
-        self.statusbar.SetStatusText("")
-        epsg = UserSettings.Get(group="projection", key="statusbar", subkey="epsg")
-        if epsg:
-            label = "%s (EPSG: %s)" % (self.defaultLabel, epsg)
-            self.widget.SetLabel(label)
-        else:
-            self.widget.SetLabel(self.defaultLabel)
-        self.Show()
-
-        # disable long help
-        self.mapFrame.StatusbarEnableLongHelp(False)
-
-
 class SbTextItem(SbItem):
 class SbTextItem(SbItem):
     """Base class for items without widgets.
     """Base class for items without widgets.
 
 
@@ -966,7 +746,7 @@ class SbCoordinates(SbTextItem):
             UserSettings.Get(group="projection", key="format", subkey="precision")
             UserSettings.Get(group="projection", key="format", subkey="precision")
         )
         )
         format = UserSettings.Get(group="projection", key="format", subkey="ll")
         format = UserSettings.Get(group="projection", key="format", subkey="ll")
-        projection = self.mapFrame.GetProperty("projection")
+        projection = self.mapFrame.GetProperty("useDefinedProjection")
         try:
         try:
             e, n = self.mapFrame.GetWindow().GetLastEN()
             e, n = self.mapFrame.GetWindow().GetLastEN()
             self._basicValue = self.ReprojectENFromMap(
             self._basicValue = self.ReprojectENFromMap(
@@ -1049,7 +829,7 @@ class SbRegionExtent(SbTextItem):
             UserSettings.Get(group="projection", key="format", subkey="precision")
             UserSettings.Get(group="projection", key="format", subkey="precision")
         )
         )
         format = UserSettings.Get(group="projection", key="format", subkey="ll")
         format = UserSettings.Get(group="projection", key="format", subkey="ll")
-        projection = self.mapFrame.GetProperty("projection")
+        projection = self.mapFrame.GetProperty("useDefinedProjection")
         region = self._getRegion()
         region = self._getRegion()
         try:
         try:
             regionReprojected = self.ReprojectRegionFromMap(
             regionReprojected = self.ReprojectRegionFromMap(

+ 2 - 2
gui/wxpython/mapdisp/toolbars.py

@@ -184,8 +184,8 @@ class MapToolbar(BaseToolbar):
                 ("overlay", BaseIcons["overlay"], self.OnDecoration),
                 ("overlay", BaseIcons["overlay"], self.OnDecoration),
                 ("saveFile", BaseIcons["saveFile"], self.parent.SaveToFile),
                 ("saveFile", BaseIcons["saveFile"], self.parent.SaveToFile),
                 (
                 (
-                    "showMapSettings",
-                    BaseIcons["settings"],
+                    "mapDispSettings",
+                    BaseIcons["mapDispSettings"],
                     self.parent.OnMapDisplayProperties,
                     self.parent.OnMapDisplayProperties,
                 ),
                 ),
             )
             )

+ 0 - 4
gui/wxpython/mapswipe/frame.py

@@ -99,13 +99,9 @@ class SwipeMapPanel(DoubleMapPanel):
             sb.SbCoordinates,
             sb.SbCoordinates,
             sb.SbRegionExtent,
             sb.SbRegionExtent,
             sb.SbCompRegionExtent,
             sb.SbCompRegionExtent,
-            sb.SbShowRegion,
-            sb.SbAlignExtent,
-            sb.SbResolution,
             sb.SbDisplayGeometry,
             sb.SbDisplayGeometry,
             sb.SbMapScale,
             sb.SbMapScale,
             sb.SbGoTo,
             sb.SbGoTo,
-            sb.SbProjection,
         ]
         ]
         self.statusbar = self.CreateStatusbar(statusbarItems)
         self.statusbar = self.CreateStatusbar(statusbarItems)
 
 

+ 5 - 0
gui/wxpython/mapswipe/toolbars.py

@@ -71,6 +71,11 @@ class SwipeMapToolbar(BaseToolbar):
                 ("zoomToMap", icons["zoomExtent"], self.parent.OnZoomToMap),
                 ("zoomToMap", icons["zoomExtent"], self.parent.OnZoomToMap),
                 (None,),
                 (None,),
                 ("saveFile", icons["saveFile"], self.parent.SaveToFile),
                 ("saveFile", icons["saveFile"], self.parent.SaveToFile),
+                (
+                    "mapDispSettings",
+                    BaseIcons["mapDispSettings"],
+                    self.parent.OnMapDisplayProperties,
+                ),
             )
             )
         )
         )
 
 

+ 1 - 4
gui/wxpython/photo2image/ip2i_mapdisplay.py

@@ -96,18 +96,15 @@ class MapPanel(SingleMapPanel):
             sb.SbCoordinates,
             sb.SbCoordinates,
             sb.SbRegionExtent,
             sb.SbRegionExtent,
             sb.SbCompRegionExtent,
             sb.SbCompRegionExtent,
-            sb.SbShowRegion,
-            sb.SbResolution,
             sb.SbDisplayGeometry,
             sb.SbDisplayGeometry,
             sb.SbMapScale,
             sb.SbMapScale,
-            sb.SbProjection,
             sbgcp.SbGoToGCP,
             sbgcp.SbGoToGCP,
             sbgcp.SbRMSError,
             sbgcp.SbRMSError,
         ]
         ]
 
 
         # create statusbar and its manager
         # create statusbar and its manager
         self.statusbar = self.CreateStatusbar(statusbarItems)
         self.statusbar = self.CreateStatusbar(statusbarItems)
-        self.statusbarManager.SetMode(8)  # goto GCP
+        self.statusbarManager.SetMode(5)  # goto GCP
 
 
         #
         #
         # Init map display (buffered DC & set default cursor)
         # Init map display (buffered DC & set default cursor)

+ 6 - 0
gui/wxpython/photo2image/ip2i_toolbars.py

@@ -126,6 +126,12 @@ class GCPDisplayToolbar(BaseToolbar):
                 ("zoomback", BaseIcons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomback", BaseIcons["zoomBack"], self.parent.OnZoomBack),
                 ("zoomtomap", BaseIcons["zoomExtent"], self.parent.OnZoomToMap),
                 ("zoomtomap", BaseIcons["zoomExtent"], self.parent.OnZoomToMap),
                 (None,),
                 (None,),
+                (
+                    "mapDispSettings",
+                    BaseIcons["mapDispSettings"],
+                    self.parent.OnMapDisplayProperties,
+                ),
+                (None,),
                 ("settings", icons["settings"], self.parent.OnSettings),
                 ("settings", icons["settings"], self.parent.OnSettings),
                 ("help", icons["help"], self.parent.OnHelp),
                 ("help", icons["help"], self.parent.OnHelp),
                 (None,),
                 (None,),