Filling data fields from a multiple choice list

Sarah Reichelt sarah.reichelt at gmail.com
Tue Apr 18 22:32:42 EDT 2006


> I have a multi-card stack containing data fields that I must fill in.
> I have a list of standard texts, one of which must be selected
> to be put into my fields.
>
> At the moment, I use an "on mouseUp" handler in the text field
> to go to card 1 and display a text list. This text list has an "on
> mouseUp" handler which uses the clickline function to pick
> up one of the lines, and insert it into my data field.
>
> I works fine, but it requires two clicks (So Sad !).
>
> Can I display, by clicking in my data field, a sort of menu list
> (containing all my possible standard texts), where, by shifting
> the mouse to the required line, I can pick up the text I require
> to fill my data field (something like "pulldown") ?
>
> Having never seen an example of "pulldown", I don't know if
> I can use it for this problem.
>

Hi Francis,

Make a popup menu button, call it "Popup", group it and set it's
backgroundBehavior to true so that it will appear on all cards. Place
that group on all your data cards. (If they already have a common
background group, just make the popup part of that group). Make the
popup invisible.

Now script the data field as follows (assuming that the list field on
card 1 is called "List"):

on mouseUp
  put field "List" of card 1 into button "Popup"
  popup button "Popup" at the mouseLoc
end mouseUp

Then script the popup button:

on menuPick pChoice
  -- pChoice contains the selected item from the popup menu
  -- so now do what you usually do when someone clicks
  -- on the list field in card 1
end menuPick

Hope this helps,
Sarah



More information about the use-livecode mailing list