selecting from a list with aid of keyboard

MisterX b.xavier at internet.lu
Thu May 5 13:56:08 EDT 2005


in the field's script you could use the following scripts anytime! 

These are TAOO's basic behavior templates in field objects.

to handle line scrolling (or wrapping too) and first letter scrolling.
to add a second letter scrolling i would add a time stamp where if there is
a new key pressed in the next 1 or 2 seconds, you find the laststring, else
you start from scratch. Also consider what column of your table fields is
sorted to help jump to the right column... 

I cant give it all away yet but this should get you going!


on rawkeydown which
  local hl,maxl
  
  put the hilitedline of me into hl
  put the number of lines in me into maxL
  switch which
  case 65362
     
    if hl > 1 then subtract 1 from hl
    else put maxL into hl
    set the hilitedline of me to hl
    mouseup
    break
  
  case 65364
    if hl <= maxL then
     add 1 to hl
    else
     put 1 into hl
     set the vscroll of me to 0
    end if
    set the hilitedline of me to hl
    mouseup
    break
  
  case 65421
    -- TAOO's custom editors 
    -- works like renaming files in ie explorer or the finder
    -- in a list of items. Also works for menus.  
    -- XOSAlignScrollingEditControl "RenameField"
    show fld "RenameField"
    get the hilitedtext of me
    delete char 1 to 2 of it
    delete char offset(tab,it) to -1 of it
    put it into fld "renameField"
    Select line 1 of fld "renameField"
    break
  default
    -- search typed text
    -- modify depending what your field contains that should be scrolled to
    get offset(cr&which,me) 
    -- not optimized for huge lists but should work fine.
    set the hilitedline of me to (the number of lines in char 1 to it of me)
    pass rawkeydown
  end switch
end rawkeydown



> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Kurt Kaufman
> Sent: Thursday, May 05, 2005 17:23
> To: use-revolution at lists.runrev.com
> Subject: selecting from a list with aid of keyboard
> 
> I know that this issue was addressed sometime in the last 
> couple of years, but I can't seem to locate it:
> 
> When selecting a single line from a scrolling list (this 
> being a Rev list, not the OS file selection box)it would be 
> useful to enter 1-3 keys to have the field scroll to the 
> entered letter, or letters. 
> 
> Could someone point me to the discussion of that subject?
> 
> Thanks, Kurt
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list