Page 1 of 2

Scrolling List Field

Posted: Mon Jul 07, 2008 6:40 am
by bjb007
Spend some hours trying all the
variations/combinations I can think
of to get the visible item of a scrolling
list field into a variable.

Exhausted...

Help appreciated.

Posted: Mon Jul 07, 2008 9:26 am
by Mark
Hi BJB,

What is a "visible item"? If you mean the property, you can retrieve this like any other property:

get the visible of fld x
put the visible of fld x into myVar

Best,

Mark

Scrolling List Field

Posted: Mon Jul 07, 2008 9:37 am
by bjb007
Mark
That's one of the many things I tried.

With your suggestion the variable has
"true" in it rather than the value of
the visible item (a number).

Posted: Mon Jul 07, 2008 9:46 am
by Mark
Hi BJB,

Why, yes of course, true or false. Why would you expect a number?

Mark

Scrolling List Field

Posted: Mon Jul 07, 2008 9:50 am
by bjb007
Well, "true" (whatever it means) isn't
much use, is it?

What does it mean?

Whereas the number would be very
handy.

Posted: Mon Jul 07, 2008 10:00 am
by Mark
Hi BJB,

What would you do with the number? Could you please explain what you want?

Best,

Mark

Scrolling List Field

Posted: Mon Jul 07, 2008 10:14 am
by bjb007
I want to use the numbers
indicate how many occurrences
of a condition are present in data sets.

So I want the user to be able to
choose 2 and 5, say, to check if
there are two occurrences in the
last 5 sets of date or 3 in 5 or 4 in
6 etc.

So need to get the numbers into
variables.

Posted: Mon Jul 07, 2008 10:19 am
by Mark
BJB,

I don't understand what occurrences of numbers in datasets have to do with the visible property of a field.

Best,

Mark

Scrolling List Field

Posted: Mon Jul 07, 2008 11:19 am
by bjb007
Can't really explain it better.
Just want to use the two numbers
which the user has chosen in the
scrolling fields at the bottom...

Image

Posted: Mon Jul 07, 2008 11:21 am
by Mark
Hi BJB,

Try this:

put the label of btn x into myVar

Best,

Mark

Scrolling List Field

Posted: Mon Jul 07, 2008 12:54 pm
by bjb007
Mark
That gives a compiler error at "of".

Have also tried a list field with no more
success than with the scrolling list field.

BTW am I odd in feeling that when I click
the "down" arrow on the scrollbar that I
should go to the next item down rather
than up?

The scrollbars in the Inspector behave the
same way which seems counter-intuitive to
me. Get around it by listing items from
largest to smallest!

Starting to wonder what these objects
are meant to be used for. Not much use
just having items to look at!

Scrolling List Field

Posted: Mon Jul 07, 2008 1:39 pm
by bjb007
Problem solved.

Place a button
Set style to menu
In the Inspector set type to "Option"
then "put label of button....." does
the trick.

Is there a place to change a button
style to "Menu" apart from programming it?

All of which, of course, still leaves the question
of what can one do with a scrolling list field -
apart from admiring it.

Posted: Mon Jul 07, 2008 2:29 pm
by Mark
Hi BJB,

What you call a scrolling list field is actually called a combo box. This caused me a lot of confusion.

The syntax "put the label of btn...." works for me, if used with a combo box. Apparently you do something wrong there. You might want to post your script.

Best,

Mark

Scrolling List Field

Posted: Mon Sep 08, 2008 3:18 am
by bjb007
Mark

There is an item on the Object palette
with the title of "Scrolling List Field"
and one named "Combo Box".

If it really is a combo box perhaps the
name should be changed.

Posted: Mon Sep 08, 2008 6:10 am
by Janschenkel
Actually, the item seen at the bottom of the screenshot is probably not a combobox. It may or may not be a scrolling list field - but it looks much more like an attempt to make a 'spinner' field, where you can increase the value b clcking in the 'upward' button and decrease it by clicking in the 'downward' button.

Revolution does not have a baked-in 'spinner' field. Just going out on a limb here, I suggest that bjb007 is actually using a really short scrolling list field with all the values separated by returns.

If that is the case (a few screenshots of the Inspector palette would confirm this) then it's a matter of getting the 'vScroll' property of the field and dividing that by the 'textHeight' of the field. You may have to add some fudge factor here to get it just right.

A quick test based on the above assumption showed the following to work:

Code: Select all

on mouseUp
   put the vScroll of field 1 into tVScroll
   put the effective textHeight of field 1 into tTextHeight
   answer (tVScroll DIV tTextHeight) + 1
end mouseUp
If you're looking to quickly build a spinner, you may be interested in the 'Objects library' in the 'Development' menu in the Rev IDE - there's an item 'Little arrows generic' which you can place onto your card and with a few properties link to a field and enter minimum and maximum values.

Hope this helped,

Jan Schenkel.