Tool tips
Tool tips
Roger,
We use datatooltips quite a bit. I need to do something similar on a standard get or dcsay...does not matter which.
We have some special instructions that users want to see, which can be up to 100 characters. Due to space on the screen for this window, the viewable area is limited to 20 or so characters. I have tried to use tooltip and gettooltip, but both give me error messages if I use {||var }..just says invalid. If I user the var, it will work but its not refreshed.
Any suggestions are appreciated.
thanks
Fred Henck
Omni
We use datatooltips quite a bit. I need to do something similar on a standard get or dcsay...does not matter which.
We have some special instructions that users want to see, which can be up to 100 characters. Due to space on the screen for this window, the viewable area is limited to 20 or so characters. I have tried to use tooltip and gettooltip, but both give me error messages if I use {||var }..just says invalid. If I user the var, it will work but its not refreshed.
Any suggestions are appreciated.
thanks
Fred Henck
Omni
Re: Tool tips
Hi, Fred.
The errors you get may have something to do with the fact that the tooltip system runs in a different thread. You don't have access to your workareas there! It's quite hard to display tool tips depending on data in a workarea. Your gets need to set values in get/set-functions or even public vars (for example using "GOTFOCUS"). But this is not very reliable.
The errors you get may have something to do with the fact that the tooltip system runs in a different thread. You don't have access to your workareas there! It's quite hard to display tool tips depending on data in a workarea. Your gets need to set values in get/set-functions or even public vars (for example using "GOTFOCUS"). But this is not very reliable.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Tool tips
Tom is right about tooltips running in another thread, however you should have no problem with local variables provided that you pass by reference.
RETURN nil
Code: Select all
LOCAL cVar := 'My tooltip'
@ .. DCGET .. TOOLTIP {||@cVar}
@ .. DCPUSHBUTTON .. ACTION {||UpdateToolTip(@cVar)}
DCREAD GUI
* ----------
STATIC FUNCTION UpdateTooltip( cVar )
cVar := 'My Updated tooltip'
The eXpress train is coming - and it has more cars.
Re: Tool tips
I have a problem with TIPBLOCK when browsing arrays: nPointer points to the row which is ITEMMARKED, Dc_BrowseRow(oBrowse) points as well to marked row and not to the row under mouse pointer. My question is how to retrive the number of array row which is currently under mouse pointer. This would enable me to read data from browsed array.
Best regards
Janko
Best regards
Janko
Re: Tool tips
I'm not sure I understand your question.
Are you wanting to display a tooltip based on the current mouse position over an array-based browse?
You would do that like so:
Are you wanting to display a tooltip based on the current mouse position over an array-based browse?
You would do that like so:
Code: Select all
aDir := Directory()
@ .. DCBROWSE .. DATA aDir
DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 10 ;
DATATOOLTIP {|| .T. } TIPBLOCK {|nPos| aDir[nPos,1]}
The eXpress train is coming - and it has more cars.
Re: Tool tips
Yes, you understood correctly. Your solution works as I wanted. And, as usuall, I should read manual more careful. Thank you very much
Re: Tool tips
It will not compile with a tooltip with @. Says invalid use of @ (pass by reference). Will not work otherwise..says unknown var.
Fred
Omni
Fred
Omni
Re: Tool tips
Ok, here it is
shipins='TOOLTIP TEST'
@ 14,01 DCsay "Instructions:" get CSHIPINS PICTURE "!!!!!!!!!!!!!!!!!!!!" GETTOOLTIP {||@SHIPINS }
I have tried just the dcsay..get and the dcget. Same results
The actual cshipins is 80 characters, so the shipins is the entire instruction, or that is what the user wants to display in the tooltip.
There are other ways to do it, with the picture clause, or a popup..which is what we will do if I cannot get the tooltip to work
Fred
shipins='TOOLTIP TEST'
@ 14,01 DCsay "Instructions:" get CSHIPINS PICTURE "!!!!!!!!!!!!!!!!!!!!" GETTOOLTIP {||@SHIPINS }
I have tried just the dcsay..get and the dcget. Same results
The actual cshipins is 80 characters, so the shipins is the entire instruction, or that is what the user wants to display in the tooltip.
There are other ways to do it, with the picture clause, or a popup..which is what we will do if I cannot get the tooltip to work
Fred
Re: Tool tips
Hi,
The following are working variations:
[/code]
The following are working variations:
Code: Select all
shipins='TOOLTIP TEST'
@ 14,01 DCsay "Instructions:" get CSHIPINS PICTURE "!!!!!!!!!!!!!!!!!!!!" GETTOOLTIP SHIPINS
Or
@ 14,01 DCsay "Instructions:" get CSHIPINS PICTURE "!!!!!!!!!!!!!!!!!!!!" GETTOOLTIP 'TOOLTIP TEST'
Or
@ 14,01 DCsay "Instructions:" get CSHIPINS PICTURE "!!!!!!!!!!!!!!!!!!!!" GETTOOLTIP fTooltip(1)
...
function fTooltip(nNumber)
if nNumber == 1
return 'TOOLTIP TEST 1'
elseif nNumber == 2
return 'TOOLTIP TEST 2'
....