• Welcome to PlanetSquires Forums.
 

WinFBX Progress Bar Issue

Started by James Klutho, February 29, 2020, 08:13:45 PM

Previous topic - Next topic

James Klutho

The progress bar has a bug in it.  The statusbar sample in this forum runs fine as a stand alone file.  It displays a series of blue boxes and sweeps the length of the status bar partition.  When I include the manifest used to build WinFBE, the progress bar color changes to green and sweeps only about half the length of the status bar partition.  I have been building a project with the WinFBX and really like it so far.  Thanks Jose

Paul Squires

I just created a project and added Jose's sample StatusBar + ProgressBar sample code to it (I also included a manifest).

I can confirm that I notice the same behaviour that you are describing.

I'll see if I can spot the problem area and then report back here.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Seems to be some type of visual issue because if you comment out the following line you will see that the progress bar actually does fill up the entire area. Interesting.

Comment this line...

               ' // Clears the bar by reseting its position to 0
               ProgressBar_SetPos(hProgressBar, 0)
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Increasing the SLEEP from 10 to SLEEP 100 also makes the progress bar show more of its bar before it resets back to zero.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Pierre Bellisle

With common control 6 via manifest, a progressbar use a quite different visual style.
Colors can be only PBST_NORMAL for green, PBST_PAUSED for yellow, and PBST_ERROR for red.

There was a discussion on what seems to be your problem on the PowerBASIC forum.
See...

Green stops before filling the bar. A theemed green progress bar have no delay when going backward.
How do I make TProgressBar stop lagging?
Changing a progress bar color
How to do a "Marquee" style progress bar



Pierre Bellisle

Confirmation. I did compile the example with a manifest/rc file.
All is OK with yellow...

PBM_SETSTATE = WM_USER + 16
PBST_NORMAL = green = 1, PBST_ERROR = red = 2, PBST_PAUSED = yellow = 3.
SendMessageW(hProgressBar, PBM_SETSTATE, PBST_PAUSED, 0)

Paul Squires

Thanks Pierre, looks like you solved the problem. Weird that the control has to be hacked like that in order to work.

Here is the new code needed for Jose's example:

               ' // Draws the bar
               FOR i AS LONG = 1 TO 100
                  ' // Advances the current position for a progress bar by the step
                  ' // increment and redraws the bar to reflect the new position
                  'ProgressBar_StepIt(hProgressBar)
                  ProgressBar_SetPos(hProgressBar, i + 1)
                  ProgressBar_SetPos(hProgressBar, i)
                  Sleep 20
               NEXT
               ' // Clears the bar by reseting its position to 0
               ProgressBar_SetPos(hProgressBar, 0)
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Pierre Bellisle

Seems that Microsoft use this way beginning with Windows Vista.
The idea was to make a real smooth progress bar that won't yank,
so they inserted delays only in the PBST_NORMAL forward green color.
This delay, sadly have some side effect if the progress goes just a little fast.
Not to say that only 3 colors are available and are associated with normal, paused, and error.
I guess we will have to live with it....  :-)

James Klutho

Thanks Pierre and Paul.  I always learn something new when you guys are involved.  The world is right again.

José Roca

Thanks, guys. I have updated the template in GitHub.