Re: selecting from a list with aid of keyboard

2005-05-05 Thread J. Landman Gay
On 5/5/05 10:22 AM, Kurt Kaufman wrote:
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?
Here's mine (watch for line wrap):
local lOldTicks,lUserKeys
on keyDown  whichKey -- select from keyboard
  -- J. Landman Gay, 1990, modified for Revolution: 2003
  if (the selectedField is not "") or (charToNum(whichKey) is among the 
items of "28,29,30,31") -- arrow keys
  then pass keyDown
  if the ticks - lOldTicks > 60 then put "" into lUserKeys
  put whichKey after lUserKeys
  put return & fld 1 & return into tListText
  get lineoffset(cr&lUserKeys,tListText)
  if it > 0 then set the hilitedlines of fld 1 to it
  put the ticks into lOldTicks
end keyDown

This allows you to type more than just the first character of a line to 
hone in on an exact line match. If the user pauses for more than a 
second (60 ticks,) then the collected keystrokes are abandoned and the 
search starts over. You can adjust the timing by changing the "60" to 
something else.

--
Jacqueline Landman Gay | [EMAIL PROTECTED]
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


selecting from a list with aid of keyboard

2005-05-05 Thread Kurt Kaufman
Thanks, "Mister X".  I see how I can adapt your script.
-Kurt
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: selecting from a list with aid of keyboard

2005-05-05 Thread MisterX

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: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Kurt Kaufman
> Sent: Thursday, May 05, 2005 17:23
> To: use-revolution@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@lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 

___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


selecting from a list with aid of keyboard

2005-05-05 Thread Kurt Kaufman
Well, here's a start:
(script of list "thelist")
on keydown whichkey
if whichkey is not in "abcdefghijklmnopqrstuvwxyz" then exit mousedown
repeat with x = 1 to the number of lines in cd fld "thelist"
  if the first char of line x of cd fld "thelist" = whichkey then
 select line x of cd fld "thelist"
 exit repeat
  end if
end repeat
pass keydown
end keydown
___
use-revolution mailing list
use-revolution@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


selecting from a list with aid of keyboard

2005-05-05 Thread Kurt Kaufman
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@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution