c5tooltip and btnbmp

c5tooltip and btnbmp

Postby Silvio.Falconi » Fri Jul 13, 2018 4: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: Select all  Expand view
#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 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: 6771
Joined: Thu Oct 18, 2012 7:17 pm

Re: c5tooltip and btnbmp

Postby Silvio.Falconi » 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 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: 6771
Joined: Thu Oct 18, 2012 7:17 pm

Re: c5tooltip and btnbmp

Postby cnavarro » 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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: c5tooltip and btnbmp

Postby Silvio.Falconi » Mon Jul 16, 2018 4: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 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: 6771
Joined: Thu Oct 18, 2012 7:17 pm

Re: c5tooltip and btnbmp

Postby Silvio.Falconi » Mon Jul 16, 2018 4:09 pm

Unfortunately Making your modify I have this problem

Image

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 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: 6771
Joined: Thu Oct 18, 2012 7:17 pm

Re: c5tooltip and btnbmp

Postby cnavarro » Mon Jul 16, 2018 5: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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: c5tooltip and btnbmp

Postby Silvio.Falconi » 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 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: 6771
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Silvio.Falconi and 95 guests