using the progressbar ... foreground color

Post

Posted
Rating:
#1 (In Topic #213)
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
 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.

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
vuott is in the usergroup ‘Regular’
Currently I would suggest something as this little example:  :|

Code (gambas)

  1.  
  2.  
  3. Public Sub Form_Open()
  4.  
  5.   ProgressBar1.Background = Color.Lighter(Color.Green)
  6.  
  7.   da = ProgressBar1.Children[0]
  8.  
  9.   Object.Attach(da, Me, "DA")
  10.  
  11.  
  12.  
  13. Public Sub DA_Draw()
  14.  
  15.   With Paint
  16.     .Brush = .Color(Color.Yellow)
  17.     .Rectangle(0, 0, da.W * ProgressBar1.Value, da.H)
  18.     .Fill
  19.     .Brush = .Color(Color.Red)
  20.     .DrawText(Format(ProgressBar1.Value, "0.00"), da.W / 2, da.H / 2, 0, 0, Align.Center)
  21.     .End
  22.  
  23.  
  24.  
  25. Public Sub Button1_Click()
  26.  
  27.   Dim b As Byte
  28.  
  29.   For b = 1 To 100
  30.     ProgressBar1.Value = b / 100
  31.     Wait 0.1
  32.   Next
  33.  

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
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.

Attachment
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
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
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Guru
cogier is in the usergroup ‘Guru’
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.
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Enthusiast
GrayGhost is in the usergroup ‘Enthusiast’
 The file did download …. firefox just gave me a warning that the file might be bad.
I will have a look at it …. thanks
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
Did you ever get a response on that bug report Cogier?
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Guru
cogier is in the usergroup ‘Guru’
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.
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
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.
Online now: No Back to the top
1 guest and 0 members have just viewed this.