by Otto » Thu Nov 08, 2018 7:57 am
Dear Antonio
I use TRBtn as I never got TImage working.
In my copy of TRBtn I inserted DrawEllipse method and changed Paint method.
This is working for me. But now I want to switch to the newest FIVEWIN version and original FW classes evolved much.
It is difficult for me to keep up my changes.
Best regards
Otto
method paint
...
if ::lMOver .and. nTypeButton != 3
do case
case nTypeButton == TYPE_NORMAL
if ::lSelected
GradientFill( ::hDC, 1, 1, ::nHeight, ::nWidth - If(::lRound,2,0), eval( ::bClrGradSelectPress, ::lPressed ) )
else
//procl
if ::lRound = .t.
GradientFill( ::hDC, 1, 1, ::nHeight, ::nWidth - If(::lRound,2,0), eval( ::bClrGradNormal, ::lPressed ) )
else
::DrawEllipse( ::hDC, CLR_BLUE, 1 )
endif
endif
case nTypeButton == TYPE_POPUP
GradientFill( ::hDC, 1,1, ::nHeight, ::nWidth - 2, ::aClrGradBack )
...
//----------------------------------------------------------------------------//
METHOD DrawEllipse( hDC, nRGBColor, n ) CLASS TRBtn
local hOldBrush := SelectObject( hDC, GetStockObject( NULL_BRUSH ) )
local hPen := CreatePen( hDC, 1, nRGBColor )
DEFAULT n := -1
Ellipse( hDC, n, n, ::nWidth - 1 , ::nHeight - 1 , hPen )
SelectObject( ::hDC, hOldBrush )
DeleteObject( hPen )
return nil
//----------------------------------------------------------------------------//
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club********************************************************************