help for xbrowse tooltip

help for xbrowse tooltip

Postby Silvio.Falconi » Sat Feb 21, 2015 3:13 pm

please Look this Image :

Image

I use and array aDataDay[ndocente][nOra]
I need to Know ( for the data of return ) some data as when I move the mouse over:

the row and the col to have the day and the hour on the case of picture 14 ( 1 monday 4 number of Hour)
the number of teacher ( nrecord) in this picture 8
and the value of cell in this picture 4B

How I can found ths data ? thanks

then with hese data I can search on archive the matter of lesson and I can show it with a tooltip
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: help for xbrowse tooltip

Postby nageswaragunupudi » Sat Feb 21, 2015 11:25 pm

Code: Select all  Expand view

oCol:bToolTip := { | brw,r,c,f,oMouseCol,nMouseRow| MyColToolTip( brw,r,c,f,oMouseCol,nMouseRow ) }

...
...

function MyColToolTip( oBrw, r, c, f, oMouseCol, nMouseRow )

   local uVal, nRow, nCol
   
   nRow  := oBrw:nArrayAt + nMouseRow - oBrw:nRowSel
   nCol  := oMouseCol:nCreationOrder
   uVal  := oBrw:nArrayData[ nRow, nCol ]
   
return cValToChar( uVal )
 
Regards

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

Re: help for xbrowse tooltip

Postby joseluisysturiz » Sun Feb 22, 2015 6:43 pm

Hi, I need something similar but to do so in all cells and is to browse my oQry or this is just to browse with array, try as in the example but it gives me error "UVAL: = oBrw: nArrayData [nRow, nCol] "/ Message not found: TXBrowse: NARRAYDATA, thanks, greetings ... using google translator... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: help for xbrowse tooltip

Postby FranciscoA » Sun Feb 22, 2015 7:55 pm

+1
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: help for xbrowse tooltip

Postby nageswaragunupudi » Sun Feb 22, 2015 11:36 pm

joseluisysturiz wrote:Hi, I need something similar but to do so in all cells and is to browse my oQry or this is just to browse with array, try as in the example but it gives me error "UVAL: = oBrw: nArrayData [nRow, nCol] "/ Message not found: TXBrowse: NARRAYDATA, thanks, greetings ... using google translator... :shock:


My reply was only for Array Browse.

For any other browse:
Code: Select all  Expand view
oCol:bToolTip := { | brw,r,c,f,oMouseCol,nMouseRow| MyColToolTip( brw,r,c,f,oMouseCol,nMouseRow ) }

...
...

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

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

Re: help for xbrowse tooltip

Postby Silvio.Falconi » Mon Feb 23, 2015 5:02 pm

Mr Nages,

Code: Select all  Expand view
Error occurred at: 23-02-2015, 18:00:41
   Error description: Error BASE/1004  Message not found: TXBROWSE:NARRAYDATA

Stack Calls
===========
   Called from: .\source\function\HARBOUR.PRG => _CLSSETERROR( 244 )
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:NARRAYDATA( 8313 )
   Called from: source\Ptabell.prg => MYCOLTOOLTIP( 332 )
   Called from: source\Ptabell.prg => (b)PTABELLONE( 187 )
 



I made :

for nI = 2 to 61

oApp():oGrid:aCols[ nI ]:bToolTip := { | brw,r,c,f,oMouseCol,nMouseRow| MyColToolTip( brw,r,c,f,oMouseCol,nMouseRow ) }

next


...


function MyColToolTip( oBrw, r, c, f, oMouseCol, nMouseRow )

local uVal, nRow, nCol

nRow := oBrw:nArrayAt + nMouseRow - oBrw:nRowSel
nCol := oMouseCol:nCreationOrder
uVal := oBrw:nArrayData[ nRow, nCol ]

return cValToChar( uVal )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: help for xbrowse tooltip

Postby FranciscoA » Mon Feb 23, 2015 6:27 pm

Mr Nages: (tested on dbf)

Path and name: D:\COUNTRY\NEWCONT32\Wcont32.Exe (32 bits)
Size: 2,646,016 bytes
Time from start: 0 hours 0 mins 13 secs
Error occurred at: 23/02/2015, 11:52:26
Error description: Error BASE/1082 Argument error: -
Args:
[ 1] = U
[ 2] = N 2

Stack Calls
===========
Called from: D:\COUNTR~1\NEWCON~1\wcont32.prg => MYCOLTOOLTIP(574)
Called from: D:\COUNTR~1\NEWCON~1\wcont32.prg => (b)COMPROBANTE(461)
Called from: XBROWSE.PRG => TXBROWSE:MOUSEMOVE(3403)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(1490)
Called from: XBROWSE.PRG => TXBROWSE:HANDLEEVENT(10762)
Called from: .\source\classes\WINDOW.PRG => _FWH(3391)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(976)
Called from: D:\COUNTR~1\NEWCON~1\wcont32.prg => MAIN(192)


