Page 1 of 1

c5Tooltip+btnbmp on a dialog

Posted: Sun May 05, 2019 8:51 pm
by Silvio.Falconi
I need to show many Informaton and I need c5Tooltip but there is a problem

I tried with this code but when I move the mouse to another btnbmp it create a new tooltip without delete that first created ( see the picture under)

this test create 7 btnbmp , you can try to move the mouse and it show the tooltip it make the error I post under ... the same test with window make not error why ?
How I can resolve ?

Code: Select all

 

  
    #include"fivewin.ch"

    function TestCurrent()

       local oDlg, oFont, oBtn, aBtn[ 7 ]
       local nRow, nCol, n

       DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

       DEFINE DIALOG oDlg SIZE 600,200 PIXEL TRUEPIXEL FONT oFont

       nRow  := 50
       nCol  := 30

       for n := 1 to 7

          @ nRow, nCol BTNBMP aBtn[ n ] RESOURCE "c:\fwh\bitmaps\alphabmp\world.bmp" ;
             SIZE 64,64 PIXEL OF oDlg FLAT TOP COLOR CLR_WHITE,CLR_GREEN NOBORDER

          WITH OBJECT ( oBtn := aBtn[ n ] )
             :Cargo      := n
             :bAction    := { |oBtn| oBtn:Toggle() }
             :bClrGrad   := { |l,oBtn| If( oBtn:lPressed, CLR_HRED, CLR_GREEN ) }
             :cTooltip   := { |oBtn| HazC5ToolTip( oBtn ,oDlg)}
          END
          nCol  += 80
       next n

     

       ACTIVATE DIALOG oDlg CENTERED
       RELEASE FONT oFont

    return nil

    //------------------------------------------------------------------------------------------------------------//
    Function HazC5ToolTip( oCtrl ,oDlg)

       Local oTip

       //New( nTop, nLeft, nWidth, nHeight, oWnd, lDisenio, nClrPane, nClrPane2, nClrText, nWRadio, nHRadio ) CLASS TC5ToolTip
       oTip := TC5ToolTip():New( 0,0 , 200, 150, oDlg, , CLR_HGRAY, CLR_HGRAY, CLR_BLUE, 0 , 0 )

       oTip:nTimer                    := -1 //15000
       oTip:lLineHeader           := .T.
       oTip:cHeader                 := "Header"
       oTip:cBmpHeader         := "..\bitmaps\16edit.bmp"

       oTip:cHeader2                := "Header 2"

       oTip:lLineFoot               := .T.
       oTip:cFoot                     := "Footer"
       oTip:cBmpFoot             := "..\bitmaps\16object.bmp"

       oTip:lSplitHdr                := .T.
       oTip:lLeft                       := .T.
       oTip:cBmpLeft               := "..\bitmaps\16code.bmp"

       oTip:lRightAlignBody  := .T.

       oTip:cBody                   := "In un posto a la macchia di cui non voglio ricordare il nome"

       oTip:lBtnClose              := .F.   //.T.
       oTip:lBorder                 := .F.

       oTip:lBalloon               := .T.

       oCtrl:oToolTip      := oTip

    Return oTip
    
 

and this is the error


Image


I search on this forum but I not found a solution for this error

Re: c5Tooltip+btnbmp on a dialog

Posted: Mon May 06, 2019 4:25 pm
by Silvio.Falconi
the problem is not close the tooltip
perhaps need a ::oWnd:NcMouseMove() on mousemove (btnbmp) but I not understood where


on fivewin upgrade of
New FTDN July/Julio 2015 (FWH 15.07)
* Enhancement: modify class TGET will implementation C5ToolTip
viewtopic.php?f=6&t=29368#p180138


I found an error
I explain you

there is an error because I see two tooltip
c5tooltip and
fwh tooltip


see the image
Image

Re: c5Tooltip+btnbmp on a dialog

Posted: Mon May 06, 2019 5:09 pm
by ukoenig
Silvio,

You can disable the basic tooltip

Function HazC5ToolTip( oCtrl )
Local oTip

oCtrl:cTooltip := "" // disable normal tooltip
oTip := TC5ToolTip():New( 0,0 , 200, 150, oWnd, , CLR_HGRAY, CLR_HGRAY, CLR_BLUE, 0 , 0 )

regards
Uwe :D

Re: c5Tooltip+btnbmp on a dialog

Posted: Mon May 06, 2019 9:55 pm
by Silvio.Falconi
Uwe,
with

Code: Select all

oCtrl:cTooltip := "" // disable normal tooltip
I see the same the tooltip of fwh

And for the error on btnbmp ?

Do you try the test i post?

HOW I can resolve ?

Re: c5Tooltip+btnbmp on a dialog

Posted: Fri May 10, 2019 11:21 am
by Silvio.Falconi
Antonio, any solution pls?