Three stage checkbox?

Jan Schenkel janschenkel at yahoo.com
Wed Feb 4 03:51:03 EST 2004


--- Sarah Reichelt <sarahr at genesearch.com.au> wrote:
> While normally I would agree with this and am
> familiar with the 
> techniques for using radio buttons, I have a
> database with numerous 
> fields and then a separate list of 20 items with the
> 3 options as 
> discussed. If I use 3 radio buttons for each item,
> that gives me a 
> display of 60 buttons! In this case, I think the
> users would be much 
> more comfortable with a single button for each item,
> which can display 
> the 3 different states.
> 
> Cheers,
> Sarah
> 

Hi Sarah,

How about using an option-menu instead of a
three-state checkbox or a set of radiobuttons ?
You could even accomodate for keyboard jockeys by
using comboboxes with the following little script,
which prevents users from entering in an answer that's
not in the items, while typing ahead for them the way
Excel does.
--
on keyDown pKey
  # fetch the menuitems and the typed text
  put the text of me into tMenuItems
  put the text of the target into tText
  # find out what was selected
  put the selectedChunk of the target into tChunk
  put word 2 of tChunk into tStart
  put word 4 of tChunk into tEnd
  # determine tSearchKey = the text after typing
  if tEnd < tStart
    # this means no text is selected
    put char 1 to tStart of tText & pKey & \
        char (tStart + 1) to -1 of tText \
        into tSearchKey
  else
    put char 1 to (tStart - 1) of tText & pKey & \
        char (tEnd + 1) to -1 of tText \
        into tSearchKey
  end if
  # now let's see if there is such an item
  filter tMenuItems with (tSearchKey & "*")
  # and react appropriately
  if the number of lines of tMenuItems > 0 then
    set the text of the target to \
        line 1 of tMenuItems
    select char (tStart + 1) to -1 of the target
  else beep
end keyDown
--

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


More information about the use-livecode mailing list