FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Transparencia en CheckBox...
Posts: 248
Joined: Wed Jan 11, 2006 11:30 AM
Transparencia en CheckBox...
Posted: Tue Feb 03, 2009 04:21 PM
Existe alguna maneira de Usar Check's con transparencia, sem o auxilio de Bmps como Fundo ?

Apenas com la Funçao gradientfill., es possible ?

  DEFINE BRUSH oBrush
  DEFINE DIALOG oDlg RESOURCE 1001 BRUSH oBrush 
         oDlg:lTransparent:= .T.
         //oDlg:SetColor(,9425383)
        
   REDEFINE GROUP group oGrp[1] id 301 of oDlg TRANSPARENT
 
   REDEFINE RADIO oRad VAR nVal ID 4001 OF oDlg 

   REDEFINE CHECKBOX oCbx VAR lVal ID 4002 OF oDlg 

   REDEFINE SAY oSay[1] ID 401 OF oDlg COLOR CLR_RED
 
  ACTIVATE DIALOG oDlg CENTERED ;
                 ON PAINT GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, { { , nRGB( 211, 211, 211), nRGB( 55, 255, 245) } } )



Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: Transparencia en CheckBox...
Posted: Tue Feb 03, 2009 09:27 PM
Hola

Prueba de Esta manera.

REDEFINE CHECKBOX oCbx VAR lVal ID 4002 OF oDlg 
oCbx:lTransparent := .t.
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Posts: 248
Joined: Wed Jan 11, 2006 11:30 AM
Re: Transparencia en CheckBox...
Posted: Tue Feb 03, 2009 11:46 PM
Patricio Avalos Aguirre wrote:Hola

Prueba de Esta manera.

REDEFINE CHECKBOX oCbx VAR lVal ID 4002 OF oDlg 
oCbx:lTransparent := .t.


Nao funcionou , amigo.

Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Transparencia en CheckBox...
Posted: Wed Feb 04, 2009 02:10 AM
Ale,

Aqui tienes un ejemplo funcionando:
#include "FiveWin.ch"

function Main()

   local oDlg, oCbx1, lValue1 := .T., oCbx2, lValue2 := .T., oCbx3, lValue3 := .T.

   DEFINE DIALOG oDlg TITLE "Test"

   @ 1, 2 CHECKBOX oCbx1 VAR lValue1 COLOR "W+/B"
   oCbx1:lTransparent = .T. 

   @ 2, 2 CHECKBOX oCbx2 VAR lValue2 COLOR "W+/B" 
   oCbx2:lTransparent = .T. 

   @ 3, 2 CHECKBOX oCbx3 VAR lValue3 COLOR "W+/B" 
   oCbx3:lTransparent = .T. 

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT GradientBrush( oDlg, { { 0.4, nRGB( 75, 144, 223 ), nRGB( 41, 85, 145 ) },;
                                     { 0.6, nRGB( 24,  61, 118 ), nRGB( 50, 95, 158 ) } } ) 

return nil

function GradientBrush( oDlg, aColors )

   local hDC, hBmp, hBmpOld
   
   if Empty( oDlg:oBrush:hBitmap )
      hDC = CreateCompatibleDC( oDlg:GetDC() )
      hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight )
      hBmpOld = SelectObject( hDC, hBmp )
      GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors )
      oDlg:oBrush:hBitmap = hBmp
      oDlg:oBrush:hBrush = CreatePatternBrush( hBmp ) 
      SelectObject( hDC, hBmpOld )
      oDlg:ReleaseDC()
   endif   

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 248
Joined: Wed Jan 11, 2006 11:30 AM
Re: Transparencia en CheckBox...
Posted: Wed Feb 04, 2009 08:57 AM

Gracias Maestro !

Saluds, Ale

aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, você não subtrai quando divide; mas soma e multiplica."
**---Mário Persona---**

Continue the discussion