Index: mapdisp.py =================================================================== --- mapdisp.py (Revision 38376) +++ mapdisp.py (Arbeitskopie) @@ -153,8 +153,8 @@ # # Add statusbar # - self.statusbar = self.CreateStatusBar(number=4, style=0) - self.statusbar.SetStatusWidths([-5, -2, -1, -1]) + self.statusbar = self.CreateStatusBar(number=6, style=0) + self.statusbar.SetStatusWidths([-5, -2, -1, -1, -2, -2]) self.statusbarWin = dict() self.statusbarWin['toggle'] = wx.Choice(self.statusbar, wx.ID_ANY, choices = globalvar.MAP_DISPLAY_STATUSBAR_MODE) @@ -162,6 +162,19 @@ key='statusbarMode', subkey='selection')) self.statusbar.Bind(wx.EVT_CHOICE, self.OnToggleStatus, self.statusbarWin['toggle']) + # proj_info: projection info for status bar + self.statusbarWin['proj_info'] = wx.StaticText(parent = self.statusbar, id = wx.ID_ANY, + label = '') + + self.statusbarWin['proj_info'].SetForegroundColour(wx.Colour(255, 0, 0)) + self.statusbarWin['proj_info'].SetToolTip(wx.ToolTip + (_("Code of the projection used for coordinates in status bar"))) + + + # project checkbox + self.statusbarWin['project'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY, + label=_("Project")) + self.statusbar.Bind(wx.EVT_CHECKBOX, self.OnToggleRender, self.statusbarWin['project']) # auto-rendering checkbox self.statusbarWin['render'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY, label=_("Render")) @@ -170,6 +183,16 @@ key='autoRendering', subkey='enabled')) self.statusbarWin['render'].SetToolTip(wx.ToolTip (_("Enable/disable auto-rendering"))) + +# self.statusbarWin['project'].SetValue(UserSettings.Get(group='display', +# key='autoProject', +# subkey='enabled')) + self.statusbarWin['project'].SetToolTip(wx.ToolTip (_("Reproject coordinates displayed " + "in the statusbar. Projection can be " + "defined in GUI preferences dialog " + "(tab 'Projection')"))) +# + # show region self.statusbarWin['region'] = wx.CheckBox(parent=self.statusbar, id=wx.ID_ANY, label=_("Show computational extent")) @@ -314,7 +337,7 @@ BottomDockable(False).TopDockable(True). CloseButton(False).Layer(2). BestSize((self.toolbars['map'].GetToolbar().GetSize()))) - + # vector digitizer elif name == "vdigit": from vdigit import haveVDigit @@ -348,7 +371,7 @@ BottomDockable(False).TopDockable(True). CloseButton(False).Layer(2). BestSize((self.toolbars['vdigit'].GetToolbar().GetSize()))) - + # change mouse to draw digitized line self.MapWindow.mouse['box'] = "point" self.MapWindow.zoomtype = 0 @@ -567,7 +590,7 @@ precision, distance_seg, precision, distance_tot), 0) else: - if self.statusbarWin['projection'].IsChecked(): + if self.statusbarWin['projection'].IsChecked() or self.statusbarWin['project'].IsChecked(): if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'): self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0) else: @@ -816,7 +839,7 @@ Go to position """ try: - if self.statusbarWin['projection'].IsChecked(): + if self.statusbarWin['projection'].IsChecked() or self.statusbarWin['project'].IsChecked(): if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'): self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0) else: @@ -848,7 +871,7 @@ e, n = map(float, self.statusbarWin['goto'].GetValue().split(';')) region = self.Map.GetCurrentRegion() - if self.statusbarWin['projection'].IsChecked(): + if self.statusbarWin['projection'].IsChecked() or self.statusbarWin['project'].IsChecked(): if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'): self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0) else: @@ -901,7 +924,19 @@ self.statusbarWin['goto'].Hide() self.statusbarWin['projection'].Hide() self.mapScaleValue = self.ppm = None - + + if self.statusbarWin['projection'].IsChecked() or self.statusbarWin['project'].IsChecked(): + epsg = UserSettings.Get(group='projection', key='statusbar', subkey='epsg') + if epsg: + label = 'EPSG: %s' % (epsg) + self.statusbarWin['proj_info'].SetLabel(label) + else: + self.statusbarWin['proj_info'].SetLabel(_("defined")) + self.statusbarWin['proj_info'].Show() + else: + label = 'default: %s' % ('g.proj -p') + self.statusbarWin['proj_info'].SetLabel(label) + if self.statusbarWin['toggle'].GetSelection() == 0: # Coordinates self.statusbar.SetStatusText("", 0) # enable long help @@ -919,7 +954,7 @@ format = UserSettings.Get(group = 'projection', key = 'format', subkey = 'll') - if self.statusbarWin['projection'].IsChecked(): + if self.statusbarWin['projection'].IsChecked() or self.statusbarWin['project'].IsChecked(): if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'): self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0) else: @@ -1072,7 +1107,7 @@ format = UserSettings.Get(group = 'projection', key = 'format', subkey = 'll') - if self.statusbarWin['projection'].IsChecked(): + if self.statusbarWin['projection'].IsChecked() or self.statusbarWin['project'].IsChecked(): if not UserSettings.Get(group='projection', key='statusbar', subkey='proj4'): self.statusbar.SetStatusText(_("Projection not defined (check the settings)"), 0) else: @@ -1137,7 +1172,9 @@ (0, self.statusbarWin['projection']), (1, self.statusbarWin['toggle']), (2, self.statusbarWin['mask']), - (3, self.statusbarWin['render'])] + (3, self.statusbarWin['render']), + (4, self.statusbarWin['proj_info']), + (5, self.statusbarWin['project'])] for idx, win in widgets: rect = self.statusbar.GetFieldRect(idx) if idx == 0: # show region / mapscale / process bar