Segmented Control Widget

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Segmented Control Widget

ELS Prothero via use-livecode
I have been messing about with the Segmented Control Widget and have been trying to apply a tooltip.

I noted that the tooltip can only be applied to the whole control, it does not appear possible to have a tooltip for each segment.

Is this possible and if so could someone please advise.


All the best


Terry
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Segmented Control Widget

ELS Prothero via use-livecode
On 11/5/20 1:47 AM, Terence Heaford via use-livecode wrote:
> I have been messing about with the Segmented Control Widget and have been trying to apply a tooltip.
>
> I noted that the tooltip can only be applied to the whole control, it does not appear possible to have a tooltip for each segment.
>
> Is this possible and if so could someone please advise.

I've done this with a custom control group, it should work with a widget too. Calculate the
rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler
compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the
appropriate string. You can also add a mouseMove handler to do the same thing if you want to
change tooltips as the mouseLoc changes inside the widget.

If the updated tooltip doesn't display reliably, set the tooltip to empty, wait a millisecond
or so, and then set it to the new string.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Segmented Control Widget

ELS Prothero via use-livecode
The segmented control is fairly limited. Most of the widgets are. The properties you see are the properties you get. I did however, with a bit of clever scripting, develop a tabbed object group that works as well or better that the built in tabbed button. And for a bonus, it looks in Windows the same as it loos on the Mac. Really, the Windows UI is really horrible for LC. I just gotta say. It puts the Ugh in Ughly.

Bob S


> On Nov 5, 2020, at 12:10 PM, J. Landman Gay via use-livecode <[hidden email]> wrote:
>
> On 11/5/20 1:47 AM, Terence Heaford via use-livecode wrote:
>> I have been messing about with the Segmented Control Widget and have been trying to apply a tooltip.
>> I noted that the tooltip can only be applied to the whole control, it does not appear possible to have a tooltip for each segment.
>> Is this possible and if so could someone please advise.
>
> I've done this with a custom control group, it should work with a widget too. Calculate the rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the appropriate string. You can also add a mouseMove handler to do the same thing if you want to change tooltips as the mouseLoc changes inside the widget.
>
> If the updated tooltip doesn't display reliably, set the tooltip to empty, wait a millisecond or so, and then set it to the new string.
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Segmented Control Widget

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
Thanks for your suggestion will give it a try.

All the best

Terry

> On 5 Nov 2020, at 20:10, J. Landman Gay via use-livecode <[hidden email]> wrote:
>
> On 11/5/20 1:47 AM, Terence Heaford via use-livecode wrote:
>> I have been messing about with the Segmented Control Widget and have been trying to apply a tooltip.
>> I noted that the tooltip can only be applied to the whole control, it does not appear possible to have a tooltip for each segment.
>> Is this possible and if so could someone please advise.
>
> I've done this with a custom control group, it should work with a widget too. Calculate the rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the appropriate string. You can also add a mouseMove handler to do the same thing if you want to change tooltips as the mouseLoc changes inside the widget.
>
> If the updated tooltip doesn't display reliably, set the tooltip to empty, wait a millisecond or so, and then set it to the new string.
>
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Segmented Control Widget

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode
I can see the advantages of doing it yourself and intend trying both methods as suggested by yourself and Jaqueline.

I have noted when trying some of the widgets that they do seem to be rather incomplete.

All the best

Terry


