Page 1 of 1

using the progressbar ... foreground color

Posted: Sunday 13th January 2019 8:28pm
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.

Re: using the progressbar ... foreground color

Posted: Monday 14th January 2019 11:02am
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

Re: using the progressbar ... foreground color

Posted: Monday 14th January 2019 4:26pm
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 543 times

Re: using the progressbar ... foreground color

Posted: Monday 14th January 2019 5:06pm
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

Re: using the progressbar ... foreground color

Posted: Monday 14th January 2019 5:24pm
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.

Re: using the progressbar ... foreground color

Posted: Monday 14th January 2019 5:38pm
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

Re: using the progressbar ... foreground color

Posted: Saturday 14th December 2019 9:28pm
by Technopeasant
Did you ever get a response on that bug report Cogier?

Re: using the progressbar ... foreground color

Posted: Sunday 15th December 2019 1:01pm
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.

Re: using the progressbar ... foreground color

Posted: Monday 23rd December 2019 12:22am
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.