realbasic-nug
[Top] [All Lists]

Re: Incorrect tabbing in editable listbox

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Incorrect tabbing in editable listbox
From: Tom Benson <tombenson@mac.com>
Date: Thu, 29 Jan 2009 20:24:28 +0000
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <49820D94.1040301@inspiringapps.com>
References: <4981FD59.4030502@inspiringapps.com> <A777E56C-DEDE-4216-9FF6-0518265FEEDE@mac.com> <49820D94.1040301@inspiringapps.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
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>


<Prev in Thread] Current Thread [Next in Thread>