1. Redraw Issue

If you open up Microsoft Word, or any other commercial app, in MS Windows,
then resize the window, you don't get a lot of flicker in the button bar (or
even client) area.

If you open up a EUPHORIA Windows app- for instance, Bernie's TBAR.EXW
sample from his w32engin- the buttons flicker like crazy!

Bernie, what's your take on this? Can this be fixed? I'd prefer my buttons
not flicker, like commercial Windows apps.

Thanks!
JustCurious

new topic     » topic index » view message » categorize

2. Re: Redraw Issue

I think it must be that the EUPHORIA apps are erasing everything THEN
redrawing, instead of just drawing on top... Just my idea, but I want to
know the truth. I can han'le. it.

-ck

----- Original Message -----
From: <cklester at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: Redraw Issue


>
> If you open up Microsoft Word, or any other commercial app, in MS Windows,
> then resize the window, you don't get a lot of flicker in the button bar
(or
> even client) area.
>
> If you open up a EUPHORIA Windows app- for instance, Bernie's TBAR.EXW
> sample from his w32engin- the buttons flicker like crazy!
>
> Bernie, what's your take on this? Can this be fixed? I'd prefer my buttons
> not flicker, like commercial Windows apps.
>
> Thanks!
> JustCurious
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: Redraw Issue

Bernie Ryan wrote:

>
> cklester at yahoo.com wrote:
> > Let me clarify: The flicker occurs when you RESIZE the window. Drag the
> > bottom right handle around and report your results.
> >
>
> ck:
>   If I grab the bottom right corner and resize the window, the
>   buttons do not flicker in any way.
>
>   You have a bad videocard or a out of date video driver
>   I have seen bad videocards that cause dots to appear on a control
>   when a mouse is moved around on the screen and many other weird
>   problems. Try changing your videocard to different number of
>   colors and resolution. I've seen many problems with videocards
>   bad drivers, bad video memory, bad video bios, etc.
>
>    The monitor is a outside possibility.
> Bernie
>
>

You cant blame hardware when it works fine for other apps on the
system..........<does this system have this problem constant with
other apps?> if your answer is no then the code for the app
is substandard.

I think this is common on machine with little processor left,
things like firewalls, virus scanners and networks like IIs
use alot of threads and take a mighty processor to allow
other apps the time for things like redraws and such especially when
your code isnt built for speed..

my theory is to double buffer images and hold the amounts of
controls to a minimum on one client at a time..createing
multiple dialog boxs are important for user interaction that allow
clean, fast, smooth operation...

Comments:?

Euman

new topic     » goto parent     » topic index » view message » categorize

4. Re: Redraw Issue

euman at bellsouth.net wrote:

>
> Bernie Ryan wrote:
>
> >
> > cklester at yahoo.com wrote:
> > > Let me clarify: The flicker occurs when you RESIZE the window. Drag the
> > > bottom right handle around and report your results.
> > >
> >
> > ck:
> >   If I grab the bottom right corner and resize the window, the
> >   buttons do not flicker in any way.
> >
> >   You have a bad videocard or a out of date video driver
> >   I have seen bad videocards that cause dots to appear on a control
> >   when a mouse is moved around on the screen and many other weird
> >   problems. Try changing your videocard to different number of
> >   colors and resolution. I've seen many problems with videocards
> >   bad drivers, bad video memory, bad video bios, etc.
> >
> >    The monitor is a outside possibility.
> > Bernie
> >
> >
>
> You cant blame hardware when it works fine for other apps on the
> system..........<does this system have this problem constant with
> other apps?> if your answer is no then the code for the app
> is substandard.
>
> I think this is common on machine with little processor left,
> things like firewalls, virus scanners and networks like IIs
> use alot of threads and take a mighty processor to allow
> other apps the time for things like redraws and such especially when
> your code isnt built for speed..
>
> my theory is to double buffer images and hold the amounts of
> controls to a minimum on one client at a time..createing
> multiple dialog boxs are important for user interaction that allow
> clean, fast, smooth operation...
>
> Comments:?
>
> Euman
>
>

