oGet:SetBrush ( daniel )

Post Reply
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

oGet:SetBrush ( daniel )

Post by lailton.webmaster »

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 )

Post by lailton.webmaster »

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

Code: Select all | Expand


//-----------------------------------------------------------------------//
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
 
User avatar
Daniel Garcia-Gil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita
Contact:

Re: oGet:SetBrush ( daniel )

Post by Daniel Garcia-Gil »

Lailton

i'm checking... i'll reply very soon
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: oGet:SetBrush ( daniel )

Post by lailton.webmaster »

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

Re: oGet:SetBrush ( daniel )

Post by Daniel Garcia-Gil »

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

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
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: oGet:SetBrush ( daniel )

Post by Silvio »

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

or
Image
Best Regards, Saludos

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

Re: oGet:SetBrush ( daniel )

Post by Daniel Garcia-Gil »

Hello Silvio

Now we working in Button Skins maybe is ready for this month, after will begin with GET Skins
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: oGet:SetBrush ( daniel )

Post by Silvio »

good daniel !!
Best Regards, Saludos

Falconi Silvio
Post Reply