Get Disabled

Get Disabled

Postby lailton.webmaster » Sat Sep 12, 2009 9: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: Select all  Expand view  RUN
#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
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Get Disabled

Postby FranciscoA » 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
User avatar
FranciscoA
 
Posts: 2159
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: Get Disabled

Postby lailton.webmaster » 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.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Get Disabled

Postby Daniel Garcia-Gil » Sun Sep 13, 2009 1:18 am

User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Get Disabled

Postby lailton.webmaster » Sun Sep 13, 2009 3:06 am

I will try.

thanks so much
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 19 guests