Grid-cell renderers/editors going into the next column to the right

I'm using 2.4.0.2u (Robin's binary build on Win32 for Python 2.2.2).

I'm seeing two likely related problems. The default text renderer, in columns which are narrower than the width required to display the full text of a particular cell, will display that cell as if the width of the cell was the width of the current cell plus that of the cell to the right. When this condition is met, the editing control for the cell (regardless of whether this is the default text editor or a custom editor) also takes over the same cell range.

Code was functional under 2.3.3.xA, when using strings. Data being displayed is now Unicode strings, but other than that there has been no change to the relevant code (indeed, there is no rendering code, it's just the default string renderer and editor).

It almost looks as though the Grid is calling GetBestSize for each string cell to determine the size of that particular cell, rather than limiting the cell to the minimum of the column width and the best size width.

I'm still trying to provoke the same reaction in a version of the grid demos, no luck as yet, just wondering if anyone has seen a similar problem.

Enjoy yourselves,
Mike

···

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/

Mike C. Fletcher wrote:

I'm using 2.4.0.2u (Robin's binary build on Win32 for Python 2.2.2).

I'm seeing two likely related problems. The default text renderer, in columns which are narrower than the width required to display the full text of a particular cell, will display that cell as if the width of the cell was the width of the current cell plus that of the cell to the right. When this condition is met, the editing control for the cell (regardless of whether this is the default text editor or a custom editor) also takes over the same cell range.

This is part of some new features of the grid. The cells are allowed by default to overflow into the neighboring cells. You can call SetOverflow(false) to turn it off.

···

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

Just to clarify for those following along at home, the SetOverflow method is available on the GridCellAttribute object, and there is a corresponding method on the Grid object:

    wxGrid::SetDefaultCellOverflow( bool allow )

which will, strangely enough, set the default for this property for a given grid. (There are also methods to set the property for a particular cell for your non-table-based grids).

I have added a small section to the wiki grid manual on the overflow functionality, though it currently lacks such useful information as "why it's defaulting to false when previous functionality was equipment to true" :wink: .

    http://wiki.wxpython.org/index.cgi/wxGrid

Thanks, Robin, your help was most appreciated,
Mike

Robin Dunn wrote:

···

Mike C. Fletcher wrote:

I'm using 2.4.0.2u (Robin's binary build on Win32 for Python 2.2.2).

I'm seeing two likely related problems. The default text renderer, in columns which are narrower than the width required to display the full text of a particular cell, will display that cell as if the width of the cell was the width of the current cell plus that of the cell to the right. When this condition is met, the editing control for the cell (regardless of whether this is the default text editor or a custom editor) also takes over the same cell range.

This is part of some new features of the grid. The cells are allowed by default to overflow into the neighboring cells. You can call SetOverflow(false) to turn it off.

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/