Is there a way to get all the sliders in my UI to redraw whenever the thumb's moved, without having to add code to each of them?
You see, the sliders look like this:
So that whenever the thumb's moved, the glow "follows" it, giving a better idea of its position.
Slider updating when thumb moves
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Slider updating when thumb moves
There's nothing for this at the moment, though you could subscribe the global event for a slider position change, extract the source window and manually trigger a redraw. So you'd have to add some code, but not for every slider.
Is this using falagard? If so I think I'll change the slider in there so that moving the thumb position will trigger a redraw of the whole widget. Or, more likely, add a configurable option.
Is this using falagard? If so I think I'll change the slider in there so that moving the thumb position will trigger a redraw of the whole widget. Or, more likely, add a configurable option.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Slider updating when thumb moves
Of course, I forgot about the global event, thanks for the suggestionCrazyEddie wrote:
There's nothing for this at the moment, though you could subscribe the global event for a slider position change, extract the source window and manually trigger a redraw. So you'd have to add some code, but not for every slider.
Is this using falagard? If so I think I'll change the slider in there so that moving the thumb position will trigger a redraw of the whole widget. Or, more likely, add a configurable option.
And yes it is using Falagard, all my widgets are now, it's awesome
Re: Slider updating when thumb moves
Sorry about double-posting and such, but I've got a problem. I've set up the global event to redraw the slider when changed, only... it doesn't work. It might be because the code is partially made of copy+pasting other existing code on the application since I'm not a very good coder, but it compiles fine:
Code: Select all
CEGUI::GlobalEventSet::getSingleton().subscribeEvent(CEGUI::Slider::EventValueChanged, CEGUI::Event::Subscriber(UITest::Slide,this));
bool UITest::Slide(const CEGUI::EventArgs& e)
{
CEGUI::Window* slide = ((CEGUI::WindowEventArgs*)&e)->window;
slide->requestRedraw();
return true;
}
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Slider updating when thumb moves
The global event set required the event string to be prepended with an approperiate event namespace. This is because multiple widget types may define an event with the same name, so we needed a means of identifying the correct event.
So the event to subscribe is:
HTH
CE
So the event to subscribe is:
Code: Select all
Slider::EventNamespace + "/" + Slider::EventValueChanged
HTH
CE
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Slider updating when thumb moves
Thanks, it works now, though I still got another problem. Look here:
Now, the glow is set as a FrameComponent which tiles vertically and horizontally. So why are the top-middle and bottom-middle parts being stretched?
Now, the glow is set as a FrameComponent which tiles vertically and horizontally. So why are the top-middle and bottom-middle parts being stretched?
Project Xenocide UI Guru
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Slider updating when thumb moves
As stated in the docs for falagard, the formatting options for FrameComponent affect the background image, they do not affect the egdes of the frame. To tile the edges you need to build the frame yourself using ImageryComponents.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: Bing [Bot] and 4 guests