How to hide scroll if field does not require it
Web Admin Himalayan Academy
katir at hindu.org
Wed May 26 13:00:08 EDT 2010
Formatted width was the obviously way to go, but as with some many xTalk
things: how best to implement? attached it to the field (as you have
done) put it in the stack script and call it when the card is opened,
what if you have a menu that is loading the field by chosing a folder...
I don't do enough professional apps to always know what is the best way
to do things, I pretty much hack my way through to something that just
works. I'll use Devin's little handler.
I'm creating right now a fairly sophisticated little app for revision
control of InDesign Files for a team of editors (since Adobe saw fit
to drop it's Version Cue product, which was badly broken anyway) has
more code than anything I have done in the past (nearly 400 lines now in
the stack script)... I'm already in trouble trying to use "private
command preopencard" to prevent things from happening when substacks are
opened, but if you privatize commands, sometimes they just don't work
and I don't understand why. I got a lot of globals going and sometimes
they just turn up empty....at least from a handler's point of view, but
if I check them in the msg box, they have values! dunno why, nothing is
resetting them, so I started setting up custom props on the fly as these
seem to be less volatile... I'm starting to wish I had a better grip on
"best practices" Hence I always run to this list for help from the pros.
command enableScrollbarIfNeeded pFldName
if the formattedHeight of fld pFldName> the height of fld pFldName then
set the vScrollbar of fld pFldName to true
else
set the vScrollbar of fld pFldName to false
end if
end enableScrollbarIfNeeded
Thanks Devin!
On 5/26/10 6:45 AM, Mark Schonewille wrote:
> Sivakatirswami,
>
> Do you mean that you would like fields to do this automatically? The
> following works for a simple editable field:
>
> on rawKeyUp
> set the vScrollbar of me to (the formattedHeight of me > the
> height of me)
> pass rawKeyUp
> end rawKeyUp
>
> It is easy to add a similar feature to your own script. What is your
> own solution?
>
> --
> Best regards,
>
> Mark Schonewille
>
More information about the use-livecode
mailing list