ck,

did the window example I sent you flicker when you held down the left mouse
and moved the window on this machine?

this window is nother more than 4 large bitmaps double buffered and, all
bitblt to the screen at once, at a very high rate of speed.

reference: coolwin.zip

Euman

new topic     » goto parent     » topic index » view message » categorize

5. Re: Redraw Issue

Hi,
----- Original Message -----
From: <cklester at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: Redraw Issue


>
> If you open up Microsoft Word, or any other commercial app, in MS Windows,
> then resize the window, you don't get a lot of flicker in the button bar
(or
> even client) area.
>
> If you open up a EUPHORIA Windows app- for instance, Bernie's TBAR.EXW
> sample from his w32engin- the buttons flicker like crazy!
>
> Bernie, what's your take on this? Can this be fixed? I'd prefer my buttons
> not flicker, like commercial Windows apps.

The TBAR.EXW program flickers when the window is resized. The effect is
quite pronounced. I'm using a Intel P3 550mHz with 256RAM, nVidia TNT2 Vanta
video card, and Windows ME.

I replaced the line ...

       OR({CS_HREDRAW,CS_VREDRAW}), -- style

with
                                 0, -- style

and the flicker disappeared. Except that when resizing horizontally, the
toolbar's border still flickers.

----
Derek.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Redraw Issue

All one has to do is avoid using CS_HREDRAW and CS_VREDRAW style flags when
creating a window.

For those of us using Win32Lib.ew, you will find the line ...

    vWindowClassStyle = {CS_HREDRAW, CS_VREDRAW }

replace this with ...

    vWindowClassStyle = {0}

and the flickering disappears.

If you want the double clicks to register for a Window you can use ...

    vWindowClassStyle = {CS_DBLCLKS}

Does this answer your concerns?

Future versions of Win32Lib will not have these as default.

----
Derek.

----- Original Message -----
From: <cklester at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Sent: Saturday, August 04, 2001 2:40 PM
Subject: RE: Redraw Issue


>
> > The TBAR.EXW program flickers when the window is resized. The effect is
> > quite pronounced. I'm using a Intel P3 550mHz with 256RAM, nVidia
> > TNT2 Vanta
> > video card, and Windows ME.
> >
> > I replaced the line ...
> >
> >        OR({CS_HREDRAW,CS_VREDRAW}), -- style
> >
> > with
> >                                  0, -- style
> >
> > and the flicker disappeared. Except that when resizing horizontally, the
> > toolbar's border still flickers.
>
> It's not just Bernie's program, either. Mike's editor flickers, and most
> every other EUPHORIA for Windows program I've seen flickers. All the
> Win32Lib examples flicker a LITTLE bit, but that's just because there are
> only a very few items in the client area. (Is this the right use of
> "client," to mean whatever is within the window's borders?)
>
> But, when I resize this Outlook mail compose window, it doesn't flicker at
> all.
>
> Weird!!!
>
> I'm sure it's something simple and once we- I mean you guys- figure it
out,
> we'll not have flickering windows anymore. :)
>
> -ck
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

7. Re: Redraw Issue

I can't claim credit for this one as it was suggested by Martin Stachon.
Thanks Martin.

----- Original Message -----
From: <cklester at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Redraw Issue


>
> > All one has to do is avoid using CS_HREDRAW and CS_VREDRAW style
> > flags when
> > creating a window.
> >
> > Does this answer your concerns?
> >
> > Future versions of Win32Lib will not have these as default.
> >
> > ----
> > Derek.
>
> Derek, thanks so much! I knew one of you gurus would get it.
>
> I like the fact that it's so hard to stump this list... No, I'd say
> impossible! :)
>
> <\<
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: Redraw Issue

Hi Euman,

