using the progressbar ... foreground color

Post Reply
User avatar
grayghost4
Posts: 27
Joined: Wednesday 05th December 2018 5:00am
Location: Concord, CA usa

using the progressbar ... foreground color

Post by grayghost4 » Sunday 13th January 2019 8:28pm

I am new at Gambas ... I have 3.12.2 and am going throught the getting started with Gambas 3.

The background color for the progressbar works fine, but the foreground will not change anything.
ForeGround color does not work from the properties box either.

I guess I am using the wrong command to set the color of the bar.
Attachments
bar color.png
bar color.png (59.78 KiB) Viewed 70 times

vuott
Posts: 20
Joined: Wednesday 05th April 2017 6:07pm

Re: using the progressbar ... foreground color

Post by vuott » Monday 14th January 2019 11:02am

Currently I would suggest something as this little example: :|
Private da As DrawingArea


Public Sub Form_Open()

  ProgressBar1.Background = Color.Lighter(Color.Green)

  da = ProgressBar1.Children[0]
 
  Object.Attach(da, Me, "DA")

End


Public Sub DA_Draw()
 
  With Paint
    .Brush = .Color(Color.Yellow)
    .Rectangle(0, 0, da.W * ProgressBar1.Value, da.H)
    .Fill
    .Brush = .Color(Color.Red)
    .DrawText(Format(ProgressBar1.Value, "0.00"), da.W / 2, da.H / 2, 0, 0, Align.Center)
    .End
  End With
  
End


Public Sub Button1_Click()
 
  Dim b As Byte

  For b = 1 To 100
    ProgressBar1.Value = b / 100
    Wait 0.1
  Next
  
End

User avatar
cogier
Site Admin
Posts: 222
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: using the progressbar ... foreground color

Post by cogier » Monday 14th January 2019 4:26pm

There does seem to be a bug here, I have reported it. I thought I could sort this by changing from gtk to qt4 but it makes no difference.

But there are many ways around this. Have a look at the attached.
Progress.tar.gz
(12.66 KiB) Downloaded 6 times

User avatar
grayghost4
Posts: 27
Joined: Wednesday 05th December 2018 5:00am
Location: Concord, CA usa

Re: using the progressbar ... foreground color

Post by grayghost4 » Monday 14th January 2019 5:06pm

EDIT.
Cogier: your file does not download properly :(
I am glad you reported the error, thanks.
Now I don't have to keep trying to make it work. ;)

Thanks to both of you for your responses.

The following was written before I saw your post.


Redrawing the progress bar is a little ahead of my learning curve :D
(I am not ready to build a watch, just need to know what time it is )
Blue will be just fine for now. :lol:
So the short answer is that the foreground color does not set the color of the progress bar.
Even though that is the instructions in John's book.
the compiler must have been changed since 2011

A Beginner’s Guide to Gambas Version 3 (this work) is copyright © 2005-2011
by John W. Rittinghouse

User avatar
cogier
Site Admin
Posts: 222
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: using the progressbar ... foreground color

Post by cogier » Monday 14th January 2019 5:24pm

Cogier: your file does not download properly :(
I am sorry you can't download the file. I just tried and it all worked perfectly?

I'll let you know what happens with the bug report.

User avatar
grayghost4
Posts: 27
Joined: Wednesday 05th December 2018 5:00am
Location: Concord, CA usa

Re: using the progressbar ... foreground color

Post by grayghost4 » Monday 14th January 2019 5:38pm

The file did download .... firefox just gave me a warning that the file might be bad.
I will have a look at it .... thanks

Post Reply