FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour c5tooltip and btnbmp
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
c5tooltip and btnbmp
Posted: Fri Jul 13, 2018 04:29 PM
Please I not Know how resolve this problem

i wish show c5tooltip into btnbmp

I have an array type aBtn[n] on my app

here there is a small test

Code (fw): Select all Collapse
#include"fivewin.ch"



function test()

   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:\work\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| MyC5ToolTip( oBtn ,oDlg)}
      END
      nCol  += 80
   next n


   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

//------------------------------------------------------------------------------------------------------------//
Function MyC5ToolTip( 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                   := "test for Body"

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

   oTip:lBalloon               := .T.

  oCtrl:oToolTip      := oTip

Return oTip
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: c5tooltip and btnbmp
Posted: Mon Jul 16, 2018 10:36 AM

it not found otooltip

any solution pls ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: c5tooltip and btnbmp
Posted: Mon Jul 16, 2018 11:15 AM
Silvio.Falconi wrote:it not found otooltip

any solution pls ?


When cTooltip DATA is evaluate, not send object to codeblock
Please see method of Window CLASS


METHOD ShowToolTip( nRow, nCol, cToolTip ) CLASS TWindow

local aToolTip, nLenToolTip, oTemp, hWnd
local cIcon, hIcon, cText, cTitle, nClrFore, nClrBack, nWidth
local nDelayTime, nDelayType

DEFAULT nCol := 7, nRow := ::nHeight() + 7, ;
cToolTip := ::cToolTip

if oToolTip == nil

if ValType( cToolTip ) == "B"
cToolTip = Eval( cToolTip )
// Modify this
//cToolTip := Eval( cToolTip, Self )
endif

.../...


If you do not want to modify the class, modify your program code so that you can receive the control object in another way
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: c5tooltip and btnbmp
Posted: Mon Jul 16, 2018 04:02 PM

>If you do not want to modify the class, modify your program code so that you can receive the control object in another way
and How ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: c5tooltip and btnbmp
Posted: Mon Jul 16, 2018 04:09 PM
Unfortunately Making your modify I have this problem



when I move the mouse on a btnbmp it shows the tooltip when I move it on another it does not hide the previous tooltip and shows the new one and so on ...
When I click on the window or move the window or resize it and remove the mouse on a btnbmp it no longer shows the tooltip

This is not normal

there is a bug...

if I make

if ValType( cToolTip ) == "B"
cToolTip = Eval( cToolTip,self )
endif

it call the action on eval() ok

but then it Open a window ( see METHOD ShowToolTip)

DEFINE WINDOW oToolTip,,,,,,,



Perhaps Antonio can insert an option when the user call the eval action then window not create internal tooltip

I not understood why c5tooltip run ok On vistamenu class having the same window class
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: c5tooltip and btnbmp
Posted: Mon Jul 16, 2018 05:53 PM
Yes, this not is a good solution, only a test
Try with

:cTooltip := { || MyC5ToolTip( oBtn ,oDlg)}
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: c5tooltip and btnbmp
Posted: Tue Jul 17, 2018 11:30 AM

allready tried

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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

Continue the discussion