> >   You have a bad videocard or a out of date video driver
> >   I have seen bad videocards that cause dots to appear on a control
> >   when a mouse is moved around on the screen and many other weird
> >   problems. Try changing your videocard to different number of
> >   colors and resolution. I've seen many problems with videocards
> >   bad drivers, bad video memory, bad video bios, etc.
> >
> >    The monitor is a outside possibility.
> > Bernie
> >
> >
> 
> You cant blame hardware when it works fine for other apps on the
> system..........<does this system have this problem constant with
> other apps?> if your answer is no then the code for the app
> is substandard.
> 
> I think this is common on machine with little processor left,
> things like firewalls, virus scanners and networks like IIs
> use alot of threads and take a mighty processor to allow
> other apps the time for things like redraws and such especially when
> your code isnt built for speed..
> 
> my theory is to double buffer images and hold the amounts of
> controls to a minimum on one client at a time..createing
> multiple dialog boxs are important for user interaction that allow
> clean, fast, smooth operation...
> 
> Comments:?
> 
> Euman
> 

There is no bad *hardware* in the World at all.
Hardware is the user's private property and
our software just 'leases' user's property.

Remember and remember again --
the native hardware for Windows 95
is 386 with 8M(4 minimum) RAM and HD
about 200-400M.

So, if our *Win32* program doesn't want run
on such the machine, we must say  ---
"ONLY for 486+Win98 and up"
"ONLY for 586+Win2000 and up"     ---
just to avoid any questions on a matter
of restrictions.

If we say Win32 - this is 386+, just as
*EXW.EXE* - EUPHORIA's Win32 platform
without *ANY* restrictions on the *latest*
hardware.

My 386-25Mhz runs rotozoom.ex (by Mic) at 7 f/s
when Mic's PII-450Mhz runs it at 70 f/s,
and I can try and use really good and useful
*Win32* software on my old good 386 without
any problems.

One my old friend uses 286-20Mhz 40M HD
and Rob Zale's great TurboBasic for scientific 
tasks about 15 years and doesn't want ever hear 
about professional looking Win & Co. I have TV
to see the best quality animated cartoons,
he says. :)

Just my point of view on hardware,
sorry Bernie.

Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view message » categorize

9. Re: Redraw Issue

Hi Bernie,

----- Original Message -----
From: "Bernie Ryan" <xotron at localnet.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Redraw Issue
>
> Derek Parnell wrote:
> > The TBAR.EXW program flickers when the window is resized. The effect is
> > quite pronounced. I'm using a Intel P3 550mHz with 256RAM, nVidia TNT2
> > Vanta
> > video card, and Windows ME.
> >
> > I replaced the line ...
> >
> >        OR({CS_HREDRAW,CS_VREDRAW}), -- style
> >
> > with
> >                                  0, -- style
> >
> > and the flicker disappeared. Except that when resizing horizontally, the
> > toolbar's border still flickers.
>
>   Derek:
>
>   You should not need to change the style.

Why not? What goes wrong if I don't use the CS_xREDRAW styles? What goes
right if I do use them? In other words, how have I done the wrong thing?

>   If you are using a TNT2 Vanta 16 megs or less be sure that
>   your motherboard bios AGP setting is set for 2X NOT 4X or automatic.

I have an Award BIOS and it doesn't have such an option. Am I stuffed? Do I
have to go and upgrade to a more appropriate motherboard? Or maybe I should
change my video card? Or maybe seek out a better video driver? Nah - I'll
just avoid the two styles for now - its cheaper and easier and seems to work
just fine.

It seems to me that the problem stems from having the redraw event happen so
frequently that there is a noticiable lag between the pixels being set to
the COLOR_WINDOW color and then having the controls redrawn. In slower
machines and video driver/cards this leads to a flicker. Why do I have to
have the window repainted so frequently? If I *must* use these styles it
seems that I have to upgrade the hardware and/or drivers. This doesn't seem
a great idea to me.

