wx.grid annoyances

I want a wx.grid display an option box as displayed by
wx.grid.GridCellBoolEditor, not the ugly version that is displayed by
wx.grid.GridCellBoolRenderer

Furthermore, I want a "natural" behaviour of the cell element - meaning if a
boolean (option) widget is displayed, all user I tried this with expect that
when they click on it, the option will be toggled. They are all puzzled and
confused if the first mouse click just selects the widget, the second mouse
click then changes it's appearance, and sometimes changes the option unless
they have to exert a third mouse click.

How can I do this? The current default behaviour of the grid violates just
about any guidelines on good user interface design.

Horst

Horst Herb wrote:

I want a wx.grid display an option box as displayed by wx.grid.GridCellBoolEditor, not the ugly version that is displayed by wx.grid.GridCellBoolRenderer

I hear you, and am almost ready to start researching what to do about it for Dabo. FWIW, the renderer is only ugly on Mac and Linux, on Windows it looks just fine. If you figure out what to do first, please post your solution here, otherwise I'll reply back.

Furthermore, I want a "natural" behaviour of the cell element - meaning if a boolean (option) widget is displayed, all user I tried this with expect that when they click on it, the option will be toggled. They are all puzzled and confused if the first mouse click just selects the widget, the second mouse click then changes it's appearance, and sometimes changes the option unless they have to exert a third mouse click.

How can I do this? The current default behaviour of the grid violates just about any guidelines on good user interface design.

You can bind the left mouse click on the cell (wx.EVT_CELL_LEFT_CLICK IIRC) and then: grid.ShowCellEditControl()

I agree that that should be the default, but I could also see cases where you don't want users mistakenly making changes to data.

···

--
Paul McNett
http://paulmcnett.com
http://dabodev.com

Paul McNett wrote:

Horst Herb wrote:

I want a wx.grid display an option box as displayed by wx.grid.GridCellBoolEditor, not the ugly version that is displayed by wx.grid.GridCellBoolRenderer

I hear you, and am almost ready to start researching what to do about it for Dabo. FWIW, the renderer is only ugly on Mac and Linux, on Windows it looks just fine. If you figure out what to do first, please post your solution here, otherwise I'll reply back.

By the way, I just found this page which looks to have the instructions we are looking for to define our own non-ugly bool renderers:

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

···

--
Paul McNett
http://paulmcnett.com
http://dabodev.com

Paul McNett wrote:

Horst Herb wrote:

Furthermore, I want a "natural" behaviour of the cell element - meaning if a boolean (option) widget is displayed, all user I tried this with expect that when they click on it, the option will be toggled. They are all puzzled and confused if the first mouse click just selects the widget, the second mouse click then changes it's appearance, and sometimes changes the option unless they have to exert a third mouse click.

Even worse, when using a Choice cell renderer the selected value is ignored when leaving the edit mode. It does work though when using the keyboard, i.e. pressing space to activate it, selecting with up/down and pressing return to leave the edit mode.

You can bind the left mouse click on the cell (wx.EVT_CELL_LEFT_CLICK IIRC) and then: grid.ShowCellEditControl()

Unfortunately this doesn't do anything on linux/GTK2. The event is processed but the cell doesn't change its view. What could I have done wrong?

Regards, Christian

Christian Kristukat wrote:

Unfortunately this doesn't do anything on linux/GTK2. The event is processed but the cell doesn't change its view. What could I have done wrong?

You also need to do a grid.EnableEditing() at some point...

Paul McNett wrote:

Christian Kristukat wrote:

Unfortunately this doesn't do anything on linux/GTK2. The event is processed but the cell doesn't change its view. What could I have done wrong?

You also need to do a grid.EnableEditing() at some point...

I take all this back. I can't get EnableCellEditControl() to work either.

Paul McNett wrote:

Paul McNett wrote:

Christian Kristukat wrote:

Unfortunately this doesn't do anything on linux/GTK2. The event is processed but the cell doesn't change its view. What could I have done wrong?

You also need to do a grid.EnableEditing() at some point...

I take all this back. I can't get EnableCellEditControl() to work either.

Ok, I was able to get EnableCellEditControl() to work from within an EVT_GRID_SELECT_CELL handler, but only by using wx.CallAfter(self.EnableCellEditControl). But it still isn't right yet: the editor gets enabled but the checkbox doesn't get toggled with that first click.

···

--
Paul McNett
http://paulmcnett.com
http://dabodev.com

Paul McNett wrote:

Paul McNett wrote:

Paul McNett wrote:

Christian Kristukat wrote:

Unfortunately this doesn't do anything on linux/GTK2. The event is processed but the cell doesn't change its view. What could I have done wrong?

You also need to do a grid.EnableEditing() at some point...

I take all this back. I can't get EnableCellEditControl() to work either.

Ok, I was able to get EnableCellEditControl() to work from within an EVT_GRID_SELECT_CELL handler, but only by using wx.CallAfter(self.EnableCellEditControl). But it still isn't right yet: the editor gets enabled but the checkbox doesn't get toggled with that first click.

The same applies for the Choice control: it shows up and nothing more. It would be nice to have the cell renderer rendering the cell at any time not only when it is activated. Like this we could forget about an ugly preview.
Christian