Implementing a settable ProgressBar

majorconfusion

13-12-2010 02:11:49

MyGUI'ers - thanks for a great library!

I need a settable ProgressBar widget for my app. Like the familiar YouTube video progress bar.

I've struck two issues trying to implement this using MyGUI SVN trunk (rev 3870):

1. Much of the inside of the progress bar is a different widget from the one I create.
I set button press and release event handlers on the progress bar, but they only fire when I click at the very edge of the bar - within 1 pixel of the border I believe. I imagine there is a different widget created to support filling the bar, but I can seem to access it via the standard APIs to set a matching event handler on it.

I'd also like to be able to access the progress bar 'fill' widget to enable me to show a "delta" progress bar - perhaps in a different colour - after the user presses the mouse button, but prior to releasing it.

I've delved a little into the MyGUI_ProgressBar.cpp code and can see an mClient variable, but its marked obsolete, and appears to be set to point to the progress bar widget in any case. There is also a vector of widgets which appears more promising - but doesn't seem to be externally accessible.

On a happier note, when I do actually click in the right spot my event handler is calculating the correct progress bar position to be set, but ...

2. I can't convince the progress bar to show any progress!
I receive messages shown below when creating the progress bar (skin 'ProgressBar', or 'ProgressBarFill', it doesn't matter which - my MyGUI_Media files are unmodified from the repository). Setting auto track, or using setProgressPosition doesn't do anything - just an empty progress bar. This was working before I grabbed the trunk MyGUI.

Widget property 'TrackFill' not found []
Widget property 'TrackMin' not found []
Widget property 'TrackSkin' not found []


I compiled MyGUI with 'MYGUI_DONT_USE_OBSOLETE:BOOL=ON', and noticed that MyGUI_BackwardCompatibility.cpp contains the following:

mPropertyIgnore.insert("TrackSkin");
mPropertyIgnore.insert("TrackMin");
mPropertyIgnore.insert("TrackFill");


I commented this out and rebuilt MyGUI, but it didn't make any difference. Any other hints?

my.name

14-12-2010 18:52:48

MYGUI_DONT_USE_OBSOLETE:BOOL=OFF