AW: How to access the text of an option btn before menuPick?
Tiemo Hollmann TB
toolbook at kestner.de
Mon Oct 12 05:07:31 EDT 2015
Developing on Windows, I wasn't aware that the behavior on Mac is just like
I wanted it to be. I was just thinking much to complicated.
With some more tweaks with the formattedWidth getting from the longest line
of the text and handling the icons of the button I followed your nice script
Phil.
Thanks Jacqueline and Phil
Tiemo
-----Ursprüngliche Nachricht-----
Von: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] Im Auftrag
von Phil Davis
Gesendet: Freitag, 9. Oktober 2015 22:59
An: How to use LiveCode <use-livecode at lists.runrev.com>
Betreff: Re: How to access the text of an option btn before menuPick?
Hi Tiemo,
On a Mac, the option button list is shown at the full width of the text it
contains.
I haven't tried it on other platforms. If it doesn't work that way on your
platform, you could do something like this (in the button script):
local sOriginalRect
on menuPick pItemName
restoreMe
answer pItemName
end menuPick
on mouseDown
if sOriginalRect is empty then put the rect of me into sOriginalRect
put sOriginalRect into tRect
put (item 1 of tRect + the formattedWidth of me) into item 3 of tRect
set the rect of me to tRect
end mouseDown
on mouseLeave
restoreMe
end mouseLeave
command restoreMe
lock screen
set the rect of me to sOriginalRect
unlock screen
end restoreMe
Hope this helps -
Phil Davis
On 10/9/15 5:48 AM, Tiemo Hollmann TB wrote:
> Hello,
>
> I have an option button with long text lines as options, but the button
> itself is smaller (width) as the text lines (because of layout
> restrictions), so that you can't read the full text of the options.
>
> Now I would like to find any solution to show the user the full content of
> the text lines before he clicks any choice. Either by hovering or right
> click or anything else I would like to put the line into the tooltip or
> anything else. By now I failed to grab the hilitedLine of the option menu.
>
> Any idea how to access the text by hovering or right click?
>
> Thanks
>
> Tiemo
>
>
>
>
>
>
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
--
Phil Davis
_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list