Painting problem in the New Sample GradBrus.Prg

User avatar
anserkk
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India
Has thanked: 2 times

Painting problem in the New Sample GradBrus.Prg

Post by anserkk »

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
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 76 times
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by Antonio Linares »

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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by byte-one »

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
ukoenig
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by ukoenig »

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
anserkk
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India
Has thanked: 2 times

Re: Painting problem in the New Sample GradBrus.Prg

Post by anserkk »

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
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 76 times
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by Antonio Linares »

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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by byte-one »

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
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 76 times
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by Antonio Linares »

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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by byte-one »

Antonio, is the function GradientBrush() not included in FWH?
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 76 times
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by Antonio Linares »

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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by byte-one »

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
anserkk
Posts: 1333
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India
Has thanked: 2 times

Re: Painting problem in the New Sample GradBrus.Prg

Post by anserkk »

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
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 76 times
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by Antonio Linares »

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
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by byte-one »

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

  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
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 76 times
Contact:

Re: Painting problem in the New Sample GradBrus.Prg

Post by Antonio Linares »

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
Post Reply