Beispiel #1
0
 def Validate(self, win):
     textCtrl = self.GetWindow()
     if strToDeg(textCtrl.GetValue(), self.mode) == None:
         textCtrl.SetBackgroundColour('pink')
         message = _(
             'The highlighted field must be in one of the following formats:'
         )
         if self.mode == 'lat':
             message = message + '''
 N12 34.345
 S12 34 45.6
 S12.34567
 -12.34567'''
         elif self.mode == 'lon':
             message = message + '''
 E12 34.345
 W12 34 45.6
 W12.34567
 -12.34567'''
         else:
             message = message + '''
 12 34.345
 12 34 45.6
 12.34567'''
         wx.MessageBox(message, _('Input Error'))
         textCtrl.SetFocus()
         textCtrl.Refresh()
         return False
     else:
         textCtrl.SetBackgroundColour(
             wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
         textCtrl.Refresh()
         return True
Beispiel #2
0
    def EndEdit(self, row, col, grid):
        changed = False

        value = strToDeg(self._tc.GetValue(), self.mode)

        if value != self.startValue:
            changed = True
            grid.GetTable().SetValue(row, col, value)

        return changed
Beispiel #3
0
    def EndEdit(self, row, col, grid):
        changed = False

        value = strToDeg(self._tc.GetValue(), self.mode)

        if value != self.startValue:
            changed = True
            grid.GetTable().SetValue(row, col, value)

        return changed
Beispiel #4
0
 def Validate(self, win):
     textCtrl = self.GetWindow()
     if strToDeg(textCtrl.GetValue(), self.mode) == None:
         textCtrl.SetBackgroundColour("pink")
         message = _("The highlighted field must be in one of the following formats:")
         if self.mode == "lat":
             message = (
                 message
                 + """
 N12 34.345
 S12 34 45.6
 S12.34567
 -12.34567"""
             )
         elif self.mode == "lon":
             message = (
                 message
                 + """
 E12 34.345
 W12 34 45.6
 W12.34567
 -12.34567"""
             )
         else:
             message = (
                 message
                 + """
 12 34.345
 12 34 45.6
 12.34567"""
             )
         wx.MessageBox(message, _("Input Error"))
         textCtrl.SetFocus()
         textCtrl.Refresh()
         return False
     else:
         textCtrl.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
         textCtrl.Refresh()
         return True
Beispiel #5
0
 def TransferFromWindow(self):
     textCtrl = self.GetWindow()
     self.data[self.key] = strToDeg(textCtrl.GetValue(), self.mode)
     return True
Beispiel #6
0
 def TransferFromWindow(self):
     textCtrl = self.GetWindow()
     self.data[self.key] = strToDeg(textCtrl.GetValue(), self.mode)
     return True