Possible bug with StatusBarProgress

Just starting out? Need help? Post your questions and find answers here.
Lucifer
User
User
Posts: 26
Joined: Wed Apr 30, 2003 6:11 pm
Location: UK

Possible bug with StatusBarProgress

Post by Lucifer »

I have searched the forum and can find very little posted about the StatusBarProgress command.

What I wanted to do was use the progress bar and then hide it and use the field for other info but I've come across an issue.
I can create and use the progress bar as documented in the manual but it does not have a hide command.
To get around this I just sent some text to that field and that worked fine.
The problem comes when you want to create a progress bar again.
It appears that once text has been sent to a status bar field after your first call to the progress bar you can no longer show the progress bar in that field.

I adjusted the demo to show this issue -

Code: Select all

If OpenWindow(0, 0, 0, 340, 50, "StatusBarProgress", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)
  If CreateStatusBar(0, WindowID(0))
    AddStatusBarField(120)
    AddStatusBarField(170)
  EndIf

  StatusBarText(0, 0, "ProgressBar !")
  
  ;Put text in the field that will be used for the StatusBarProgress
  StatusBarText(0, 1, "AAA")
  UpdateWindow_(WindowID(0))
  Delay(1500)
  
  ;Show the StatusBarProgress
  StatusBarProgress(0, 1, 25)
  UpdateWindow_(WindowID(0))
  Delay(1500)
  
  ;Hide the StatusBarProgress using text
  StatusBarText(0, 1, "BBB")
  UpdateWindow_(WindowID(0))
  Delay(1500)
  
  ;Show the StatusBarProgress
  StatusBarProgress(0, 1, 45)
  UpdateWindow_(WindowID(0))
  Delay(1500)
  
  ;Hide the StatusBarProgress
  StatusBarText(0, 1, "CCC")
  UpdateWindow_(WindowID(0))
  
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
You will see that the progress bar is not shown when called between "BBB" and "CCC".

Is it an issue or am I just being silly?

I'm using PureBasic v4.41 on Windows XP Pro 32 bit.


Thanks.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Possible bug with StatusBarProgress

Post by Trond »

Doesn't work with progress bar, but does work with image.

Btw. you should really update your events.

Code: Select all

CreateImage(0, 16, 16, 24)

OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
CreateStatusBar(0, WindowID(0))
AddStatusBarField(200)

AddWindowTimer(0, 0, 500)

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_Timer
      If A % 2
        Debug "progress"
        ;StatusBarProgress(0, 0, 45)
        StatusBarText(0, 0, "Text")
      Else
        StatusBarImage(0, 0, ImageID(0))
      EndIf
      A + 1
    Case #PB_Event_CloseWindow
      Break
  EndSelect
ForEver
Lucifer
User
User
Posts: 26
Joined: Wed Apr 30, 2003 6:11 pm
Location: UK

Re: Possible bug with StatusBarProgress

Post by Lucifer »

Thanks for that.

However, sorry about the sloppy code but then I did say that I modified the DEMO from the manual.

Is anyone aware of the StatusBarProgress issue or should I post it in the bug section?
Post Reply