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: Joe Strout <joe@inspiringapps.com>
Date: Thu, 29 Jan 2009 13:12:04 -0700
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: <A777E56C-DEDE-4216-9FF6-0518265FEEDE@mac.com>
Organization: Inspiring Applications, Inc.
References: <4981FD59.4030502@inspiringapps.com> <A777E56C-DEDE-4216-9FF6-0518265FEEDE@mac.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.19 (Macintosh/20081209)
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>


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