oGet:SetBrush ( daniel )

oGet:SetBrush ( daniel )

Postby lailton.webmaster » Sun Sep 13, 2009 9:22 pm

Why when i SetBrush to a GET all other receive same brush ?

i want use setbrush distinct the get´s.

someone can help ?
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: oGet:SetBrush ( daniel )

Postby lailton.webmaster » Sun Sep 13, 2009 9:24 pm

I tryed use DrawBitmap( hDc, gBmp, 0, 0 )
it´s Work, more make hidden in Text of Get.
:cry:
Code: Select all  Expand view

//-----------------------------------------------------------------------//
function filldis( hDC, oGet)
local gBmp
if .not. oGet:lActive //.or. oGet:lReadOnly
      gBmp:= GradientBmp( oGet, oGet:nWidth, oGet:nHeight, {{0.50, nrgb(255,208,202), nrgb(255,161,149)},{0.50, nrgb(252,75,70  ), nrgb(247,174,157)}} )
      DrawBitmap( hDc, gBmp, 0, 0 )
      //DrawMasked( hDc, hPen, 0, 0 ) too no work
/*
 i tryed too create xBrush inside this function and SEtBush(xBrush) for oGET more
 when make this, all get stay red. :( i want only get disabled...
*/

 
endif
return nil
 
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: oGet:SetBrush ( daniel )

Postby Daniel Garcia-Gil » Mon Sep 14, 2009 3:06 am

Lailton

i'm checking... i'll reply very soon
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: oGet:SetBrush ( daniel )

Postby lailton.webmaster » Mon Sep 14, 2009 3:14 am

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

Re: oGet:SetBrush ( daniel )

Postby Daniel Garcia-Gil » Mon Sep 14, 2009 10:19 am

Lailton...

Brush Class before create a new brush verifies that new brush not same other.
check: style, color, Bmp File or Bmp Res, but in our samples we not use these, so the brush class "think" is same brush each time
we can use a little trick to solve it...


Code: Select all  Expand view
function GradGet( _oDlg )
local oControl
local aColors := ARRAY( 3 )
local hBmp, n
local oBrush

aColors [ 1 ] = { { 0.4, nRGB( 231, 240, 244 ), nRGB( 159, 212, 240 ) },;
                  { 0.6, nRGB( 126, 188, 224 ), nRGB( 188, 227, 244 ) } }

aColors [ 2 ] = { { 0.4, nRGB( 255, 253, 219 ), nRGB( 255, 231, 144 ) },;
                  { 0.6, nRGB( 255, 215,  76 ), nRGB( 255, 231, 153 ) } }


  for n = 1 to Len(_oDlg:aControls)
     oControl:= _oDlg:aControls[ n ]
     if oControl:ClassName() == "TGET"
        oControl:lTransparent = .T.
        oControl:nTxtStyle = 4
        hBmp = GradientBmp( oControl,;
                            oControl:nWidth,;
                            oControl:nHeight,;
                            aColors[ If( n%2 == 0, 1, 2 ) ] )
        oBrush = TBrush():New( , n )
        oBrush:hBrush = CreatePatternBrush( hBmp )
        oControl:SetBrush( oBrush )
        DeleteObject( hBmp )
     endif

  next

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

Re: oGet:SetBrush ( daniel )

Postby Silvio » Wed Sep 16, 2009 10:48 am

Daniel,
How we can create an get effect as this ?
Image

or
Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: oGet:SetBrush ( daniel )

Postby Daniel Garcia-Gil » Wed Sep 16, 2009 3:13 pm

Hello Silvio

Now we working in Button Skins maybe is ready for this month, after will begin with GET Skins
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: oGet:SetBrush ( daniel )

Postby Silvio » Wed Sep 16, 2009 5:21 pm

good daniel !!
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 100 guests