FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oGet:SetBrush ( daniel )
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
oGet:SetBrush ( daniel )
Posted: Sun Sep 13, 2009 09: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 ?

Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: oGet:SetBrush ( daniel )
Posted: Sun Sep 13, 2009 09:24 PM
I tryed use DrawBitmap( hDc, gBmp, 0, 0 )
it´s Work, more make hidden in Text of Get.
:-)
Code (fw): Select all Collapse
//-----------------------------------------------------------------------//
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
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: oGet:SetBrush ( daniel )
Posted: Mon Sep 14, 2009 03:06 AM

Lailton

i'm checking... i'll reply very soon

Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: oGet:SetBrush ( daniel )
Posted: Mon Sep 14, 2009 03:14 AM

Okay thanks

Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: oGet:SetBrush ( daniel )
Posted: 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 (fw): Select all Collapse
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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: oGet:SetBrush ( daniel )
Posted: Wed Sep 16, 2009 10:48 AM
Daniel,
How we can create an get effect as this ?


or
Best Regards, Saludos



Falconi Silvio
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: oGet:SetBrush ( daniel )
Posted: Wed Sep 16, 2009 03:13 PM

Hello Silvio

Now we working in Button Skins maybe is ready for this month, after will begin with GET Skins

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: oGet:SetBrush ( daniel )
Posted: Wed Sep 16, 2009 05:21 PM

good daniel !!

Best Regards, Saludos



Falconi Silvio

Continue the discussion