Code: Select all  Expand view

   oCol = oBrw:AddCol()
   oCol:bStrData = { || (cAlias)->NOMBRE }
   oCol:cHeader = "DESCRIPCION DE LA CUENTA"
   oCol:nEditType = 0   //no editable
   oCol:bToolTip := { | oBrw,r,c,f,oMouseCol,nMouseRow| MyColToolTip( oBrw,r,c,f,oMouseCol,nMouseRow ) }

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

   local uBm, uVal
   
   if nMouseRow != oBrw:nRowSel
      uBm   := oBrw:BookMark
      Eval( oBrw:bSkip, nMouseRow - oBrw:nRowSel )   //here  (variable nMouseRow do not exists)
      uVal  := oMouseCol:Value
      oBrw:BookMark := uBm
   else
      uVal  := oMouseCol:Value
   endif  
   
return cValToChar( uVal )
 


Regards
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: help for xbrowse tooltip

Postby nageswaragunupudi » Mon Feb 23, 2015 7:36 pm

Silvio
Change nArrayData as aArrayData.
It was my typing mistake
Regards

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

Re: help for xbrowse tooltip

Postby nageswaragunupudi » Mon Feb 23, 2015 7:52 pm

This is working well for me here
Code: Select all  Expand view

function TestTip()

   local oDlg, oFont, oBrw

   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: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 )
 


Instead of oCol:bToolTip, I assigned the codeblock to oBrw:bToolTips. This is the shortcut to assign the same codeblock to all columns in a single statement.

I am able to see the correct tool tips for all columns and there are no errors. Please try the above example just as it is. You may use any DBF.

Some advices though not relating to this:
bStrData has been deprecated many years back.
You can enjoy all the power and all features of xbrowse only when you use the command sytnax.
You have full liberty not to use the command syntax but at the cost of not using all features and full power of xbrowse.
Regards

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

Re: help for xbrowse tooltip

Postby FranciscoA » Tue Feb 24, 2015 1:09 am

function TestTip()

local oDlg, oFont, oBrw

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: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 )

Mr. Nages.
Thanks for your time and patience, but I have not been able to make it work. Maybe it's my 1204 version .
Best regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: help for xbrowse tooltip

Postby nageswaragunupudi » Tue Feb 24, 2015 1:29 am

Thanks for your time and patience, but I have not been able to make it work. Maybe it's my 1204 version .

Yes. That is the reason
Regards

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

Re: help for xbrowse tooltip

Postby Silvio.Falconi » Tue Feb 24, 2015 3:55 pm

thanks Nages,
it show the value of cell ok
but I have another problem because if you remember I have 61 column (first column is the teachers and the I have 10 columns for day for the hours)
with your script I have the number of column ===> nCol-1 ( the first is teachers)
How I can calc the day to have a return data type for sample 16 ( monday at 6 hour)

I tried with
nday:= int( (nCol-1) / 6) but it not run ok


I need this data to search on database the matter od lesson and show it with tooltip
Any idea ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7048
Joined: Thu Oct 18, 2012 7:17 pm

Re: help for xbrowse tooltip

Postby nageswaragunupudi » Wed Feb 25, 2015 1:20 am

FranciscoA wrote:Thanks for your time and patience, but I have not been able to make it work. Maybe it's my 1204 version .
Best regards.

This may work for your version
Code: Select all  Expand view
Function MyColToolTip( oBrw, r, c, f, oMouseCol, nMouseRow )

   local uBm, uVal

   // for older versions
   nMouseRow   := oBrw:MouseRowPos( r )
   oMouseCol   := oBrw:MouseColPos( c )
   oMouseCol   := oBrw:ColAtPos( oMouseCol )
   //

   if nMouseRow != oBrw:nRowSel
      uBm   := oBrw:BookMark
      Eval( oBrw:bSkip, nMouseRow - oBrw:nRowSel )   //here  (variable nMouseRow do not exists)
      uVal  := oMouseCol:Value
      oBrw:BookMark := uBm
   else
      uVal  := oMouseCol:Value
   endif

return cValToChar( uVal )

 

If you can please test and confirm if this is working, it may be useful for other users using old versions.
Regards

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

Re: help for xbrowse tooltip

Postby joseluisysturiz » Wed Feb 25, 2015 4:24 pm

I use mysql and perfect function, use it as done Francisco and shows me the contents of any cell tool tip, thank you very much for your help...saludos... :shock:

Code: Select all  Expand view

oBrow:bToolTips := { | oBrow, r, c, f, oMouseCol, nMouseRow| MyColToolTip( oBrow, r, c, f, oMouseCol, nMouseRow ) }

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 )
 
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: help for xbrowse tooltip

Postby FranciscoA » Wed Feb 25, 2015 7:14 pm

José Luis.
Do you can tell us what version are you using?
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 83 guests