Antonio,
I have a proposal: why not to revert back to the previous btnbmp.prg that used to work very well? What was the reason behind the new changes?
EMG
Antonio,
I have a proposal: why not to revert back to the previous btnbmp.prg that used to work very well? What was the reason behind the new changes?
EMG
Enrico,
The btnbmp source code is an old class (it comes with FWH since the very early beginning) and have been experiencing many transformations, so from time to time, we try to simplify and reorganice the code.
Recently Rao worked on it to simplify it, but it seems that still it is not ok. So yes, in the meantime, you could use the previous version and everything should work fine ![]()
* Fix: There was a painting error in Class TBtnBmp due to recent changes in
Class TBtnBmp. Now it is ok.
Enrico,
I tested them on a ButtonBar and also on GET ... ACTION ... and seemed ok.
If I remember properly you provided here an example, I am going to review it.
thanks
Enrico,
I did my tests on FWH\samples\testbtnb.prg. I have just tested it again and seems fine.
Could you please run that example and see if it is fine there for you ? thanks
Antonio,
I just sent you an image showing the problem:
There is a black border that wasn't there before
The bitmap is not centered in the button anymore
EMG
   if ::lBorder
     WndBox( ::hDC, 0, 0, ::nHeight - 1, ::nWidth - 1 )
   endifAntonio,
no, sorry. The border went away, but:
EMG
![]()
Enrico Maria Giordano wrote:Antonio,
no, sorry. The border went away, but:
1. it goes back when the mouse is over the button
2. the bitmap is still not centered
3. there is no 3D effect on the button anymore
EMG
METHOD Paint() CLASS TBtnBmp
// local aInfo := ::DispBegin()
if ::lTransparent
SetBrushOrgEx( ::hDC, nBmpWidth( ::oWnd:oBrush:hBitmap ) - ::nLeft,;
nBmpHeight( ::oWnd:oBrush:hBitmap ) - ::nTop )
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oWnd:oBrush:hBrush )
else
if Empty( ::bClrGrad )
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
else
if ::aGrad != nil
GradientFill( ::hDC, 0, 0, ::nHeight, ::nWidth, ::aGrad() )
endif
endif
endif
// ::DispEnd( aInfo )
return nilAntonio,
can you send me the modified btnbmp.prg, please?
EMG
I don't keep a copy of my changes today, sorry.
But just replace the Method Paint() in Class TBtnBmp and you will see what I mean.
We need to solve this before moving on and reorganize Method Paint()
My plan is to replace it with a much more structured code.
Ok, can you send me the original btnbmp.prg? I replaced it with the working one. ![]()
EMG
Antonio,
I already have the new btnbmp.prg! ![]()
EMG
Antonio Linares wrote:This way the background is properly filled. Now if you uncomment the calls to DispBegin() and DispEnd() an unexpected border appears at the top and at the left.