Formatted Width of a Tabbed button
Ray Horsley
ray at linkitonline.com
Wed Feb 8 06:56:06 CST 2006
Hi Ken,
That did the trick!
Thanks for your help. Very much appreciated!
Ray Horsley
Developer, LinkIt! Software
On Feb 7, 2006, at 9:55 PM, Ken Ray wrote:
> On 2/7/06 7:12 PM, "Ray Horsley" <ray at linkitonline.com> wrote:
>
>> I'm just trying to find out how wide I have to make the button in
>> order
>> to see all the tabs. Unlike other button styles, a tabbed button
>> shows
>> all lines of its contents, but the formattedWidth property only
>> returns
>> the width of one line of the contents. I'd like to get the width of
>> all the contents as they're displayed horizontally.
>>
>> Thanks for your concern. Let me know if you've got any ideas.
>
> Here you go, Ray... try this:
>
> on mouseUp
> put tabFormattedWidth(long id of btn 1) into tWidth
> set the width of btn 1 to tWidth
> end mouseUp
>
> function tabFormattedWidth pBtnDesc
> put the text of pBtnDesc into tTabs
> lock screen
> put 0 into tWidth
> put the number of lines of tTabs into tNum
> put the label of pBtnDesc into tOrigLabel
> repeat with x = 1 to tNum
> set the label of pBtnDesc to (line x of tTabs)
> put the formattedWidth of pBtnDesc into tFW
> add tFW to tWidth
> end repeat
> put tWidth + (18* tNum) into tWidth
> set the label of pBtnDesc to tOrigLabel
> unlock screen
> return tWidth
> end tabFormattedWidth
>
> HTH,
>
> Ken Ray
> Sons of Thunder Software
> Web site: http://www.sonsothunder.com/
> Email: kray at sonsothunder.com
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
More information about the metacard
mailing list