Tool tips
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Tool tips
Er, you know about the built-in functions globalLoc and localLoc don't you Richmond?
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
No, I don't.
Frankly I wonder why globalLoc would occur to me.
If you look up location in the dictionary globalLoc is not mentioned.
And that is my main criticism of LiveCode:
To a very large extent it is difficult to know what to look for in the Documentation unless you already know it.
Frankly I wonder why globalLoc would occur to me.
If you look up location in the dictionary globalLoc is not mentioned.
And that is my main criticism of LiveCode:
To a very large extent it is difficult to know what to look for in the Documentation unless you already know it.
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Tool tips
A couple of things. The custom property I mentioned that stores the tooltip is instead of the built-in one; if you use both then you have deal with LC popping up its own. The LC tooltip should be empty, you will handle the display in script. No need to mess around with the stack visibility, which is distracting.
The location of the field should probably remain on the card. I would get the mouseloc, subtract the height of the tooltip field plus a little more from item 2 of it, and set the field there. If you're feeling adventurous, calculate whether that adjustment will run off the top of the card and if so, add the amount to item 2 of the mouseloc instead so it appears below the object.
The location of the field should probably remain on the card. I would get the mouseloc, subtract the height of the tooltip field plus a little more from item 2 of it, and set the field there. If you're feeling adventurous, calculate whether that adjustment will run off the top of the card and if so, add the amount to item 2 of the mouseloc instead so it appears below the object.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
To pick a few holes in globalLoc for this sort of exercise
where I want the topLeft of my palette to be set to the bottomRight of the object,
using globalLoc would still involve as many calculations as in my effort,
as to find the bottomLeft of the object would involve
adding half of the width of the object and half of the height to the object's globalLoc.
While I would not deny that globalLoc may be useful elsewhere, in this context it is
neither worse or better than my method.
HOWEVER . . . it would be very useful if, in the Documentation, on looking up location
it cross-referenced globalLoc.
where I want the topLeft of my palette to be set to the bottomRight of the object,
using globalLoc would still involve as many calculations as in my effort,
as to find the bottomLeft of the object would involve
adding half of the width of the object and half of the height to the object's globalLoc.
While I would not deny that globalLoc may be useful elsewhere, in this context it is
neither worse or better than my method.
HOWEVER . . . it would be very useful if, in the Documentation, on looking up location
it cross-referenced globalLoc.
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
The other thing about my method is that one has to have 'that' mouseEnter . . . mouseLeave code
in the script of every object, which is extremely clunky seeing it is always the same.
I wonder if this sort of thing can not be be universally applied . . .
Err . . . pseudoCode in the stackScript:
on objectEnter
do what-have-ye
end objectEnter
on objectLeave
do sumpin else
end objectLeave
in the script of every object, which is extremely clunky seeing it is always the same.
I wonder if this sort of thing can not be be universally applied . . .
Err . . . pseudoCode in the stackScript:
on objectEnter
do what-have-ye
end objectEnter
on objectLeave
do sumpin else
end objectLeave
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
Why?The location of the field should probably remain on the card.
By having the field in a floating palette it guarantees the original tooltips don't show,
and that the field is not cut off by the left, right or bottom of the stack without the need
to perform extra calculations to accommodate a field inwith the bounds of a stack.
I do agree, however, that the field (and by necessity) the palettised stack, should resize according to the size of the tooltip.
Re: Tool tips
We can supress the display of tooltips in LC at all by simply setting the global property tooltipdelay to 0
Code: Select all
on openstack
set the tooltipdelay to 0
end openstack
-
- VIP Livecode Opensource Backer
- Posts: 7230
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Tool tips
Oh right, I forgot about tooltip suppression. Thanks.
Richmond, the reason to keep the field on the card is to allow it to work on mobile devices, and possibly on standalones - - I can't recall offhand if standalones will draw outside the stack rect.
Richmond, the reason to keep the field on the card is to allow it to work on mobile devices, and possibly on standalones - - I can't recall offhand if standalones will draw outside the stack rect.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
Code: Select all
on mouseEnter
if the toolTip of me is empty then
-- do nix
else
set the text of fld "tipper" of stack "TopTips" to the toolTip of me
put the bottomRight of me into BR
put item 1 of the loc of this stack into SLR
put item 2 of the loc of this stack into SUD
put (the width of this stack)/2 into SL
put (the height of this stack)/2 into SH
put (SLR - SL) into LEDGE
put (SUD - SH) into TEDGE
put (LEDGE + (the right of me)) into RSIDE
put (TEDGE + (the bottom of me)) into OBBUM
---
put the formattedWidth of fld "tipper" of stack "TopTips" into NWIDD
put the formattedHeight of fld "tipper" of stack "TopTips" into NHITE
set the width of fld "tipper" of stack "TopTips" to NWIDD
set the height of fld "tipper" of stack "TopTips" to NHITE
set the width of stack "TopTips" to (NWIDD + 4)
set the height of stack "TopTips" to (NHITE + 4)
set the top of fld "tipper" of stack "TopTips" to 2
set the left of fld "tipper" of stack "TopTips" to 2
---
set the topLeft of stack "TopTips" to (RSIDE, OBBUM)
set the vis of stack "TopTips" to true
end if
end mouseEnter
on mouseLeave
set the vis of stack "TopTips" to false
end mouseLeave
- Attachments
-
- Clootie 6.livecode.zip
- Going off the deep end.
- (45.24 KiB) Downloaded 192 times
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
- -I can't recall offhand if standalones will draw outside the stack rect.
Standalones do draw outside the stack rect (on Macintosh, at least).
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
Can a mobile standalone not have substacks?the reason to keep the field on the card is to allow it to work on mobile devices
Re: Tool tips
Code: Select all
on mouseEnter
if the toolTip of me is empty then
-- do nix
else
...
I, personally try to avoid any nested IF THEN ELSE if possible:
Code: Select all
on mouseEnter
if the toolTip of me <> empty then
set the text of fld "tipper" of stack "TopTips" to the toolTip of me
put the bottomRight of me into BR
...
end if
end mouseenter
Code: Select all
on mouseEnter
if the toolTip of me = empty then
exit to top
end if
set the text of fld "tipper" of stack "TopTips" to the toolTip of me
put the bottomRight of me into BR
...
end mouseenter
Re: Tool tips
It can, but we only can have ONE stack open at a time on mobile!richmond62 wrote: ↑Sun May 31, 2020 6:21 pmCan a mobile standalone not have substacks?the reason to keep the field on the card is to allow it to work on mobile devices
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
Klaus . . . I know that what I have done contains "shaggy code" . . .
but, frankly, I don't care that much as, having got the thing working I can tidy up the code subsequently.
but, frankly, I don't care that much as, having got the thing working I can tidy up the code subsequently.
-
- Livecode Opensource Backer
- Posts: 9383
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Tool tips
Fegs.Klaus wrote: ↑Sun May 31, 2020 6:24 pmIt can, but we only can have ONE stack open at a time on mobile!richmond62 wrote: ↑Sun May 31, 2020 6:21 pmCan a mobile standalone not have substacks?the reason to keep the field on the card is to allow it to work on mobile devices