FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse Tooltip
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
xBrowse Tooltip
Posted: Mon Nov 17, 2008 04:48 PM

All,

Is there any way to show a tooltip when the mouse is over a particular cell?

Thanks,
Randal

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
xBrowse Tooltip
Posted: Sun Nov 23, 2008 11:39 PM

Randal,

With xbrowse, you can set a tooltip for each column, but it will be shown when the mouse is over the column header.

Are you looking to show a tooltip when the mouse is over a cell ?
oBrw:ShowToolTip( nRow, nCol, cToolTipText) could be used

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
xBrowse Tooltip
Posted: Mon Nov 24, 2008 07:33 PM
Antonio,

Yes, I want to show a tooltip when the mouse is over a cell. How do I get the values for nRow, nCol?

Thanks,
Randal


Antonio Linares wrote:Randal,

With xbrowse, you can set a tooltip for each column, but it will be shown when the mouse is over the column header.

Are you looking to show a tooltip when the mouse is over a cell ?
oBrw:ShowToolTip( nRow, nCol, cToolTipText) could be used
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
xBrowse Tooltip
Posted: Mon Nov 24, 2008 11:40 PM
this change for fw 8.10 i dont know it work for other version

new DATA into CLASS TXBrwColumn

DATA bToolTip // codeblock to be evaluated for each columns after header

add new local variable and change this lines in METHOD MouseMove( nRow, nCol, nKeyFlags ) CLASS TXBrowse

local cTxt

   nFor     := If( nRow < ::HeaderHeight(), ::MouseColPos( nCol ), 0 )
   if nFor > 0 .and. nFor <= nLen
      oCol  := ::ColAtPos( nFor )
      CursorArrow()

      if Empty( oCol:cToolTip )
         ::DestroyToolTip()
      else
         if ::oColToolTip == nil .or. ::oColToolTip:nCreationOrder != oCol:nCreationOrder
            ::DestroyToolTip()
            ::ShowToolTip( ,, oCol:cToolTip )
            ::oColToolTip := oCol
         endif
      endif
      return 0

   else
      if ::oColToolTip != nil
         ::DestroyToolTip()
      endif
      ::CheckToolTip()
   endif


FOR THIS LINES

   nFor     := If( nRow < ::HeaderHeight(), ::MouseColPos( nCol ), 0 )
   if nFor > 0 .and. nFor <= nLen
      oCol  := ::ColAtPos( nFor )
      CursorArrow()
      if Empty( oCol:cToolTip )
         ::DestroyToolTip()
      else
         if ::oColToolTip == nil .or. ::oColToolTip:nCreationOrder != oCol:nCreationOrder
            ::DestroyToolTip()
            ::ShowToolTip( nRow,nCol, oCol:cToolTip )
            ::oColToolTip := oCol
         endif
      endif
      return 0

   elseif ( nFor := If( nRow > ::HeaderHeight(), ::MouseColPos( nCol ), 0 ) ) > 0
	 	if nFor > 0 .and. nFor <= nLen
      	oCol  := ::ColAtPos( ::MouseColPos( nCol ) )
      	CursorArrow()
      	if  ::MouseColPos( nCol ) > 0
	   				if Empty( oCol:bToolTip )
	   					::DestroyToolTip()
	   				else
         			if ::oColToolTip == nil .or. ::oColToolTip:nCreationOrder != oCol:nCreationOrder
		     				cTxt := eval( oCol:bToolTip, Self )
			   				if !empty( cTxt )
				   				::DestroyToolTip()
				   				::ShowToolTip( nRow,nCol, cTxt )
				   				::oColToolTip := oCol
			   				endif
			   			endif
			   		endif
			   endif
			   return 0
	   	endif
	   else
      if ::oColToolTip != nil
         ::DestroyToolTip()
      endif
      ::CheckToolTip()
   endif


i think it all

example...

oBrw:aCols[ 1 ]:bToolTip := {|oBr| if( oBr:aRow[ 1 ]==1,"This a Test",) }

parameter in for codeblock is Browse Objet (self)

Continue the discussion