Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: VID focus questions

From: dlhawley:attbi at: 5-Feb-2002 14:29

Brett, This works nicely for one check, but when I tried to expand it for multiple ones I got stuck. I tried to put your do [my-check/feel ... info a block of feels: [ space-check [<what goes here>/feel: make <what goes here>/feel ... with the idea that I could do something like mc1: check do feels/space-check mc2: check do feels/space-check better would be to make a style space-check but am having trouble generalizing this also. Got any ideas on how to do this? Also, still having trouble with passing focus onto multiple checks, radios, choice and so on. Dave Brett Handley wrote:
>Hi David, > >>>How does one do the following: >>> >>>1: give focus to a check, choice, button >>>2: keep focus off of an info or list >>>3: make radio's non-exclusive >>>4: make a choice keycode pickable >>> > >I see you have replies to 2 and 3 so I'll make reply to 1. > >Focus can be set with the FOCUS function: > >view layout [ > my-check: check > do [focus my-check] >] > >However, a check doesn't look like it is focussed. Maybe the redraw function >for the check and the other styles need amendment. > >I'm sipping on some wine, so it has probably affected my priorities! Instead >of addressing the visual aspect of focussing >I got involved with what happens if you hit the space bar. In Windows doing >so when a check box is focussed will toggle >the check box off and on. So this is what I've done with this next bit of >code: > >view layout [ > my-check: check > do [my-check/feel: make my-check/feel [ > engage: func [face action event] [ > either all [equal? event/type 'key equal? event/key #" "] [ > system/view/vid/vid-feel/check/engage face 'down event > ] [ > system/view/vid/vid-feel/check/engage face action event > ] > ] > ] > ] > do [focus my-check] >] > >In essence I've replaced the feel for the check box with a modified version. >In the modified version the engage function is redefined to trap the space >bar keystroke. If a space keystoke is detected, a simulated mouse down call >is made to the original engage function. Other calls to engage are routed to >the original functionality. > >Now I shoudl sleep off this nice wine :) > >I hope this helps *and* is relevant! >Brett >
-- David L. Hawley D.L. Hawley and Associates 1.503.274.2242 Software Engineer [David--L--Hawley--computer--org]