Page 1 of 1

change the value of falagard/progressbar

Posted: Tue Jul 27, 2010 20:24
by takavar
Hi everyone

How we can change the amount of progress of the widget like taharezlook/ProgressBar?
i add this widget in my application but i can't change it! :(

Re: change the value of falagard/progressbar

Posted: Tue Jul 27, 2010 22:00
by Timo
You can change it by calling the setProgress() method. It takes a parameter between 0.0 and 1.0. Or you can use step() to move it one step at a time.

Re: change the value of falagard/progressbar

Posted: Wed Jul 28, 2010 13:12
by takavar
Timo wrote:You can change it by calling the setProgress() method. It takes a parameter between 0.0 and 1.0. Or you can use step() to move it one step at a time.


Hi

there isn't any function with name "setProgress" in CEGUI::Window class!
please see my code and help me!


CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezlookSkin.scheme");
mSystem->setDefaultMouseCursor((CEGUI::utf8*)"Taharezlook",(CEGUI::utf8*)"MouseArrow");
CEGUI::WindowManager* win = CEGUI::WindowManager::getSingletonPtr();
CEGUI::Window* sheet = win->createWindow("DefaultGUISheet", "CEGUIDemo/Sheet");
CEGUI::Window* p = win->createWindow("Taharezlook/ProgressBar","CEGUIDemo/MyProgressbar");
p->(a function may be here!!!!)

Re: change the value of falagard/progressbar

Posted: Wed Jul 28, 2010 16:31
by emarcotte
You need to cast down to the progress bar class

Something like (untested, just typed into forum directly)

Code: Select all

CEGUI::Window* pbarWindow = ...
CEGUI::ProgressBar* pbar = dynamic_cast<CEGUI::ProgressBar*>(pbarWindow);


CEGUI can't return the specific type of the window because it uses an factory method which can return any of the various types of windows. All it can do is return the base class type.

Re: change the value of falagard/progressbar

Posted: Wed Jul 28, 2010 17:14
by Jamarr
Please post in the appropriate forum.

Re: change the value of falagard/progressbar

Posted: Thu Jul 29, 2010 15:06
by takavar
thank you emarcotte and Timo :)

i do that with a code like this:


CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"Takavarskin.scheme");
mSystem->setDefaultMouseCursor((CEGUI::utf8*)"Takavar",(CEGUI::utf8*)"MouseArrow");
CEGUI::WindowManager* win = CEGUI::WindowManager::getSingletonPtr();
CEGUI::Window* sheet = win->createWindow("DefaultGUISheet", "CEGUIDemo/Sheet");
CEGUI::ProgressBar* pbar = (CEGUI::ProgressBar*)(win->createWindow("Takavar/ProgressBar","p"));
sheet->addChildWindow((CEGUI::Window*)pbar);

:rofl: :rofl: :rofl: :rofl: :rofl: :rofl: