Date: Wed Mar 24 08:36:10 MST 1999 From: Brennan Young <brennan@YOUNG.NET> Subject: The last property dialog secret?NERD PORN ALERT!
Recently I learned that the slider controls created with #range for a #float property in getpropertydescriptionlist can be enhanced with the properties #increment, #acceleration and #jump, which some of you may recognise from MUI.
on getpropertydescriptionlist me
set range to [#min:0,#max:255,#increment:1.0,#jump:10.0,#acceleration:0.5]
return [#myFloat:[#comment:"This",#format:#float,#default:0.1,#range:range]]
end
(Many thanks to Felix Guerrero for discovering/revealing this tidbit.) I thought this was the last secret of the property dialog box but NO!
Just by accident I just stumbled upon the fact that if the value of #range is a linear list (producing a popup list) and that one of those values is *either* a string beginning with a hyphen / minus sign, i.e. "-", or a negative number, this appears in the popup list as A HORIZONTAL DIVIDER (wow!). Here's a quick example:
on getpropertydescriptionlist me
set range to ["Upper", "-", "Lower"]
return [#that:[#comment:"That",#format:#string,#default:"Upper",#range:range]]
end
This is a bit of a nuisance if you want negative numbers or the string
starting with"-" to appear in the popup for people to select. A
workaround is to use strings and insert a space before the hyphen. As
long as the format is specified as #integer or #float or whatever, this
causes no trouble, so you'll not even need to use the integer() or
value() function to get the actual value. Another example:
on getPropertyDescriptionList me
set range to [" -1","-","0","-","1","-","2"]
return [#this:[#comment:"This",#format:#integer,#default:1,#range:range]]
end
I'm all ears if anyone has discovered anything else in every lingo
programmer's favorite GUI device. Something tells me that semi-random
experiments with properties appearing as part of MUI might eventually
reveal some other hidden goodies.
Brennan Young
Artist, Composer and Multimedia programmer
brennan@young.net
"If you play a wrong note, play it again twice as loud and everyone will
think you did it on purpose the first time."
-Thelonious Monk