Tooltip
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Tooltip
Hi, i'm trying to put a label field on top of an android native field to create this sort of tooltip effect
Any ideas on how make it work? Thanks!
but on mobile the field that i put on top (the "tooltip") is not shown or can't be seen amd only the "editable" field is shown.Any ideas on how make it work? Thanks!
Samuele.
-
- Livecode Opensource Backer
- Posts: 9477
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tooltip
Cannot an android native field have a tooltip
of its own?
- -
Never looked at android native fields before:
Samuele; you need to drink more coffee.
-
of its own?
- -
Never looked at android native fields before:
Samuele; you need to drink more coffee.
-
Re: Tooltip
I think i drink too much of it
No but as usual you shouldn't take my words precisely, i forgot to write that i didn't mean tooltip literally, because i want it for mobile and on mobile there ain't no tooltips, so I'm trying to create a similar thing to a tooltip but for mobile as i showed in the attachment.
Samuele.
-
- Livecode Opensource Backer
- Posts: 9477
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tooltip
Then why are TOOLTIPS offered in the Android native field?on mobile there ain't no tooltips
Re: Tooltip
Yes, no tooltips on the mobile platform -> no cursor = no tooltip
And since all "native" controls, like the Android native field, are shown as an OVERLAY
in your runtime, means they float above everything and therefore we cannot even fake a
tooltip with an ordinary LC field object. This will always disappear behind the native control.
Sorry for the bad news...
And since all "native" controls, like the Android native field, are shown as an OVERLAY
in your runtime, means they float above everything and therefore we cannot even fake a
tooltip with an ordinary LC field object. This will always disappear behind the native control.
Sorry for the bad news...
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
-
- VIP Livecode Opensource Backer
- Posts: 270
- Joined: Sat Aug 16, 2008 9:48 am
- Location: Stockholm, Sweden
- Contact:
Re: Tooltip
Maybe this could work:
In the card script:
Then in the widget's script:
This is untested, but you can experiment with this general idea...
In the card script:
Code: Select all
command setMyTooltip pID,pText
set the text of pID to pText
if pText is empty then set the fieldTextColor of pID to black ## The user can type something
else set the fieldTextColor of pID to grey ## Or the RGB code of the colour you prefer for the tooltip
end setMyTooltip
Code: Select all
on openField
setMyTooltip the long id of me,empty ## This clears the tooltip text and sets normal text colour
end openField
on exitField
setMyTooltip the long id of me,"Scrivi un messagio" ## This restores the tooltip if the user didn't enter anything
end exitField
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Re: Tooltip
hi @Samuel, maybe what you are looking for is a "placeholder". If this is what you need you might want to check out the lesson https://lessons.livecode.com/m/4071/l/6 ... -behaviors
-
- Livecode Opensource Backer
- Posts: 9477
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tooltip
So, MAYBE a trick worth trying is to have a 'tooltip' in a second Android native field.the Android native field, are shown as an OVERLAY
in your runtime, means they float above everything
-
- VIP Livecode Opensource Backer
- Posts: 7266
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Tooltip
Long-pressing a button is the standard interface for showing a tooltip, so that's a good idea. But as Klaus said, LC's implementation doesn't allow other controls to be layered over the native one, so you need to work around that limitation.
You could place the explanatory field outside the bounds of the native field where it would show. Alternately, use the toast widget to show a brief description. An advantage to using the toast is that it automatically dismisses itself, so using it is a one-line call.
Finally, I believe native controls can be layered amongst themselves, so you could create a native input field to display the text which would allow you to place it anywhere.
You could place the explanatory field outside the bounds of the native field where it would show. Alternately, use the toast widget to show a brief description. An advantage to using the toast is that it automatically dismisses itself, so using it is a one-line call.
Finally, I believe native controls can be layered amongst themselves, so you could create a native input field to display the text which would allow you to place it anywhere.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Tooltip
alright, i tried to put this script on an android native button
but it doesn't work (obviously i tried on mobile) does the android native button have different handlers for mouseDown or for hide?
Code: Select all
on mouseDown
hide me
end mouseDown
Samuele.
-
- VIP Livecode Opensource Backer
- Posts: 7266
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Tooltip
Good question, there is no documentation about which commands the native button will respond to. I've never used that widget, but I have to assume it would honor mouseDown and mouseUp, so I'm surprised it didn't work for you. However, my suggestion won't work with widgets, if you want to layer native controls you have to script them with mobileControlCreate.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com