To Daniel,
I changed a normal Button to BtnBmp inside VTitles, because it looks much better.
All Background-styles are working fine, but not using Gradient and Base.
Is it possible, to fix the Problem ? ( I would like, to keep the round Button ).
Otherwise I have to change the Button-class using Gradient-background.
oBar1:aGrdBack := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } }
As soon I select a Gradient-background there is a Error ( the Button cannot detect the Gradient ) :
Application
===========
Path and name: E:\T_MESSAGE\Message.exe (32 bits)
Size: 1,772,032 bytes
Time from start: 0 hours 0 mins 6 secs
Error occurred at: 07/07/11, 21:52:15
Error description: Error BASE/1004 Class: 'NIL' has no exported method: HBITMAP
Args:
[ 1] = U
Stack Calls
===========
Called from: => HBITMAP(0)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:PAINT(1267)
Called from: .\source\classes\BTNBMP.PRG => (b)TBTNBMP:TBTNBMP(112)
Called from: => TBTNBMP:DISPLAY(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1459)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1450)
Called from: .\source\classes\WINDOW.PRG => _FWH(3394)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(978)
Called from: .\Message.PRG => MAIN(539)
I got it working, but no Solution of using BASE :
aGrad := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } }
oBar1:aGrdBack := {}
hDC = CreateCompatibleDC( oBar1:GetDC() )
hBmp = CreateCompatibleBitMap( oBar1:hDC, oBar1:nWidth, oBar1:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oBar1:nHeight, oBar1:nWidth, aGrad )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
oBar1:ReleaseDC()
oBar1:SetBrush( oBrush )
RELEASE BRUSH oBrush
That doesn't work using BtnBmp :
oBar1:aGrdBack := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } }
oBar1:aGrdBase := { { nGradPos, nColor1, nColor2 } , ;
{ nGradPos, nColor2, nColor1 } }
Testing with BASE
doesn't crash, but not the expected Result :
oBar1:lBase := .T.
aGrad := { { nGradPos, nColor1, nColor2 },{ nGradPos, nColor2, nColor1 } }
oBar1:aGrdBack := {}
hDC = CreateCompatibleDC( oBar1:GetDC() )
hBmp = CreateCompatibleBitMap( oBar1:hDC, oBar1:nWidth, oBar1:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oBar1:nHeight, oBar1:nWidth, aGrad )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
oBar1:ReleaseDC()
oBar1:SetBrush( oBrush )
RELEASE BRUSH oBrush
Best Regards
Uwe