Hmmm... maybe one of us should wrap the listbox into a datagrid???
On 29/01/2009, at 8:12 PM, Joe Strout wrote:
Tom Benson wrote:
I thought that had always been the case??
For as long as I remember I've had to handle tabbing between cells
myself...
Hmm, perhaps you're right -- I've been using wxPython lately, which
handles this automatically, so perhaps I was confused. I just tried
it in 2007r4, and that also doesn't tab to the next cell, though at
least it correctly tabs out to the next control.
Simple example (doesn't handle column bounds etc...)
CellKeyDown
if key = kTabKey then
me.editcell(x+1,y)
return true
end
Yes, a bit TOO simple perhaps. :) Here's mine:
Function CellKeyDown(row as Integer, column as Integer, key as
String) As Boolean
if key = chr(9) then
// handle proper tabbing between cells
Dim dx As Integer
if Keyboard.ShiftKey then dx = -1 else dx = 1
do
column = column + dx
if column < 0 then
row = row - 1
if row < 0 then return false
column = me.ColumnCount - 1
elseif column >= me.ColumnCount then
row = row + 1
column = 0
if row >= me.ListCount then return false
end if
if me.ColumnType(column) = Listbox.TypeEditable _
or me.CellType(row, column) = Listbox.TypeEditable then exit do
loop
me.EditCell( row, column )
me.ActiveCell.SelectAll
return true
end if
End Function
Best,
- Joe
--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|