Xbrowse : Tooltips timers

Xbrowse : Tooltips timers

Postby Marc Venken » Mon Jun 12, 2023 8: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: Select all  Expand view

   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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : Tooltips timers

Postby nageswaragunupudi » 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: Select all  Expand view
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: Select all  Expand view
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: Select all  Expand view
{ uToolTip, cTitle, choIcon, clrFore, clrBack, nWidth, nDelayTime}
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse : Tooltips timers

Postby Marc Venken » Mon Jun 12, 2023 1: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1434
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse : Tooltips timers

Postby nageswaragunupudi » Mon Jun 12, 2023 2: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
User avatar
nageswaragunupudi
 
Posts: 10641
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 66 guests