>   Some manufactors when they decided to go to AGP from PCI video
>   cards took their PCI cards and they just moved them to the AGP
>   buss without redesigning the card, so some video cards are not
>   really AGP cards and can have driver problems.
>
>   ME has alot of driver issues so be sure that you are using the
>   correct driver and that a driver is a bug free driver.

Never had an issue yet in 11 months of use. I must be doing something wrong.

>   I'am using a S3 Savage4 AGP 2x with 16 megs of memory
>   running at 800x600 32bits at 85hz
>   with a memory clock 125mhz with a core clock 110hz
>   with a K6-2 at 500mhz 128megs of memory.
>
>   PS: An for some users that don't seem to think I know what
>   I'am talking about, I have been working with computers for
>   46 years probably before some of you were even born.

So those rumours ARE true. blink
----
cheers,
Derek.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Redraw Issue

Bernie writes:
> Derek Parnell wrote:
> > The TBAR.EXW program flickers when the window is resized. The effect is
> > quite pronounced. I'm using a Intel P3 550mHz with 256RAM, nVidia TNT2
> > Vanta
> > video card, and Windows ME.
> >
> > I replaced the line ...
> >
> >        OR({CS_HREDRAW,CS_VREDRAW}), -- style
> >
> > with
> >                                  0, -- style
> >
> > and the flicker disappeared. Except that when resizing horizontally, the
> > toolbar's border still flickers.
>
>   Derek:
>
>   You should not need to change the style.
>
>   If you are using a TNT2 Vanta 16 megs or less be sure that
>   your motherboard bios AGP setting is set for 2X NOT 4X or automatic.
>
>   Some manufactors when they decided to go to AGP from PCI video
>   cards took their PCI cards and they just moved them to the AGP
>   buss without redesigning the card, so some video cards are not
>   really AGP cards and can have driver problems.
>
>   ME has alot of driver issues so be sure that you are using the
>   correct driver and that a driver is a bug free driver.
>
>   I'am using a S3 Savage4 AGP 2x with 16 megs of memory
>   running at 800x600 32bits at 85hz
>   with a memory clock 125mhz with a core clock 110hz
>   with a K6-2 at 500mhz 128megs of memory.
>
>   PS: An for some users that don't seem to think I know what
>   I'am talking about, I have been working with computers for
>   46 years probably before some of you were even born.
>
> Bernie

MS docs says :

For some windows, any change to the size of the window invalidates the
contents. For example, a clock application that adapts the face of the clock
to fit neatly within its window must redraw the clock whenever the window
changes size. To force Windows to invalidate the entire client area of the
window when a vertical, horizontal, or both vertical and horizontal change
is made, an application must specify the CS_VREDRAW or CS_HREDRAW style, or
both, when registering the window class. Any window belonging to a window
class having these styles is invalidated each time the user or the
application changes the size of the window.

Martin

new topic     » goto parent     » topic index » view message » categorize

11. Re: Redraw Issue

Here is some code I personally use for window resize.
It's rather quick to see that InvalidateRect would 
force a repaint of the entire Window.

Possibly (not haveing looked first) that the library
you use to handle this is forceing more than one 
InvalidateRect or haveing a Paint event tied closely
to this....

When I use the routine (below) to resize windows, even on a
somewhat slow 233mhz machine, I experience 0 (zero)
flicker........tested with 20+ controls in the client as well....

