Painting problem in the New Sample GradBrus.Prg

Painting problem in the New Sample GradBrus.Prg

Postby anserkk » Wed Feb 25, 2009 10:39 am

Dear Mr.Antonio,

In FWH 9.02 new sample \Fwh\Samples\GradBrus.Prg the parent window is gettnng painted with the Gradiant colours of the Dialog.
To repeat the error, Please move the Gradiant colour Dialog inside the main window. Is this a bug ?

Screen Snapshot

Image

Regards

Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Painting problem in the New Sample GradBrus.Prg

Postby Antonio Linares » Wed Feb 25, 2009 12:05 pm

Anser,

Here it is working fine on Windows 7.

Here you have the EXE, please run this one, thanks:
http://www.mediafire.com/?sharekey=414c ... 8114394287
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Painting problem in the New Sample GradBrus.Prg

Postby byte-one » Wed Feb 25, 2009 12:27 pm

Antonio, in XP and Vista are the same problem. When i leave the "brushed" dialog, the main window becomes (when resize?) also the brush. See also this topic http://forums.fivetechsupport.com/viewtopic.php?f=3&t=13333&start=60 and previously.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Painting problem in the New Sample GradBrus.Prg

Postby ukoenig » Wed Feb 25, 2009 12:55 pm

Hello,

I tested Antonio's Test-file and got a paint-effect on the main-window.
What is the difference with the new < Gradbrush > ?
I use < GradientFill > on Dialogs without any problems.

Image

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Painting problem in the New Sample GradBrus.Prg

Postby anserkk » Wed Feb 25, 2009 1:15 pm

Dear Mr.Antonio,

I am using XP Professional and the screen snapshot which I pasted above is the result of running the sample on XP Professional. I have only 1 PC running Windows 7 and I am out of office now. Shall let u know the feedback tomorrow.

Dear Uwe,

As per the new GradBus.Prg you will be able to use Transparent Checkbox and Radio controls. If I am not wrong, prior to this we had Transparency problems with Radio and Checkbox contols on a Gradiant background. They get Transparency effect only when a Gradient BMP is used as BRUSH. With Antonio's new GradBus Sample, we don't have to create BMP. May be I am wrong, just dumping what I had in my brain.
:D

Regards

Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Painting problem in the New Sample GradBrus.Prg

Postby Antonio Linares » Wed Feb 25, 2009 1:26 pm

Günther,

We have just tested our provided EXE in Vista and also works fine.

Have you tested our EXE ? thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Painting problem in the New Sample GradBrus.Prg

Postby byte-one » Wed Feb 25, 2009 1:45 pm

Antonio, yes i tested your sample exe also in Vista. When i leave the "brushed" dialog and resize the main window, the main window suddenly is brushed with the brush from the closed dialog. Please try also gets and there background!!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Painting problem in the New Sample GradBrus.Prg

Postby Antonio Linares » Wed Feb 25, 2009 2:01 pm

Ok, I found where the different behaviors are coming from:

I use a gray color for the window color, so it is not the white brush and it does not gets changed from the application. We need to review this.

Please change your window color (in Windows colors settings) to gray and you will see that then it behaves ok.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Painting problem in the New Sample GradBrus.Prg

Postby byte-one » Wed Feb 25, 2009 2:25 pm

Antonio, is the function GradientBrush() not included in FWH?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Painting problem in the New Sample GradBrus.Prg

Postby Antonio Linares » Wed Feb 25, 2009 2:29 pm

Günther,

Not yet.

Actually it is included in samples\GradBrus.prg so we can easily modify it and test it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Painting problem in the New Sample GradBrus.Prg

Postby byte-one » Wed Feb 25, 2009 2:49 pm

Antonio, i found also, after calling a dialog with Gradientbrush() this brush are used from other dialogs without Gradientbrush(). BUT ONLY, if this dialogs use the clausula ... COLOR x,y.
In your exe the "Another" - dialog not use any color. Please test the "Another" dialog with an ...COLOR clausula.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Painting problem in the New Sample GradBrus.Prg

Postby anserkk » Thu Feb 26, 2009 7:32 am

Dear Mr.Antonio,
Anser,

Here it is working fine on Windows 7.

Here you have the EXE, please run this one, thanks:
http://www.mediafire.com/?sharekey=414c ... 8114394287

I am unable to download the zip from mediafire site, till now unsuccessful. I even tried 2 different ISP's but the same result. May be a temporary problem with the mediafire site.

Regards

Anser
User avatar
anserkk
 
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Painting problem in the New Sample GradBrus.Prg

Postby Antonio Linares » Thu Feb 26, 2009 11:18 am

Anser, Günther,

In FWH\samples\GradBrus.prg please replace:

DEFINE BRUSH oBrush COLOR CLR_WHITE

with

DEFINE BRUSH oBrush COLOR CLR_CYAN

and it will work fine :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Painting problem in the New Sample GradBrus.Prg

Postby byte-one » Thu Feb 26, 2009 11:48 am

Antonio, all the sideeffects are come from the array aBrushes in TBRUSH. You are make automatically a white brush in TDIALOG. And in this brush you write with gradientbrush() hBitmap and hBrush new. On another dialog this brush is used also, if it is in aBrushes present. And now are the old hBrush and hBitmap is used. If you define an brush with another color as you say, the situation is the same on all dialogs using this brush-color.
Possible way is to check aBrushes for reusing a brush in TBRUSH! For me this codeextension is ok.

Code: Select all  Expand view  RUN
  if ( nAt := AScan( ::aBrushes, {|oBrush| oBrush:cStyle    == ::cStyle    .and. ;
                                            oBrush:nRGBColor == ::nRGBColor .and. ;
                                            oBrush:cBmpFile  == ::cBmpFile  .and. ;
                                            oBrush:cBmpRes   == ::cBmpRes } ) ) > 0

    if !empty(::aBrushes[ nAt ]:hBitmap) .and. ( empty(::aBrushes[ nAt ]:cBmpFile) .and. empty(::aBrushes[ nAt ]:cBmpRes) )
             ::aBrushes[ nAt ]:end()
    else
          #ifndef __XPP__
             Self := ::aBrushes[ nAt ] // This is not permited with XBase++
             ::nCount++
             return Self
          #else
             ::aBrushes[ nAt ]:nCount++
             return ::aBrushes[ nAt ]
          #endif
    endif
   
   endif
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Painting problem in the New Sample GradBrus.Prg

Postby Antonio Linares » Thu Feb 26, 2009 1:13 pm

Günther,

Brushes objects are reused in FWH to reduce the consume of GDI memory. If we have a white brush and we change its hBrush then all objects that use that white brush, will have it changed.

Thats why if you select a non used brush color, like cyan, and change its hBrush, it will not affect to other objects brushes, unless they use a cyan brush also.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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