[wxPython] problem with wxPyGridCellEditor

Has anyone noticed that when inheriting from wxPyGridCellEditor, the
method SetSize sends rect.y = -1 when the cell at the top is to be
edited??

To see the problem just run GridCustEditor.py, and begin editing any
cell of the third column, and then try to edit the top cell of that
column, and you'll se how the text control pops up in the wrong place.

Is this a known bug??

Raul Cota

P.S. win NT, wxPython 2.3.1, python 2.1

Has anyone noticed that when inheriting from wxPyGridCellEditor, the
method SetSize sends rect.y = -1 when the cell at the top is to be
edited??

To see the problem just run GridCustEditor.py, and begin editing any
cell of the third column, and then try to edit the top cell of that
column, and you'll se how the text control pops up in the wrong place.

Is this a known bug??

Not a bug, just the way it works. To fix the apparent bug you just have to
use the wxSIZE_ALLOW_MINUS_ONE flag, since -1 is a valid coordinant that
unfortunatly is also used by wxWindows to mean "leave it as is."

    def SetSize(self, rect):
        """
        Called to position/size the edit control within the cell rectangle.
        If you don't fill the cell (the rect) then be sure to override
        PaintBackground and do something meaningful there.
        """
        self.log.write("MyCellEditor: SetSize %s\n" % rect)
        self._tc.SetDimensions(rect.x, rect.y, rect.width+2, rect.height+2,
                               wxSIZE_ALLOW_MINUS_ONE)

ยทยทยท

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