using the progressbar ... foreground color

Post your Gambas programming questions here.
Post Reply
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

using the progressbar ... foreground color

Post by grayghost4 »

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 10396 times
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: using the progressbar ... foreground color

Post by vuott »

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
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: using the progressbar ... foreground color

Post by cogier »

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 519 times
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: using the progressbar ... foreground color

Post by grayghost4 »

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: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: using the progressbar ... foreground color

Post by cogier »

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: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: using the progressbar ... foreground color

Post by grayghost4 »

The file did download .... firefox just gave me a warning that the file might be bad.
I will have a look at it .... thanks
User avatar
Technopeasant
Posts: 140
Joined: Saturday 13th July 2019 6:50pm
Location: Stony Plain, Alberta, Canada
Contact:

Re: using the progressbar ... foreground color

Post by Technopeasant »

Did you ever get a response on that bug report Cogier?
Technical director,
Piga Software
http://icculus.org/piga/
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: using the progressbar ... foreground color

Post by cogier »

Did you ever get a response on that bug report Cogier?
Nope! nothing. If you look at the mailing list in January 2019 here you will see it was ignored.
User avatar
Technopeasant
Posts: 140
Joined: Saturday 13th July 2019 6:50pm
Location: Stony Plain, Alberta, Canada
Contact:

Re: using the progressbar ... foreground color

Post by Technopeasant »

Well, trouble is I guess that they care more about matching the system theme, over customizability. I guess it is either stick to blue or write a replacement. Just is annoying to have to sidestep a readily available control over styling.
Technical director,
Piga Software
http://icculus.org/piga/
Post Reply