Antonio, all the sideeffects are come from the array aBrushes in TBRUSH. You are make automatically a white brush in TDIALOG. And in this brush you write with gradientbrush() hBitmap and hBrush new. On another dialog this brush is used also, if it is in aBrushes present. And now are the old hBrush and hBitmap is used. If you define an brush with another color as you say, the situation is the same on all dialogs using this brush-color.
Possible way is to check aBrushes for reusing a brush in TBRUSH! For me this codeextension is ok.
Code: Select all | Expand
if ( nAt := AScan( ::aBrushes, {|oBrush| oBrush:cStyle == ::cStyle .and. ;
oBrush:nRGBColor == ::nRGBColor .and. ;
oBrush:cBmpFile == ::cBmpFile .and. ;
oBrush:cBmpRes == ::cBmpRes } ) ) > 0
if !empty(::aBrushes[ nAt ]:hBitmap) .and. ( empty(::aBrushes[ nAt ]:cBmpFile) .and. empty(::aBrushes[ nAt ]:cBmpRes) )
::aBrushes[ nAt ]:end()
else
#ifndef __XPP__
Self := ::aBrushes[ nAt ] // This is not permited with XBase++
::nCount++
return Self
#else
::aBrushes[ nAt ]:nCount++
return ::aBrushes[ nAt ]
#endif
endif
endif