FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour CLASSE DSAY.PRG CON COMANDO TRANSPARENT
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
CLASSE DSAY.PRG CON COMANDO TRANSPARENT
Posted: Sat Feb 18, 2006 01: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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
CLASSE DSAY.PRG CON COMANDO TRANSPARENT
Posted: Mon Feb 20, 2006 09:58 AM
João,
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:
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
Posts: 990
Joined: Wed Oct 19, 2005 02:17 PM
CLASSE DSAY.PRG CON COMANDO TRANSPARENT
Posted: Mon Feb 20, 2006 11:38 AM

Antonio,

thanks a lot !!! :wink:

Saludos,

Félix

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
CLASSE DSAY.PRG CON COMANDO TRANSPARENT
Posted: Tue Feb 21, 2006 02: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
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
CLASSE DSAY.PRG CON COMANDO TRANSPARENT
Posted: Tue Feb 21, 2006 02: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
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
CLASSE DSAY.PRG CON COMANDO TRANSPARENT
Posted: Tue Feb 21, 2006 02: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

Continue the discussion