btnbmp and tooltip

btnbmp and tooltip

Postby Silvio.Falconi » Fri Jun 29, 2018 5:06 pm

can I use c5tooltip on btnbmps ?

I made :

aBtn[ n]:cToolTip = { |oBtn| HazC5ToolTip( oBtn ) }


............
Code: Select all  Expand view  RUN
Function HazC5ToolTip( oCtrl )
Local oTip
//New( nTop, nLeft, nWidth, nHeight, oWnd, lDisenio, nClrPane, nClrPane2, nClrText, nWRadio, nHRadio ) CLASS TC5ToolTip
oTip := TC5ToolTip():New( 0,0 , 200, 150, oCtrl, , 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                   := "En un lugar de la Mancha de cuyo nombre no quiero acordarme"  //Memoread( "tooltip.prg")

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

//oTip:lBalloon               := .T.

oCtrl:oToolTip      := oTip
Return oTip



but not rn and make error
any solution ?
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: btnbmp and tooltip

Postby karinha » Fri Jun 29, 2018 6:29 pm

Tem coisa errada com esta classe.

C'è qualcosa di sbagliato in questa classe.

There is something wrong with this class.

https://imgur.com/4TNSZit

Image

Code: Select all  Expand view  RUN

// Testing a transparent TBtnBmp on a transparent DialogBox

#include "FiveWin.ch"

//----------------------------------------------------------------------------//

STATIC oDlg

function Main()

   // local oBru, oDlg, oBtn
   local oBru, oBtn, oBtn2

   DEFINE BRUSH oBru FILENAME "../bitmaps/Backgrnd/beach.bmp"

   DEFINE DIALOG oDlg SIZE 400, 200 BRUSH oBru TRANSPARENT

   @ 2, 2 SAY "Hello" OF oDlg
   oDlg:aControls[ 1 ]:lTransparent = .t.

   @ 70, 30 BTNBMP oBtn FILENAME "../bitmaps/yes.bmp" ;
      SIZE 50, 30 OF oDlg NOBORDER ACTION MsgInfo( "click" )
     
   oBtn:lTransparent = .T.

   // Manipulate directly the cToolTip DATA of other controls than ButtonBitmaps
   oBtn:cToolTip = { || HazC5ToolTip( oBtn ) } //"Here it is!"

   @ 70, 120 BTNBMP oBtn2 FILENAME "../bitmaps/no.bmp" ;
      SIZE 50, 30 OF oDlg NOBORDER ACTION MsgInfo( "click" )
     
   oBtn2:lTransparent = .T.

   // Manipulate directly the cToolTip DATA of other controls than ButtonBitmaps
   oBtn2:cToolTip = { || HazC5ToolTip( oBtn2 ) } //"Here it is!"
     
   ACTIVATE DIALOG oDlg CENTERED

return nil

//----------------------------------------------------------------------------//

Function HazC5ToolTip( oCtrl )

   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                   := "En un lugar de la Mancha de cuyo nombre no quiero acordarme"  //Memoread( "tooltip.prg")
   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
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7844
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: btnbmp and tooltip

Postby Silvio.Falconi » Fri Jun 29, 2018 6:36 pm

give me error

I have an array

aBtn[ n]:cToolTip = { |oBtn| HazC5ToolTip( oBtn ,oDlg,n ) }

Code: Select all  Expand view  RUN
application
===========
   Path and name: C:\Work\Errori\image_su_btnbmp\test.Exe (32 bits)
   Size: 3,694,592 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 17.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 2 secs
   Error occurred at: 29-06-2018, 20:34:53
   Error description: Error BASE/1005  No exported variable: OTOOLTIP
   Args:
     [   1] = U  
     [   2] = O   TC5TOOLTIP

Stack Calls
===========
   Called from:  => _OTOOLTIP( 0 )
   Called from: test.prg => HAZC5TOOLTIP( 405 )
   Called from: test.prg => (b)SHOW_BEACH( 159 )
   Called from: .\source\classes\WINDOW.PRG => TBTNBMP:SHOWTOOLTIP( 3141 )
   Called from: .\source\classes\WINDOW.PRG => TBTNBMP:CHECKTOOLTIP( 3120 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:MOUSEMOVE( 3050 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:MOUSEMOVE( 767 )
   Called from: btnbmp.prg => TBTNBMP:MOUSEMOVE( 1124 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1731 )
   Called from: btnbmp.prg => TBTNBMP:HANDLEEVENT( 1883 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3356 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
   Called from: test.prg => SHOW_BEACH( 199 )


I try with

Function HazC5ToolTip( oCtrl ,oDlg,n)
....
oCtrl[n]:oToolTip := oTip

but make the same error

Code: Select all  Expand view  RUN
Application
===========
   Path and name: C:\Work\Errori\image_su_btnbmp\test.Exe (32 bits)
   Size: 3,694,592 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 17.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200

   Time from start: 0 hours 0 mins 3 secs
   Error occurred at: 29-06-2018, 20:37:48
   Error description: Error BASE/1068  Argument error: array access
   Args:
     [   1] = U  
     [   2] = N   201

Stack Calls
===========
   Called from: test.prg => HAZC5TOOLTIP( 405 )
   Called from: test.prg => (b)SHOW_BEACH( 159 )
   Called from: .\source\classes\WINDOW.PRG => TBTNBMP:SHOWTOOLTIP( 3141 )
   Called from: .\source\classes\WINDOW.PRG => TBTNBMP:CHECKTOOLTIP( 3120 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:MOUSEMOVE( 3050 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:MOUSEMOVE( 767 )
   Called from: btnbmp.prg => TBTNBMP:MOUSEMOVE( 1124 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1731 )
   Called from: btnbmp.prg => TBTNBMP:HANDLEEVENT( 1883 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3356 )
   Called from:  => DIALOGBOXINDIRECT( 0 )
   Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
   Called from: test.prg => SHOW_BEACH( 199 )
 
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: btnbmp and tooltip

Postby karinha » Fri Jun 29, 2018 6:46 pm

Post a complete example please, chunks of programs will not help.

Pubblica un esempio completo per favore, blocchi di programmi non aiuteranno.

Poste un ejemplo completo por favor, pedazos de programas no ayudan.

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7844
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: btnbmp and tooltip

Postby Silvio.Falconi » Fri Jun 29, 2018 8:12 pm

is here


Code: Select all  Expand view  RUN

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests