Grid cell float editor and renderer editing problem

Hi,

I am using wxPy 2515, Py 233 on Win98.

I have a grid with the following properties:

editor = wx.grid.GridCellFloatEditor()
editor.SetParameters("0,1") #width 0, precision 1

attr = wx.grid.GridCellAttr()
attr.SetEditor(editor)

#width 0, precision 1
attr.SetRenderer(wx.grid.GridCellFloatRenderer(0, 1))

self.grid.SetColAttr(0, attr)
self.grid.SetColAttr(1, attr)
self.grid.SetColAttr(2, attr)
attr.IncRef()

When I enter "1.11" into a cell, the cell shows "1.1"
and the cell value is "1.11". OK.

When I activate the editor for that cell and press Esc
to abort editing, the cell still shows "1.1" but the
cell value becomes "1.1".

This should be a bug?

Thanks,
Steven.

Steven Pang wrote:

Hi,

I am using wxPy 2515, Py 233 on Win98.

I have a grid with the following properties:

editor = wx.grid.GridCellFloatEditor()
editor.SetParameters("0,1") #width 0, precision 1

attr = wx.grid.GridCellAttr()
attr.SetEditor(editor)

#width 0, precision 1
attr.SetRenderer(wx.grid.GridCellFloatRenderer(0, 1))

self.grid.SetColAttr(0, attr)
self.grid.SetColAttr(1, attr)
self.grid.SetColAttr(2, attr)
attr.IncRef()

When I enter "1.11" into a cell, the cell shows "1.1"
and the cell value is "1.11". OK.

Entered via the editor or programatically via SetCellValue or the table?

When I activate the editor for that cell and press Esc
to abort editing, the cell still shows "1.1" but the
cell value becomes "1.1".

This should be a bug?

I don't think so. The editor is truncating to the precision you specified.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!