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

Author: Chris G

Posted: 2011-10-13 at 16:57:17

On Thu, Oct 13, 2011 at 02:58:33PM -0500, Ed Leafe wrote:

> On Oct 13, 2011, at 2:35 PM, Chris G wrote:

>

> > I'm still digging around in the event handling to find where to add

> > events for using the tab key for moving from column to column (and,

> > hopefully, to add a new row when at the last column).

>

> You could start by binding the KeyDown event of the grid to a method; not sure how it would work with editable columns, though. If you get stuck, post what you've done and we can help from there.

>

Yes, I've done that! :-)

My application is called 'log' just to clarify the names below.

I have put the following into class GrdLog:-

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

def handleKey(self, p2):

print "Entering handleKey()"

btn = dabo.ui.dButton(self, Caption="Click Me")

print "Leaving handleKey()"

... and it works to the extent that I see the print messages on the

console when I hit a key that doesn't already perform a function.

However I need some pointers to more documentation:-

What parameters are passed to the callback function, the new documentation at

http://thewinecellarbook.com/daboDocTestAlt/dabo.lib.eventMixin.EventMixin.html?highlight=bindevent#dabo.lib.eventMixin.EventMixin.bindEvent

doesn't seem to tell me. I guess it's documented somewhere but I

can't find it at the moment.

Some keys are handled already, so that when I hit ordinary

letter/number etc. keys they get entered into the field I'm editing

but when I hit TAB my callback function is called. So where is this

done? It would be useful to know which key codes will be handed on

to my callback function.

I'm not getting to see the button I hoped to create with

dabo.ui.dButton().

I need some pointers to documentation to show me how to move focus

on the form I have created. Basically what I need is a 'nextColumn'

method so that when I hit TAB I can move the keyboard focus to the

next column.

Wouldn't it be reasonable for TAB to move between records in the Browse

view as it already does in the Edit view?

--

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/20111013205717.GA20924@chris

©2011 Chris G