[Solved] MyGUI::Progress::setProgessPosition problem

AshMcConnell

02-10-2010 13:19:32

Hi Folks,

I can't quite get this to work for some reason.

Here is the definition: -

<Widget type="Progress" skin="ProgressFill" position="582 16 172 28" name="percentLevelFinished">
<Property key="Progress_Range" value="100"/>
<Property key="Progress_Position" value="10"/>
<Property key="Widget_InheritsAlpha" value="false"/>
<Property key="Progress_StartPoint" value="Left"/>
<Property key="Progress_AutoTrack" value="false"/>
</Widget>


I've tried setting it explicitly to 80 using: -
_percentLevelFinished->setProgressPosition(80);


Here is how it looks (to the right of Points Required)



Any ideas what I could be doing wrong?

Thanks for your help
Ash

my.name

02-10-2010 17:18:43

version MyGUI?

my.name

02-10-2010 17:24:52

try

_percentLevelFinished->setProgressRange(100);
_percentLevelFinished->setProgressPosition(80);

AshMcConnell

02-10-2010 17:38:37

Hi,

It's version 3.0.1 according to the changelog, but it might be slightly later as I think i got it from SVN

I tried setting the range, but it didn't work, I got the same result as above,

Thanks!
Ash

my.name

03-10-2010 01:01:47

try

<Widget type="Progress" skin="ProgressFill" position="582 16 172 28" name="percentLevelFinished">
<Property key="Progress_Range" value="100"/>
<Property key="Progress_Position" value="10"/>
<Property key="Widget_InheritsAlpha" value="false"/>
</Widget>

and try

_percentLevelFinished->setProperty("Progress_Position", "80");

Altren

03-10-2010 01:02:54

Are you sure that this line is actually called?

Also try to call getProgressPosition before and after setProgessPosition call.

AshMcConnell

03-10-2010 09:24:45

Hi Folks,

I found the problem. It was an odd one. I have a function "w" that gets the widget by name in the current "Menu Page"

_percentLevelFinished = (MyGUI::Progress *)w("percentLevelFinished");

I missed the w, so it was casting the string "percentLevelFinished" as a Progress widget. Strangely it didn't crash when I called setProgressPosition, but it did when I called setProperty.

Sorry I didn't spot the mistake, but it's working now!

All the best,
Ash