design of radio-button choice

Alex Tweedly alex at tweedly.net
Thu Aug 4 15:59:24 EDT 2005


Charles Hartman wrote:

> I've got a complicated dialog (too complicated! but it will look  
> simple to the user I think), and I can't figure out how best to  
> design it to deal with the messaging system.
>
> This card in the dialog has a column of half a dozen check-boxes, and  
> a column of a dozen or so radio buttons in a group. The user will  
> click a check box (probably all of them all in turn, but in any  
> order). Each time one is checked, I clear the hilite from the grouop  
> of radio buttons, and the user picks one of them. (There's a right  
> radio-button answer for each check-box; it's a tutorial.)
>
> So I want is that when the user clicks a check-box, I wait until the  
> user picks one of the radio buttons (or maybe until the user picks  
> the correct one -- that's a detail I can decide later on UI grounds).  
> What's the best way to do this? The "wait" command? If so, I assume  
> I'd put it in the handler for each check-box, and I guess I'd have to  
> make the radio-button group emit a custom message when a button (or  
> the right button) is pressed. Is that right, or even close to right?

I think when you say "I wait until the user picks ..." what you mean is 
"I don't respond to any further clicks on the check boxes until ...". If 
so, then you don't need to do a "wait" command in a script - simply keep 
track of what your status is (maybe in a global, maybe in a custom 
property, maybe....lots of other ways).

Also, consider putting the check-boxes into a group, and having a single 
handler for the group ....

-- group handler for all the check-boxes
on mouseUp
   if gWaitingForRadioButtonChoice then
      pass mouseUp
  end if
  -- no longer waiting - so we should respond to any clicks
   put the target into lBoxClicked
   switch lBoxClicked
    case "Box1"
      ....      -- set up the radio button labels, etc.
      put true into gWaitingForRadioButtonChoice
    case "Box2"
    ....
  end switch
endmouseUp
  
and then in the radio button script,

-- handler for radio buttons
on mouseUp
    -- if this is an answer (or if correct ??)
    put false into gWaitingForRadioButtonChoice
    etc.
end mouseUp

(where gWaitingForRadioButtonChoice is, obviously, a global)



-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.0/63 - Release Date: 03/08/2005




More information about the use-livecode mailing list