change the value of falagard/progressbar

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

takavar
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 14, 2010 08:18

change the value of falagard/progressbar

Postby takavar » Tue Jul 27, 2010 20:24

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! :(

Timo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Sun Feb 14, 2010 09:38

Re: change the value of falagard/progressbar

Postby Timo » Tue Jul 27, 2010 22:00

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.

takavar
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 14, 2010 08:18

Re: change the value of falagard/progressbar

Postby takavar » Wed Jul 28, 2010 13:12

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!!!!)

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: change the value of falagard/progressbar

Postby emarcotte » Wed Jul 28, 2010 16:31

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.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: change the value of falagard/progressbar

Postby Jamarr » Wed Jul 28, 2010 17:14

Please post in the appropriate forum.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

takavar
Just popping in
Just popping in
Posts: 9
Joined: Wed Jul 14, 2010 08:18

Re: change the value of falagard/progressbar

Postby takavar » Thu Jul 29, 2010 15:06

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:


Return to “Help”

Who is online

Users browsing this forum: MSN [Bot] and 8 guests