Example #1
0
 def BeginEdit(self, row, col, grid):
     self.startValue = grid.GetTable().GetValue(row, col)
     format = geocacher.config().coordinateFormat
     self._tc.SetValue(degToStr(self.startValue, format, self.mode))
     self._tc.SetInsertionPointEnd()
     self._tc.SetFocus()
     self._tc.SetSelection(0, self._tc.GetLastPosition())
Example #2
0
 def BeginEdit(self, row, col, grid):
     self.startValue = grid.GetTable().GetValue(row, col)
     format = geocacher.config().coordinateFormat
     self._tc.SetValue(degToStr(self.startValue, format, self.mode))
     self._tc.SetInsertionPointEnd()
     self._tc.SetFocus()
     self._tc.SetSelection(0, self._tc.GetLastPosition())
Example #3
0
 def TransferToWindow(self):
     textCtrl = self.GetWindow()
     value = self.data.get(self.key, 0)
     if self.new:
         textCtrl.SetValue("")
     else:
         textCtrl.SetValue(degToStr(value, geocacher.config().coordinateFormat, self.mode))
     return True
Example #4
0
 def TransferToWindow(self):
     textCtrl = self.GetWindow()
     value = self.data.get(self.key, 0)
     if self.new:
         textCtrl.SetValue('')
     else:
         textCtrl.SetValue(
             degToStr(value,
                      geocacher.config().coordinateFormat, self.mode))
     return True
Example #5
0
    def Draw(self, grid, attr, dc, rect, row, col, isSelected):
        value = self.table.GetValue(row, col)
        try:
            text = degToStr(value,
                            geocacher.config().coordinateFormat, self.mode)
        except:
            text = ''
        hAlign, vAlign = attr.GetAlignment()
        dc.SetFont(attr.GetFont())
        if isSelected:
            bg = grid.GetSelectionBackground()
            fg = grid.GetSelectionForeground()
        else:
            bg = grid.GetDefaultCellBackgroundColour()
            fg = grid.GetDefaultCellTextColour()

        dc.SetTextBackground(bg)
        dc.SetTextForeground(fg)
        dc.SetBrush(wx.Brush(bg, wx.SOLID))
        dc.SetPen(wx.TRANSPARENT_PEN)
        dc.DrawRectangleRect(rect)
        grid.DrawTextRectangle(dc, text, rect, hAlign, vAlign)
Example #6
0
    def Draw(self, grid, attr, dc, rect, row, col, isSelected):
        value = self.table.GetValue(row, col)
        try:
            text = degToStr(value,
                            geocacher.config().coordinateFormat,
                            self.mode)
        except:
            text = ''
        hAlign, vAlign = attr.GetAlignment()
        dc.SetFont(attr.GetFont())
        if isSelected:
            bg = grid.GetSelectionBackground()
            fg = grid.GetSelectionForeground()
        else:
            bg = grid.GetDefaultCellBackgroundColour()
            fg = grid.GetDefaultCellTextColour()

        dc.SetTextBackground(bg)
        dc.SetTextForeground(fg)
        dc.SetBrush(wx.Brush(bg, wx.SOLID))
        dc.SetPen(wx.TRANSPARENT_PEN)
        dc.DrawRectangleRect(rect)
        grid.DrawTextRectangle(dc, text, rect, hAlign, vAlign)
Example #7
0
 def GetBestSize(self, grid, attr, dc, row, col):
     value = self.table.GetValue(row, col)
     text = degToStr(value, geocacher.config().coordinateFormat, self.mode)
     w, h = dc.GetTextExtent(text)
     return wx.Size(w, h)
Example #8
0
 def Reset(self):
     self._tc.SetValue(degToStr(self.startValue, format, self.mode))
     self._tc.SetInsertionPointEnd()
Example #9
0
 def Reset(self):
     self._tc.SetValue(degToStr(self.startValue, format, self.mode))
     self._tc.SetInsertionPointEnd()
Example #10
0
 def GetBestSize(self, grid, attr, dc, row, col):
     value = self.table.GetValue(row, col)
     text = degToStr(value, geocacher.config().coordinateFormat, self.mode)
     w, h = dc.GetTextExtent(text)
     return wx.Size(w, h)