Color of wxGauge in wxProgressDialog

275 views
Skip to first unread message

Kenneth Porter

unread,
May 18, 2011, 12:23:25 PM5/18/11
to wx-u...@googlegroups.com
I'm digging around in the progress dialog code and don't see an obvious way
to affect the color of the bar in the gauge used in the dialog. Am I
missing something?

It seems I could walk the window tree under the dialog and find the gauge
with a dynamic cast, then issue wxGauge::SetForegroundColour. Is there
something easier?

Vadim Zeitlin

unread,
May 18, 2011, 7:20:23 PM5/18/11
to wx-u...@googlegroups.com
On Wed, 18 May 2011 09:23:25 -0700 Kenneth Porter <sh...@sewingwitch.com> wrote:

KP> I'm digging around in the progress dialog code and don't see an obvious way
KP> to affect the color of the bar in the gauge used in the dialog. Am I
KP> missing something?

No, at least under Windows the colour of the gauge can't be changed at all
anyhow, just try doing it in the gauge page of the widgets sample.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Kenneth Porter

unread,
May 20, 2011, 12:43:59 PM5/20/11
to wx-u...@googlegroups.com
--On Thursday, May 19, 2011 2:20 AM +0200 Vadim Zeitlin
<va...@wxwidgets.org> wrote:

> No, at least under Windows the colour of the gauge can't be changed at
> all anyhow, just try doing it in the gauge page of the widgets sample.

I experimentally found that I could change the blue bar to red. I searched
the window tree of the dialog to find the gauge and set its foreground
color to red. This is on XP with the latest updates.

Vadim Zeitlin

unread,
May 20, 2011, 12:46:13 PM5/20/11
to wx-u...@googlegroups.com
On Fri, 20 May 2011 09:43:59 -0700 Kenneth Porter <sh...@sewingwitch.com> wrote:

KP> --On Thursday, May 19, 2011 2:20 AM +0200 Vadim Zeitlin
KP> <va...@wxwidgets.org> wrote:
KP>
KP> > No, at least under Windows the colour of the gauge can't be changed at
KP> > all anyhow, just try doing it in the gauge page of the widgets sample.
KP>
KP> I experimentally found that I could change the blue bar to red. I searched
KP> the window tree of the dialog to find the gauge and set its foreground
KP> color to red. This is on XP with the latest updates.

Do you use themes or classic look and feel? I could have swore it didn't
work with themes. FWIW it definitely doesn't work under Windows 7 (just
checked).

Kenneth Porter

unread,
May 20, 2011, 3:49:45 PM5/20/11
to wx-u...@googlegroups.com
--On Friday, May 20, 2011 7:46 PM +0200 Vadim Zeitlin <va...@wxwidgets.org>
wrote:

> Do you use themes or classic look and feel? I could have swore it didn't


> work with themes. FWIW it definitely doesn't work under Windows 7 (just
> checked).

Windows themes or something else? I thought Windows themes were always in
effect, and out of the box there was a default theme. (It's not something I
mess with much.)


Reply all
Reply to author
Forward
0 new messages