VistaMenu new feature

VistaMenu new feature

Postby Silvio.Falconi » Fri Oct 19, 2012 8:26 am

Dear Antonio, Dear Paco,

I add on Vistamenu Class an feature to show an image trasparent at the end of vistamenu window

I take this feature from another class of our Big Friend Paco I have and I think there 's no problems to pubblished it to our community.



Image








I add two DATA

DATA cWatermark
DATA nWTrans

the first is the name of the bitmap, the second is a numeric value to set the transparency of this logo

I add a new method METHOD DrawTraspLogo()

on the Paint method after the line FillSolidRect( hDCMem, rc, ::nClrPane )

I add this commands


if !Empty(::cWatermark )
:: DrawTraspLogo(hDCMem)
ENDIF

I add this method
METHOD DrawTraspLogo(hDCMem) CLASS TVistaMenu
Local hWater,nW,nH,nT,nB,nR
if !Empty(::cWatermark )
hWater := LoadImageEx( ::cWatermark )
if hWater != 0
nW := BmpWidth ( hWater )
nH := BmpHeight( hWater )
nT := ::nHeight - nH-1 -10
nL := ::nWidth - nW-1 -25 //????
nB := nT + nH
nR := nL + nW
DrawAlphaTransparentBitmap( hDCMem, hWater, {nT,nL,nB,nR}, ::nWTrans, RGB(255,0,255) )
DeleteObject( hWater )
endif
endif
return 0




to make a test you must add on .\samples\vistamn1.prg :

oVMenu := TVistaMenu():New( 0,0, 100, 100, oWnd )
oVMenu:nColumns := 2
oVMenu:nType := 2
oVMenu:cWatermark:=".\bitmaps\logo.bmp"
oVMenu:nWTrans :=180




It run ok only when I select a Item on Vistamenu the item not is trasparent when exit the logo at left
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: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: VistaMenu new feature

Postby BeoBeo » Fri Oct 19, 2012 10:25 am

Nice
BeoBeo
 
Posts: 6
Joined: Tue Oct 09, 2012 9:59 am

Re: VistaMenu new feature

Postby Andrés González » Fri Oct 19, 2012 5:08 pm

Very nice Silvio.
Saludos

Andrés González desde Mallorca
User avatar
Andrés González
 
Posts: 628
Joined: Thu Jan 19, 2006 10:45 am
Location: Mallorca


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests