Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Repulsing the cursor in a face
Pages: [1] Print
Author Topic: Repulsing the cursor in a face  (Read 540 times)
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
Repulsing the cursor in a face
« on: February 22, 2007, 09:16:18 PM »

This function below handles the clicking of one of four adjacent / overlayed text-lists.
Only the 4th text-list (regnumber) contains guaranteed 'unique' values and hence the only one that guarantees that the 'formula' for getting the proper series pickPoint will work.  Are there any characteristics that could be assigned to the other three text-lists, which (along with some visual directions) can force the user to select the 'row' needed only by clicking on the 'regnumber' text-list  ?

hiLites: func [data picked][
    pickPoint: (length? data) - (length? find/only data picked)  + 1
    lastName/picked: to-block mold pick  lname pickPoint
    firstName/picked: to-block mold pick fname pickPoint
    middleInit/picked: to-block mold pick midInit pickPoint
    regnumber/picked: to-block pick regnbr pickPoint
    show [lastName firstName middleInit regnumber]
 
    data-block: skip data-block pickPoint
    oneLine/text: rejoin [data-block/:pickPoint/1 "    " data-block/:pickPoint/2 "    "    data-block/:pickPoint/3  "    " data-block/:pickPoint/4]
    show oneLine
    data-block: head data-block       
]
   
Logged
jfdutcher
Jr. Member
**
Offline Offline

Posts: 95


View Profile
Re: Repulsing the cursor in a face
« Reply #1 on: February 24, 2007, 05:49:57 PM »

I yield ......and see the idiocy of this late night post when my head had fallen on the table top for the third time.....removing the execution block from the 'style' that was employed solves the issue.......
Logged
Anton
Jr. Member
**
Offline Offline

Posts: 65

Rebol veteran


View Profile WWW
Re: Repulsing the cursor in a face
« Reply #2 on: February 25, 2007, 11:55:22 PM »

The first line in your function can be optimized to:

    pickPoint: index? find/only data picked

Hmm.. don't forget to set 'pickPoint to be a local word to your function:

    hiLites: func [data picked /local pickPoint][...

and probably best to avoid converting to string and back to block in the other lines:

    lastName/picked: copy pick lname pickPoint  ; (you probably don't even need COPY)

Also, this is probably equivalent result:

    oneLine/text: reform datablock/:pickPoint
Logged
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Repulsing the cursor in a face
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 29, 2008, 03:12:15 AM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2232 Posts in 580 Topics by 1736 Members
Latest Member: goceertarramy

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc