Detect Tooltip use

Mike Matthews - Omnis omnis at lineal.co.uk
Wed Jan 29 17:15:15 UTC 2025


Ah, so this is the bit that I needed:

[tStringFIelds.$getTooltip(mouseover(kmitemref))]

Now I know where I am.

Sadly, you are right again.  I wanted to go from there to a guide, and was wondering how to do that really.  Now the $helpfile might help.  I did sort of remember that $property as well.

More later :)

Mike Matthews

Lineal Software Solutions
Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>

omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>

www.lineal.co.uk<http://www.lineal.co.uk/>

www.sqlworks.co.uk<http://www.sqlworks.co/>



On 29 Jan 2025, at 17:07, Doug Easterbrook <doug at artsman.com<mailto:doug at artsman.com>> wrote:

hi Mike. We use a common method about 99% of our fields in the $tooltip property.  Looks like this: [tStringFIelds.$getTooltip(mouseover(kmitemref))] basically: calls the object tStringFields.$getTooltip with the reference of the field that you are over.
Warning: Unusual link
This message contains an unusual link, which may lead to a malicious site. Confirm the message is safe before clicking any links.
hi Mike.

We use a common method about 99% of our fields in the $tooltip property.  Looks like this:

[tStringFIelds.$getTooltip(mouseover(kmitemref))]

basically:

  *   calls the object tStringFields.$getTooltip with the reference of the field that you are over.
  *   ALL the fields are given names that correspond to our field names (like C_LAST_NAME) which we have built a data dictionary for
  *   and it means if the same field is on many windows, the tooltip that is displayed is exactly the same on all windows… we just need to change our data dictionary.

what if you don’t have a data dictionary?   you could put the fields in a string table, or go and retrieve the $desc for the field from a File or schema class.



code for '$getToolTip

# called like this to show tool tips on fields using our data dictionary
# put this in the tootip method: [$cinst.$getTooltip(mouseover(kMItemref))]
# that gives us a reference to the field and we can do something with it
#
# Breakpoint {[pFieldRef.$name]}
# get the name of the field from notation

Calculate fieldName as pFieldRef.$name

# all of our field names have a prefix and they are always 1 to 4 characters ## V91600 SM We now have some field names with 4 char prefixes
If pos('_',fieldName)>0&pos('_',fieldName)<=5|mid(fieldName,1,1)='g'
Quit method $cinst.$getTooltipFromName(fieldName)
End If


code for $getTooltipFromName

Calculate Column as tDataDictionary.$getColumn(pFieldName)
Quit method Column.ddColumnDesc



the ’tDataDictionary’ reference is simple the mechanism to do a binary search on the 'fieldName'  (like C_LAST_NAME) to get the description of the field and RETURN the description as the tooltip text.



NOTE:  we have set it up so that tooltip text can include style() command to colour the text, add icons, add CR’s and what have you.    We also limit the tooltip width to 400 pixels in the preferences


With this approach, you can have really quite long tooltips …   (I’ll send an image privately).


WHAT YOU CANNOT DO!!!!

There is no way to allow the user to click on the tooltip and have that initiate a secondary level of help like opening a web page.     Tooltips DO NOT support any action after they have been displayed.



One the other hand….

There is a property of every field called '$helpfile'.  I beleive you can put a file name in there to look for the name of a file using omnis’s built in help system.

I have not used this field to fo to a help file for the field specifically … but we have set $cinst.$helpfile for an entire window — and that lets up open an external URL to describe how the window functions.

you might be able to use that to pop up and help file in an obrowser instance.


perhaps with two bit of info
- $tooltip
- $helpfile - to create context help….

https://www.omnis.net/developers/resources/onlinedocs/index.jsp#



Doug Easterbrook
mailto:doug at artsman.com
Phone (403) 650-1978

On Jan 29, 2025, at 7:53 AM, Mike Matthews - Omnis via omnisdev-en <omnisdev-en at lists.omnis-dev.com<mailto:omnisdev-en at lists.omnis-dev.com>> wrote:

Hello All,

Can you detect when the tooltip is shown and then do something as a result?  I’m still looking at options for a good way to access a user guide for the relevant part.

This part of the guide would just be for ‘what is this field?’, rather than ‘how do I do a function?’ Or ‘What is this screen for?’ kind of question.

Those questions come later, as writing and integrating a user manual/guide/tech ref is really hard.  Maybe a good topic for www.euromnis.com<http://www.euromnis.com><http://www.euromnis.com> 5th Oct 2025 possibly?  Who would like to know more?

Thanks

Mike Matthews

Lineal Software Solutions
Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>

omnis at lineal.co.uk<mailto:omnis at lineal.co.uk><mailto:mike.matthews at lineal.co.uk>

www.lineal.co.uk<http://www.lineal.co.uk><http://www.lineal.co.uk/>

www.sqlworks.co.uk<http://www.sqlworks.co.uk><http://www.sqlworks.co/>



_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com




More information about the omnisdev-en mailing list