Page 1 of 1

xbrowse and tooltip

PostPosted: Wed Nov 22, 2023 3:39 pm
by damianodec
hi,
In my xbrowse I have a tooltip
Code: Select all  Expand view

WITH OBJECT oBrw:aCols[ 15 ]
    :bCellToolTip := { |oCol| "My ToolTip" }   
end
 

I would like there to be a sign in those cells or column with tooltips like excel with comment (see example below):
Image

Re: xbrowse and tooltip

PostPosted: Wed Nov 22, 2023 4:03 pm
by karinha

Re: xbrowse and tooltip

PostPosted: Wed Nov 22, 2023 4:08 pm
by karinha
// C:\FWH\SAMPLES\TOOLTCOL.PRG

Code: Select all  Expand view

#include "FiveWin.ch"

function TestTip()

   LOCAL oDlg, oFont, oBrw
   LOCAL nMilliSeconds := 32767


   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 600,500 PIXEL

   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" AUTOCOLS ;
      CELL LINES NOBORDER

   /*
   oBrw:bToolTips   := ;
         { | oBrw,r,c,f,oMouseCol,nMouseRow| MyColToolTip( oBrw,r,c,f,oMouseCol,nMouseRow ) }
   */


   oBrw:bCellToolTips := { |o| o:Value } // yes

   // oBrw:bCellToolTips := { |o| { o:Value, nil, nil, nil, nil, nil, nMilliSeconds } }  // yes

   // { uToolTip, cTitle, choIcon, clrFore, clrBack, nWidth, nDelayTime}

   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED

return nil

//----------------------------------------------------------
Function MyColToolTip( oBrw, r, c, f, oMouseCol, nMouseRow )

   local uBm, uVal

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

return cValToChar( uVal )
 


Regards, saludos.

Re: xbrowse and tooltip

PostPosted: Fri Nov 24, 2023 7:51 am
by damianodec
hi karinha
what I would like is the dot red in the cell with tooltip.
My xbowse has 35 column and tooltip could be in 1 or 3 or 10 or 15 column (it's a random)
when the users open xbrowse he doesn't know where the tooltip is.
the excel example (dot red into the of C column) could be a solution.

thanks

Re: xbrowse and tooltip

PostPosted: Fri Nov 24, 2023 8:22 am
by Marc Venken
The Red dot would be a extra element into the cell.... Mr. Rao will know the possibilities.

But this is also a option.

1 Coloring the cell like in this post : viewtopic.php?f=3&t=40217&hilit=cellborder

I didn't look the tread, but I would look into it. Maybe the colored box can be changed in layout like you would.

2 If the browse is not to big, create 1 png with the data of the cell and combine a transparent png with the red dot in upper right. Use this pics to browse, but it will slow down stuff (just a idea)

With option 1 your customer will see cellborders changed when tooltip data is there.

Just a idea )))

Re: xbrowse and tooltip

PostPosted: Sat Nov 25, 2023 7:17 pm
by Natter
You can combine text and an image in a cell.
Code: Select all  Expand view
:aCols[1]:bStrData:={||}
 :aCols[1]:nDataBmpAlign:=AL_RIGHT
 :aCols[1]:bBmpData{||}