FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A Button-effect for BMP > oBmp:bLClicked ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

A Button-effect for BMP > oBmp:bLClicked ?

Posted: Fri Sep 12, 2008 08:18 AM
Hello,

For a new project, I'm looking for a Button-effect for the method:
< oBmp:bLClicked > to get a Button-look.
It means : a < pressed-effect > and changing the mouse-cursor inside the bitmap-earea.
Maybe to add something inside the BMP-class ?
Is there a sample for it ?



@ 4, 16 BITMAP oBmp FILENAME "..\bitmaps\Tutanka1.bmp" ADJUST SIZE 280, 200 OF oWnd 
   
oBmp:bLClicked := {|| Msgalert( "Button" ) }


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

A Button-effect for BMP &gt; oBmp:bLClicked ?

Posted: Fri Sep 12, 2008 01:37 PM
Uwe,

#include "fivewin.ch"

function main()
   local oWnd, oBmp

   define window oWnd title "Test Mouse Over"

   @ 4, 16 BITMAP oBmp FILENAME "Tutanka1.bmp" ADJUST SIZE 280, 200 OF oWnd

   oBmp:bLClicked := {|| Msgalert( "Button" ) }

   oBmp:bMMoved := { || cursorhand() }

   activate window oWnd

return nil
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

Cursor-hand on BMP

Posted: Fri Sep 12, 2008 02:09 PM
James,

thank you very much,
The line is added to the source-sample.

I had a look at

 
oBmp:lStretch := .f.
nZoom:=nZoom-(0.10)
oBmp:Zoom(nZoom)
oBmp:Refresh()
oBmp:ScrollAdjust()

and than :

oBmp:lStretch := .f.
nZoom:=nZoom+0.10
oBmp:Zoom(nZoom)
oBmp:Refresh()
oBmp:ScrollAdjust()

do get a visual click-effect

maybe it doesn't work with resources ?

A visual-effect you can get with :

oBmp4:bLClicked := {|| ( oBmp4:Hide(), oBmp4:Show(), ;
MsgAlert( "Your Function 1" ) ) }


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM

activated BMP

Posted: Fri Sep 12, 2008 10:24 PM
Hello James,

I found a way, to solve the problem



// blClicked changes the Color
// the user can see, if a button is activated.
// after closing the dialog or message, the old color is restored to the button.
// but maybe you have still another idea ?

REDEFINE BITMAP oBmp4  ID 210 ADJUST RESOURCE "Blanc"  OF oDlg 
oBmp4:bLClicked := {|| ( oBMP4:bPainted := ;
{ |hDC|OnPaintV( hDC,oBMP4, 128,15779475,0, ; 
"Vertical  Button", oBfont1, 0 ,"TEST.BMP" ,4 ) }, oBmp4:Refresh(), ;
MsgAlert( "Your Function 1" ), ;
oBMP4:bPainted := { |hDC|OnPaintV( hDC,oBMP4, 13003573,15779475,0, ; 
"Vertical  Button",  oBfont1, 0 ,"TEST.BMP" ,4 ) }, oBmp4:Refresh() ) }
oBmp4:bMMoved := { || cursorhand() } 

// The init Color
// ---------------
oBMP4:bPainted := { |hDC|OnPaintV( hDC,oBMP4, 13003573,15779475,0, ; 
"Vertical  Button", oBfont1, 0 ,"TEST.BMP" ,4 ) }


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion