Re: [dabo-users] New/returned user - question about editing/adding data on 'browse' form

Author: Chris G

Posted: 2011-10-14 at 12:49:30

On Fri, Oct 14, 2011 at 10:03:44AM -0500, Ed Leafe wrote:

> > It doesn't

> > work when I put it in ui/GrdLog.py (the application is called log). If

> > I put:-

> >

> > self.bindEvent(dabo.dEvents.KeyDown, self.handleKey)

> >

> > then handleKey gets called for non-printing characters but not for

> > printing characters. If I put:-

> >

> > self.bindEvent(dabo.dEvents.KeyChar, self.handleKey)

> >

> > then handleKey *never* gets called for any entered character.

> >

> > I suspect that I'm calling bindEvent() from the wrong place?

>

> It figures that you would start with the most complex control! ;-)

>

Well of course!

> Grids are composed of several controls internally, making coordinating events difficult. If you then make the grid editable, then the temporary control that appears to handle the editing also has to deal with the events involved. When you edit in a grid, under the hood wxPython creates a textbox that appears where the grid cell is, and which then sends the result of your editing back to the grid. That's why grid editing is discouraged for all but the most straightforward cases.

>

> If you really need to go down this road, grid columns can have a CustomEditorClass, which is a control class that you define that is shown when that column is being edited. As you might imagine, this is somewhat complex and is probably not the place for someone new to Dabo to start; it's more of a power user feature.

>

OK, thanks for this (and all the other) help, I think I'm still

suffering a bit from "run before I walk" but I've already got a long way

towards what I want.

--

Chris Green

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/20111014164930.GJ5876@chris

©2011 Chris G