FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse : Tooltips timers
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Xbrowse : Tooltips timers
Posted: Mon Jun 12, 2023 08:55 AM
I was looking into xbrowse for showing the tooltip as long as i'm on a cell, so the tooltip should stay, or If I could set a timer then I set it a long time.
I'm using it to show information that needs to be longer on screen.
In xbrowse code I don't see a timer code for it ?

This I use now :
Code (fw): Select all Collapse
   oBrw:bToolTips   := ;
         { | oBrw,r,c,f,oMouseCol,nMouseRow| MyColToolTip( oBrw,r,c,f,oMouseCol,nMouseRow ) }

function MyColToolTip( oBrwS, r, c, f, oMouseCol, nMouseRow )
   local uBm, uVal

   if nMouseRow != oBrwS:nRowSel
      uBm   := oBrwS:BookMark
      Eval( oBrwS:bSkip, nMouseRow - oBrwS:nRowSel )
      uVal  := oMouseCol:Value
      oBrwS:BookMark := uBm
   else
      uVal  := oMouseCol:Value
   endif

return uVal
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse : Tooltips timers
Posted: Mon Jun 12, 2023 12:37 PM
This long code is not at all required with XBrowse.
Instead, please use this simple one line code:
Code (fw): Select all Collapse
oBrw:bCellToolTips := { |o| o:Value }
Use oCol:bCellToolTip instead of oCol:bToolTip. This does what your lengthy code does automatically.

If you want to set the time,
Code (fw): Select all Collapse
oBrw:bCellToolTips := { |o| { o:Value, nil, nil, nil, nil, nil, nMilliSeconds } }
Anywhere in the application a Tooltip can be a single value or an array.
If array
Code (fw): Select all Collapse
{ uToolTip, cTitle, choIcon, clrFore, clrBack, nWidth, nDelayTime}
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Xbrowse : Tooltips timers
Posted: Mon Jun 12, 2023 01:33 PM

This is for afther FW 21.06.. ?

Will upgrade for some of the new stuff )))

I'm using a function because I need the value of the cell to be formatted in some kind.

cell = Black,White,Green,Blue,Orange

Tooltip needs to show

  1. Black

  2. White

  3. Green

  4. Blue

...

Time will be there afther upgrade.

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse : Tooltips timers
Posted: Mon Jun 12, 2023 02:51 PM
bCellToolTip was introduced from FWH1701 ( January 2017 )
From whatsnew.txt
* XBROWSE:
- New: XBrColumn new DATA bCellToolTip: CodeBlock to return
tooltip text.
To show tooltip when mouse hovers over a cell. This supercedes
oCol:bTooTip, which is depricated.
Using bToolTip requires the programmer to write a separate
function to naviato the mouse over row, pick the text and re-
navicate to the current row, which is confusing and error-prone.
In case of bCellToolTip, xbrowse first navigates to the mouse
over row and then evaluates the codeblock with mouse over column
object as parameter and returns to the current row. This
simplifies the programmer's job.

It is suggested to use bCellToolTip in future development instead
of bToolTip.
So, this is available in your version.
Even the array format of tooltip also is available in your version 2102.

No need to upgrade for implementing my suggestions.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion