Tool tips

This forum is for eXpress++ general support.
Message
Author
omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Tool tips

#1 Post by omni »

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

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Tool tips

#2 Post by Tom »

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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Tool tips

#3 Post by rdonnay »

Tom is right about tooltips running in another thread, however you should have no problem with local variables provided that you pass by reference.

Code: Select all

LOCAL cVar := 'My tooltip'

@ .. DCGET .. TOOLTIP {||@cVar}
@ .. DCPUSHBUTTON .. ACTION {||UpdateToolTip(@cVar)}

DCREAD GUI

* ----------

STATIC FUNCTION UpdateTooltip( cVar )

cVar := 'My Updated tooltip'
RETURN nil
The eXpress train is coming - and it has more cars.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Tool tips

#4 Post by Janko »

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

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Tool tips

#5 Post by rdonnay »

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:

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.

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: Tool tips

#6 Post by Janko »

Yes, you understood correctly. Your solution works as I wanted. And, as usuall, I should read manual more careful. Thank you very much

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Tool tips

#7 Post by omni »

It will not compile with a tooltip with @. Says invalid use of @ (pass by reference). Will not work otherwise..says unknown var.

Fred
Omni

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Tool tips

#8 Post by rdonnay »

Show me your code.
The eXpress train is coming - and it has more cars.

omni
Posts: 531
Joined: Thu Jan 28, 2010 9:34 am

Re: Tool tips

#9 Post by omni »

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

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Tool tips

#10 Post by skiman »

Hi,

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'
....
[/code]
Best regards,

Chris.
www.aboservice.be

Post Reply