xBrowse Tooltip

xBrowse Tooltip

Postby Randal » Mon Nov 17, 2008 4:48 pm

All,

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

Thanks,
Randal
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Randal » Mon Nov 24, 2008 7: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
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Postby Daniel Garcia-Gil » 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

Code: Select all  Expand view  RUN
   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

Code: Select all  Expand view  RUN
   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)
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 41 guests