CLASSE DSAY.PRG CON COMANDO TRANSPARENT

Post Reply
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

CLASSE DSAY.PRG CON COMANDO TRANSPARENT

Post by karinha »

Buenas...

Hola Foro. Necesito di una DSAY.PRG y DSAY.CH modificada para el uso del comando TRANSPARENT.

És posible??

kmt_karinha@pop.com.br

Gracias, Saludos a todos.
João Santos - São Paulo - Brasil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

João,

Code: Select all

METHOD Paint() CLASS TDSay

   local n 
   local nColorShadow, nColorLight

   ::GetDC()

   if ::lActive

      if ::lView
         if ::lTransparent .and. ! Empty( ::oBrush:hBitmap )
            SetBrushOrgEx( ::hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
            FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
         endif 
         
         for n := 1 to len( ::aCaption )
            ...
Also this fix is required in control.prg:

Code: Select all

METHOD Initiate( hDlg ) CLASS TControl

   ...

   if ::lTransparent
      ::SetBrush( ::oWnd:oBrush ) 
   else
      ::SetBrush( TBrush():New( "NULL" ) )
   endif   

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Baxajaun
Posts: 853
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Post by Baxajaun »

Antonio,

thanks a lot !!! :wink:

Saludos,

Félix
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Post by karinha »

Antonio, No Funciono... Ke hice errado??

Aplicacao:
===========
Caminho(Path): C:\PDVXB\BALCAOW.EXE (32 bits)
Tamanho: 3,496,960 bytes
Hora Inicial: 0 hours 0 mins 1 secs
Ocorrencia de Erro: 21/02/06, 11:43:58
Descricao do Erro: Error BASE/1004 Message not found: TDSAY:LTRANSPARENT

Chamada da Pilha:
=================
Chamada De: TDSAY:ERROR(179)
Chamada De: (b)HBOBJECT:HBOBJECT(105)
Chamada De: TDSAY:MSGNOTFOUND(0)
Chamada De: TDSAY:LTRANSPARENT(167)
Chamada De: TCONTROL:INITIATE(378)
Chamada De: (b)TDSAY:TDSAY(68)
Chamada De: TDSAY:INITIATE(0)
Chamada De: __OBJSENDMSG(0)
Chamada De: OSEND(224)
Chamada De: ASEND(175)
Chamada De: TDIALOG:INITIATE(638)
Chamada De: TDIALOG:HANDLEEVENT(855)
Chamada De: DIALOGBOXINDIRECT(0)
Chamada De: TDIALOG:ACTIVATE(264)
Chamada De: SENHA2(335)
Chamada De: SENHA(137)
Chamada De: MAIN(295)
João Santos - São Paulo - Brasil
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Post by karinha »

//-> CLASSE DSAY.PRG

METHOD Paint() CLASS TDSay

local n
local nColorShadow, nColorLight

::GetDC()

if ::lActive

if ::lView

//-> Modificado Por Antonio Linares, em 20/02/2006 Para TRANSPARENT
if ::lTransparent .and. ! Empty( ::oBrush:hBitmap )
SetBrushOrgEx( ::hDC, nBmpWidth( ::oBrush:hBitmap ) - ::nLeft, nBmpHeight( ::oBrush:hBitmap ) - ::nTop )
FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
endif

for n := 1 to len( ::aCaption )
WSay( ::hWnd, ::hDC, ::nDTop + ( n - 1 ) * ::nTxtHeight, ::nDLeft, ::aCaption[ n ], ::nClrText,,;
If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
next

if ::lScroll .and. ::lWrap
if ::lHorizontal
for n := 1 to len( ::aCaption )
WSay( ::hWnd, ::hDC, ::nDTop + ( n - 1 ) * ::nTxtHeight, ::nDLeft + ::nLong, ::aCaption[ n ], ::nClrText,,;
If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
next
else
for n := 1 to len( ::aCaption )
WSay( ::hWnd, ::hDC, ::nDTop + ( n - 1 ) * ::nTxtHeight + ::nLong, ::nDLeft, ::aCaption[ n ], ::nClrText,,;
If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
next
endif
endif

else

InvalidateRect( ::hWnd, ::aRect, .t. )

endif

else

nColorShadow := GetSysColor( COLOR_BTNSHADOW )
nColorLight := GetSysColor( COLOR_BTNHIGHLIGHT )

for n := 1 to len( ::aCaption )
WSay( ::hWnd, ::hDC, ::nDTop + ( n - 1 ) * ::nTxtHeight + 1, ::nDLeft + 1, ::aCaption[ n ], nColorLight,,;
If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
WSay( ::hWnd, ::hDC, ::nDTop + ( n - 1 ) * ::nTxtHeight, ::nDLeft, ::aCaption[ n ], nColorShadow,,;
If( ::oFont != nil, ::oFont:hFont, 0 ), .T., .T., ::nAlign )
next

endif

// 3D

if ::lShaded
WndInset( ::hWnd, ::hDC ) // SHADED, SHADOW
endif

if ::lRaised
WndRaised( ::hWnd, ::hDC ) // RAISED
endif

if ::lBox
WndBoxIn( ::hDC, 0, 0, ::nBottom-::nTop, ::nRight-::nLeft )
WndBoxRaised( ::hDC, 1, 1, ::nBottom-::nTop-1, ::nRight-::nLeft-1 )
endif

::ReleaseDC()

return nil
João Santos - São Paulo - Brasil
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Post by karinha »

CLASSE CONTROL.PRG

METHOD Initiate( hDlg ) CLASS TControl

DEFAULT ::lActive := .t., ::lDrag := .f., ::lCaptured := .f.,;
::lFocused := .f., ::lCancel := .f.

if( ( ::hWnd := GetDlgItem( hDlg, ::nId ) ) != 0 )

If( ::lActive, ::Enable(), ::Disable() )
::Link()

if ::oFont != nil
::SetFont( ::oFont )
else
::GetFont()
endif

else
#define NOVALID_CONTROLID 1
Eval( ErrorBlock(), _FWGenError( NOVALID_CONTROLID, "No: " + ;
Str( ::nId, 6 ) ) )
endif

//->Modificado Por Antonio Linares, em 20/02/2006 Para TRANSPARENT em DSAY.PRG
if ::lTransparent
::SetBrush( ::oWnd:oBrush )
else
::SetBrush( TBrush():New( "NULL" ) )
endif

return nil
João Santos - São Paulo - Brasil
Post Reply