</snip>


    elsif iMsg = WM_SIZE then
     
          inc = HIWORD(lParam)-peek4s(rect_Bottom)
          if inc > 0 and orgY >= vyScreen-peek4s(rect_Bottom) then 
             orgY -= inc
          end if

          if orgY < 0 then 
             orgY = 0
          end if

          inc = LOWORD(lParam)-peek4s(rect_Right)
          if inc > 0 and orgX >= vxScreen-peek4s(rect_Right) then 
             orgX -= inc
          end if

          if orgX < 0 then 
             orgX = 0
          end if
      
          c_proc(GetClientRect, {hwnd,rect})

          poke4(sifMask,or_bits(SIF_RANGE, SIF_POS))
          poke4(sifMin, 0)
          
          poke4(sifMax,vxScreen-peek4s(rect_Right))
          poke4(sifPos,orgX)
          ok = c_func(xSetScrollInfo,{hwnd, SB_HORZ, si, 1})  
                
          poke4(sifMax,vyScreen-peek4s(rect_Bottom))
          poke4(sifPos,orgY)
          ok = c_func(xSetScrollInfo,{hwnd, SB_VERT, si, 1})
          
          return c_func(xInvalidateRect, {hwnd, NULL, 0})

<snip/>

ck, your answer about the window being smooth in the demo I
sent you answers my question about your hardware. There is nothing
wrong with it.....Its must be your code or the library you are useing!

Euman
euman at bellsouth.net

new topic     » goto parent     » topic index » view message » categorize

12. Re: Redraw Issue

>  I'am sorry but I don't understand what that has to do with the
>  toolbar ?
>  I don't think the toolbar is part of the client area.
> 
> 
> Bernie
> 
> 

ck also said that buttons and other controls were acting up
as well, didnt he?

either way, I think you have a fine library, but it's just 
another win32lib as far as im concerned. 

What the hell is all that shrouding for....?
if you want people to use it, release the code so tweaks
can be made.

new topic     » goto parent     » topic index » view message » categorize

13. Re: Redraw Issue

Hi,

----- Original Message -----
From: <euman at bellsouth.net>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Redraw Issue


>
> Here is some code I personally use for window resize.
> It's rather quick to see that InvalidateRect would
> force a repaint of the entire Window.
>
> Possibly (not haveing looked first) that the library
> you use to handle this is forceing more than one
> InvalidateRect or haveing a Paint event tied closely
> to this....
>
> When I use the routine (below) to resize windows, even on a
> somewhat slow 233mhz machine, I experience 0 (zero)
> flicker........tested with 20+ controls in the client as well....

[SNIP]

The issue is not with resizing per se, it is about the use of the CS_HREDRAW
and CS_VREDRAW window styles. Simply put, if one uses these styles a flicker
effect is introduced, if you don't use them there is no flickering. The
flickering is noticed during a resize but ONLY if these styles are used.

It appears that, when using these styles, Windows first sets all the pixels
to COLOR_WINDOW and displays your "updated" window, then issues the WM_SIZE
message. If you don't use these styles, the app still gets a WM_SIZE message
but Windows hasn't wiped your window first.

With the sample code you supplied, does that apps that use this code also
have the CS_xREDRAW styles or not? This seems to be the key to it.

> ck, your answer about the window being smooth in the demo I
> sent you answers my question about your hardware. There is nothing
> wrong with it.....Its must be your code or the library you are useing!
>

The Win32Lib library doesn't do anything with the WM_SIZE or WM_PAINT
messages, except call an app defined handler if one was set. Oh, an
WM_RESIZE also automatically resizes any toolbar or statusbar if they were
created. Should the library be doing something? In other words, is there
some activity that every app should be doing when they receive a WM_SIZE
message?

----
Derek.

new topic     » goto parent     » topic index » view message » categorize

14. Re: Redraw Issue

----- Original Message -----
From: "Bernie Ryan" <xotron at localnet.com>
To: "EUforum" <EUforum at topica.com>
Subject: RE: Redraw Issue


[SNIP]

>  I'am sorry but I don't understand what that has to do with the
>  toolbar ?
>  I don't think the toolbar is part of the client area.

I don't think that, from the point of view of Windows, a toolbar is a part
of the client area. I think that Windows only regards the window borders and
the title bar as the non-client area. Everything else is under the direct
control of the client (app).
-----
Derek.

new topic     » goto parent     » topic index » view message » categorize

15. Re: Redraw Issue