> On 5 Nov 2020, at 22:43, Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> The segmented control is fairly limited. Most of the widgets are. The properties you see are the properties you get. I did however, with a bit of clever scripting, develop a tabbed object group that works as well or better that the built in tabbed button. And for a bonus, it looks in Windows the same as it loos on the Mac. Really, the Windows UI is really horrible for LC. I just gotta say. It puts the Ugh in Ughly.
>
> Bob S
>
>
>> On Nov 5, 2020, at 12:10 PM, J. Landman Gay via use-livecode <[hidden email]> wrote:
>>
>> On 11/5/20 1:47 AM, Terence Heaford via use-livecode wrote:
>>> I have been messing about with the Segmented Control Widget and have been trying to apply a tooltip.
>>> I noted that the tooltip can only be applied to the whole control, it does not appear possible to have a tooltip for each segment.
>>> Is this possible and if so could someone please advise.
>>
>> I've done this with a custom control group, it should work with a widget too. Calculate the rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the appropriate string. You can also add a mouseMove handler to do the same thing if you want to change tooltips as the mouseLoc changes inside the widget.
>>
>> If the updated tooltip doesn't display reliably, set the tooltip to empty, wait a millisecond or so, and then set it to the new string.
>>
>> --
>> Jacqueline Landman Gay         |     [hidden email]
>> HyperActive Software           |     http://www.hyperactivesw.com
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Segmented Control Widget

ELS Prothero via use-livecode
In reply to this post by ELS Prothero via use-livecode


> On 5 Nov 2020, at 20:10, J. Landman Gay via use-livecode <[hidden email]> wrote:
>
> I've done this with a custom control group, it should work with a widget too. Calculate the rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the appropriate string. You can also add a mouseMove handler to do the same thing if you want to change tooltips as the mouseLoc changes inside the widget.


I placed the segmented control widget in a group and put a simple

on mouseEnter
beep
end mouseEnter

in the script of the group.

This did not implement a beep sound.
I placed the same script in the segmented control and that did not make a beep either.


I read the dictionary for mouseEnter and it does not apply to a group, I assume it also does not apply to the segmented control widget.


I then created three standard buttons and placed those in a group.
Placed the above script in the group.
and each time the mouse entered a button it beeped. It did not beep upon entering the group.

Is all this the correct behaviour?

If it is then it is not possible to create your own tooltip for a segmented control widget unless there is some more fiddling that can be done.

It seems creating your own segmented control may be the only solution.

Any ideas

Thanks

Terry



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Segmented Control Widget

ELS Prothero via use-livecode
I believe so. In my custom tabbed object group, I had to put transparent buttons over the tabs, then have a way to size and rearrange the buttons to match the size of the tabs, just so I could get it to respond to mouse messages and drag/drop operations. It's so ugly it's cute. Like a shar-pei.

Bob S


> On Nov 7, 2020, at 24:39 , Terence Heaford via use-livecode <[hidden email]> wrote:
>
>
>
>> On 5 Nov 2020, at 20:10, J. Landman Gay via use-livecode <[hidden email]> wrote:
>>
>> I've done this with a custom control group, it should work with a widget too. Calculate the rectangles (or at least the left and right edges) of each segment and in a mouseEnter handler compare the mouseLoc to the rectangles to see which one it's in. Then set the tooltip to the appropriate string. You can also add a mouseMove handler to do the same thing if you want to change tooltips as the mouseLoc changes inside the widget.
>
>
> I placed the segmented control widget in a group and put a simple
>
> on mouseEnter
> beep
> end mouseEnter
>
> in the script of the group.
>
> This did not implement a beep sound.
> I placed the same script in the segmented control and that did not make a beep either.
>
>
> I read the dictionary for mouseEnter and it does not apply to a group, I assume it also does not apply to the segmented control widget.
>
>
> I then created three standard buttons and placed those in a group.
> Placed the above script in the group.
> and each time the mouse entered a button it beeped. It did not beep upon entering the group.
>
> Is all this the correct behaviour?
>
> If it is then it is not possible to create your own tooltip for a segmented control widget unless there is some more fiddling that can be done.
>
> It seems creating your own segmented control may be the only solution.
>
> Any ideas
>
> Thanks
>
> Terry
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Segmented Control Widget

ELS Prothero via use-livecode
I will give this a try.

It’s a shame that widgets always seem to be incomplete in one way or another.

Thanks for your help.

All the best

Terry



> On 9 Nov 2020, at 16:52, Bob Sneidar via use-livecode <[hidden email]> wrote:
>
> In my custom tabbed object group, I had to put transparent buttons over the tabs

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode