Code: Select all | Expand
METHOD Pintar( nClrLetra, hBrush ) CLASS TGSAY // PINTA RECUADRO, FONDO Y LETRA (CON O SIN FOCO)
LOCAL hOFnt,nBkMd,nTxCl
LOCAL nOldP := SelectObject(::hDc,::hObj[1])
LOCAL nOldB := SelectObject(::hDc,IF(::lTransp .AND. hBrush = NIL,GetStockObject(5),hBrush))
LOCAL nSmbr := IF(::oFont:lBold,2,1)
*
IF !::lActive .AND. ::nModo > 0 .AND. ::nModo < 6
SelectObject(::hDc,::hObj[2])
Rectangle(::hDc,0,0,::nHeight,::nWidth)
ELSEIF ::nModo = MD_SHADED
Rectangle(::hDc,0,0,::nHeight,::nWidth)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
MoveTo(::hDc,0,::nHeight-1)
LineTo(::hDc,::nWidth-1,::nHeight-1)
LineTo(::hDc,::nWidth-1,0)
ELSEIF ::nModo = MD_RAISED
Rectangle(::hDc,0,0,::nHeight,::nWidth)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
MoveTo(::hDc,0,::nHeight-1)
LineTo(::hDc,0,0)
LineTo(::hDc,::nWidth-1,0)
ELSEIF ::nModo = MD_BOX
Rectangle(::hDc,1,1,::nHeight,::nWidth)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
SelectObject(::hDc,GetStockObject(5)) // Object(5) => SIN BRUSH
Rectangle(::hDc,0,0,::nHeight-1,::nWidth-1)
ELSEIF ::nModo = MD_3DBOX
SelectObject(::hDc,GetStockObject(7)) // Object(7) => LAPIZ NEGRO
Rectangle(::hDc,0,0,::nHeight,::nWidth)
SelectObject(::hDc,::hObj[1])
Rectangle(::hDc,1,1,::nHeight-1,::nWidth-1)
SelectObject(::hDc,GetStockObject(6)) // Object(6) => LAPIZ BLANCO
MoveTo(::hDc,1,::nHeight-2)
LineTo(::hDc,1,1)
LineTo(::hDc,::nWidth-2,1)
ELSEIF ::nModo = MD_SQUARE
Rectangle(::hDc,0,0,::nHeight,::nWidth)
ELSEIF ::nModo = MD_ROUND
IF !::lActive
SelectObject(::hDc,::hObj[2])
ENDIF
RoundRect(::hDc,0,0,::nWidth,::nHeight,::nAngle,::nAngle)
ELSE
SelectObject(::hDc,GetStockObject(8)) // Object(8) => SIN PEN
Rectangle(::hDc,0,0,::nHeight+1,::nWidth+1)
ENDIF
*
nBkMd := SetBkMode( ::hDc, F_TRANSP )
hOFnt := SelectObject(::hDc,::oFont:hFont)
IF !::lActive
nTxCl := SetTextColor( ::hDc, IF(::lTransp,RGB(220,220,220),ACLARO(::C_FONDO,80)) )
DrawText( ::hDc, ::cCaption, {4,4,::nHeight-2,::nWidth-2}, ::nAlign )
SetTextColor( ::hDc, IF(::lTransp,RGB(128,128,128),OSCURO(::C_FONDO,64)) )
DrawText( ::hDc, ::cCaption, {3,3,::nHeight-3,::nWidth-3}, ::nAlign )
ELSE
nTxCl := SetTextColor( ::hDc, nClrLetra )
IF ::lSombra // MASTER: linea 486 AQUI
SetTextColor( ::hDc, ::C_SOMBRA)
DrawText( ::hDc, ::cCaption, {4,4+nSmbr,::nHeight-2,::nWidth-2+nSmbr}, ::nAlign )
SetTextColor( ::hDc, nClrLetra )
ENDIF
DrawText( ::hDc, ::cCaption, {3,3,::nHeight-3,::nWidth-3}, ::nAlign )
ENDIF
SetTextColor( ::hDC, nTxCl )
SetBkMode( ::hDc, nBkMd )
*
SelectObject(::hDc,hOFnt)
SelectObject(::hDc,nOldB)
SelectObject(::hDc,nOldP)
RETURN NIL
Regards, saludos.