> 
> [SNIP]
> 
> >  I'am sorry but I don't understand what that has to do with the
> >  toolbar ?
> >  I don't think the toolbar is part of the client area.
> 
> I don't think that, from the point of view of Windows, a toolbar is a part
> of the client area. I think that Windows only regards the window borders and
> the title bar as the non-client area. Everything else is under the direct
> control of the client (app).
> -----
> Derek.

I agree with Derek......

Bernie this is the significant part of WM_SIZE I sent earlier.

if you were to pass a flag from WM_SIZE saying we are resizeing 
and once the user is no longer resizeing the window thru timers or
WM_LBUTTONUP then InvalidateRect the window only
ONCE..... this would update the controls and coords for the window includeing
the toolbar....eliminateing the flicker...
instead of everytime thru the iMsg = WM_SIZE.

          inc = HIWORD(lParam)-peek4s(rect_Bottom)
          if inc > 0 and orgY >= vyScreen-peek4s(rect_Bottom) then 
             orgY -= inc
          end if

          if orgY < 0 then 
             orgY = 0
          end if

          inc = LOWORD(lParam)-peek4s(rect_Right)
          if inc > 0 and orgX >= vxScreen-peek4s(rect_Right) then 
             orgX -= inc
          end if

          if orgX < 0 then 
             orgX = 0
          end if
      
          c_proc(GetClientRect, {hwnd,rect})

should be easy enough!

new topic     » goto parent     » topic index » view message » categorize

16. Re: Redraw Issue

Bernie writes:
> Derek Parnell wrote:
>
> > It seems to me that the problem stems from having the redraw event
> > happen so
> > frequently that there is a noticiable lag between the pixels being set
> > to
> > the COLOR_WINDOW color and then having the controls redrawn. In slower
> > machines and video driver/cards this leads to a flicker. Why do I have
> > to
> > have the window repainted so frequently? If I *must* use these styles it
>
> Derek:
>   I tried the toolbar.exw in the win32lib and I don't see any
>   jitter or sparkle.
>   I only see a normal repaint when the left mouse button is released
>   and that only happens once.
>   I tried my tbar.exw on another system that has a award bios
>   but it has a VGA card and it seems to have no problem.
>
>   Maybe I don't understand what the users are complaining about.

You have turned off option "Show window content during move".
(or how it is called in English version)


Reagrds,
    Martin

new topic     » goto parent     » topic index » view message » categorize

17. Re: Redraw Issue

Martin is referring to the option found under ...

Control Panel --> Display --> Effects -->"Show Window contents while
dragging"

I have this turned on in my system. When I turn it off, the window only gets
repainted when the mouse button is released. This just akes the flicker hard
to see since it only happens once per resize. When the option is turned on,
the repaint occurs *twice* for each column or row of pixels exposed or
hidden (using CS_xREDRAW styles).

----- Original Message -----
From: <martin.stachon at worldonline.cz>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, August 05, 2001 7:26 PM
Subject: Re: Redraw Issue


>
> Bernie writes:
> > Derek Parnell wrote:
> >
> > > It seems to me that the problem stems from having the redraw event
> > > happen so
> > > frequently that there is a noticiable lag between the pixels being set
> > > to
> > > the COLOR_WINDOW color and then having the controls redrawn. In slower
> > > machines and video driver/cards this leads to a flicker. Why do I have
> > > to
> > > have the window repainted so frequently? If I *must* use these styles
it
> >
> > Derek:
> >   I tried the toolbar.exw in the win32lib and I don't see any
> >   jitter or sparkle.
> >   I only see a normal repaint when the left mouse button is released
> >   and that only happens once.
> >   I tried my tbar.exw on another system that has a award bios
> >   but it has a VGA card and it seems to have no problem.
> >
> >   Maybe I don't understand what the users are complaining about.
>
> You have turned off option "Show window content during move".
> (or how it is called in English version)
>
>
> Reagrds,
>     Martin
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu