PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WinFBX Progress Bar Issue  (Read 353 times)

James Klutho

  • Senior Member
  • ***
  • Posts: 248
  • Petroleum Software Solutions
WinFBX Progress Bar Issue
« on: February 29, 2020, 08:13:45 PM »

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
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9206
  • Windows 10
    • PlanetSquires Software
Re: WinFBX Progress Bar Issue
« Reply #1 on: February 29, 2020, 09:02:13 PM »

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.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9206
  • Windows 10
    • PlanetSquires Software
Re: WinFBX Progress Bar Issue
« Reply #2 on: February 29, 2020, 09:09:16 PM »

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)
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9206
  • Windows 10
    • PlanetSquires Software
Re: WinFBX Progress Bar Issue
« Reply #3 on: February 29, 2020, 09:12:22 PM »

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

Pierre Bellisle

  • Junior Member
  • **
  • Posts: 102
Re: WinFBX Progress Bar Issue
« Reply #4 on: February 29, 2020, 10:46:14 PM »

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


Logged

Pierre Bellisle

  • Junior Member
  • **
  • Posts: 102
Re: WinFBX Progress Bar Issue
« Reply #5 on: February 29, 2020, 11:25:17 PM »

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)
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9206
  • Windows 10
    • PlanetSquires Software
Re: WinFBX Progress Bar Issue
« Reply #6 on: February 29, 2020, 11:33:49 PM »

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:
Code: [Select]
               ' // 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)
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Pierre Bellisle

  • Junior Member
  • **
  • Posts: 102
Re: WinFBX Progress Bar Issue
« Reply #7 on: February 29, 2020, 11:49:37 PM »

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....  :-)
Logged

James Klutho

  • Senior Member
  • ***
  • Posts: 248
  • Petroleum Software Solutions
Re: WinFBX Progress Bar Issue
« Reply #8 on: March 01, 2020, 12:05:20 AM »

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

Josť Roca

  • Moderator
  • Guru Member
  • *****
  • Posts: 3255
Re: WinFBX Progress Bar Issue
« Reply #9 on: March 01, 2020, 12:22:58 AM »

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