Enrico, Cristobal,
The source code for Class TBtnBmp Method Paint() has been evolving along the years and actually is quite messy.
So this morning I decided to reorganize it, to properly structure it and I have found this:
If you replace Method Paint() with this code:
- Code: Select all Expand view
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 nil
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.
So in order to properly fix its painting we first need to know where this is coming from. Please test it and lets try to find why that is happening. Thanks