CLASSE DSAY.PRG CON COMANDO TRANSPARENT

CLASSE DSAY.PRG CON COMANDO TRANSPARENT

Postby karinha » Sat Feb 18, 2006 1:32 pm

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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby Antonio Linares » Mon Feb 20, 2006 9:58 am

João,
Code: Select all  Expand view  RUN
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  Expand view  RUN
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
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Baxajaun » Mon Feb 20, 2006 11:38 am

Antonio,

thanks a lot !!! :wink:

Saludos,

Félix
User avatar
Baxajaun
 
Posts: 968
Joined: Wed Oct 19, 2005 2:17 pm
Location: Gatika. Bizkaia

Postby karinha » Tue Feb 21, 2006 2:47 pm

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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby karinha » Tue Feb 21, 2006 2:50 pm

//-> 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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby karinha » Tue Feb 21, 2006 2:54 pm

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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 23 guests