FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Get Disabled
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Get Disabled
Posted: Sat Sep 12, 2009 09:29 PM
Hola,

como hacer p/ que lo objeto GET cuando estiver disabled lo background fique en lo fundo ?
con este codigo abaixo cuando estas disabled fica totalmente branco.

alguem pode ajudar ?

gracias.

Code (fw): Select all Collapse
#include "fivewin.ch"
function main()

 local  odlg, oget, cVar:=space(50),ogetb, cVarb:=space(50)

 define dialog odlg 

  @ 5, 10 get oGet  var cVar  of odlg pixel size 120, 10 noborder color CLR_WHITE
  @ 20, 10 get oGetb var cVarb of odlg pixel size 120, 10 noborder color CLR_WHITE 

  oGet:lTransparent = .T.
  oGetb:lTransparent = .T.

 activate dialog odlg centered on init( GradGet( Self ) )


return nil

function GradGet( _oDlg )
local oControl
local aColors :=   { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
                     { 0.6, nRGB( 24,  61, 118 ), nRGB( 50, 95, 158 ) } } 
local hBmp, n
local oBrush


  for n = 1 to Len(_oDlg:aControls)
     oControl:= _oDlg:aControls[ n ]
     if "TGET" $ oControl:ClassName()
        hBmp = GradientBmp( oControl, oControl:nWidth, oControl:nHeight, aColors )
        oBrush = TBrush():New( , , , , hBmp )
        oControl:SetBrush( oBrush )
        DeleteObject( hBmp )
     endif

  next

return Nil
Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Get Disabled
Posted: Sat Sep 12, 2009 10:25 PM

Hola Lailton. Prueba esta solución de Daniel García-Gil:

for n = 1 to Len(_oDlg:aControls)
oControl:= _oDlg:aControls[ n ]
if oControl:ClassName() == "TGET"
oControl:lTransparent:=.t.
hBmp = GradientBmp( oControl, oControl:nWidth, oControl:nHeight, aColors )
oBrush = TBrush():New()
oBrush:hBrush = CreatePatternBrush( hBmp )
oControl:SetBrush( oBrush )
DeleteObject( hBmp )
endif
next

Saludos.

Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Get Disabled
Posted: Sat Sep 12, 2009 11:13 PM

gracias pero es la mesma que a minha, somente alterado la chamada del
brush pois en mi version ( fwh902 ) era diferente, funciona perfeitamente. pero se lo Get
estiver disativado no pinta lo fundo :(

gracias.

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Get Disabled
Posted: Sun Sep 13, 2009 01:18 AM
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Get Disabled
Posted: Sun Sep 13, 2009 03:06 AM

I will try.

thanks so much

Continue the discussion