0.5RC2:problem with Sliderthumb with silder control

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

franckypoune
Just popping in
Just popping in
Posts: 18
Joined: Tue Apr 18, 2006 08:19

0.5RC2:problem with Sliderthumb with silder control

Postby franckypoune » Mon Oct 30, 2006 20:02

Good evening,
I have problem to have a correct display with slider control.
Indeed, i use UnifiedSize and UnifiedPosition to place the control in the window and never i succeed in displaying the slider thumb.
I succeed only with UnifiedAreaRect property but not always, maybe it depends on the size of the parent window. I have not debugging this problem yet.
Someone has noticed this problem?
Thanks in advance

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Oct 31, 2006 07:50

Hi,

I'm not sure if you're trying to add the thumb to the slider yourself; either via a layout or code, or whether you are talking about how it's done within a LookNFeel skin file.

For just using a slider, you do not have to create and add a SliderThumb for the Slider - this is done for you when you create the slider. If you are already just doing this, then you will need to post the layout or code so that we may determine what you are doing wrong.

If your problem involves placement of the thumb within a LookNFeel skin, the first advice is to look at the existing examples. For placement of the thumb, you do not specify an absolute position and size; rather you specify an 'area' where the thumb can be moved - this is called the "ThumbTrackArea". The size of the thumb is controlled via the WidgetLook applied to the thumb type used. Again, if this is where you are having trouble, posting some part of your skin definition for us to look at would be useful.

CE.

franckypoune
Just popping in
Just popping in
Posts: 18
Joined: Tue Apr 18, 2006 08:19

Postby franckypoune » Tue Oct 31, 2006 09:20

Hi CE,
I am not trying to add the thum myself, i used the slider in the windowlook looknfeel.
I try to reproduce my problem in the example "Sample_ScrollablePaneDemo" .
I add at the end of the InitialiseSample method, the following code:

Code: Select all

CEGUI::Window* SliderWin;
SliderWin= d_wm->createWindow("WindowsLook/Slider");
SliderWin->setMinSize(UVector2(UDim(0,100),UDim(0,100)));
SliderWin->setPosition(UVector2(UDim(0,10),UDim(0,10)));
dlg->addChildWindow(SliderWin);


The slider is displayed but not the thumb.

I also try this:

Code: Select all

CEGUI::Window* sldr;
sldr= d_wm->createWindow("WindowsLook/Slider");
sldr->setPosition(UVector2(UDim(0,10),UDim(0,10)));
sldr->setSize(UVector2(UDim(0,150),UDim(0,80)));
sldr->setMinSize(UVector2(UDim(0,150),UDim(0,80)));
sldr->setMaxSize(UVector2(cegui_reldim(0.03f), cegui_reldim( 1.0f)));
dlg->addChildWindow(sldr);


The slider is diplayed and also the thumb! ;0)

But with this code:

Code: Select all

CEGUI::Window* sldr;
sldr= d_wm->createWindow("WindowsLook/Slider");
sldr->setPosition(UVector2(UDim(0,10),UDim(0,10)));
sldr->setSize(UVector2(UDim(0,150),UDim(0,80)));
sldr->setMinSize(UVector2(UDim(0,150),UDim(0,80)));
sldr->setMaxSize(UVector2(UDim(0,200), UDim( 0,100)));
dlg->addChildWindow(sldr);


Same problem, the thumb is not there!


Thanks for your help,

franckypoune
Just popping in
Just popping in
Posts: 18
Joined: Tue Apr 18, 2006 08:19

Postby franckypoune » Tue Oct 31, 2006 09:57

I notice that if you set the same value for MinSize and MaxSize, it seems to work: the slider and the thum are displayed correctly.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Oct 31, 2006 11:24

Hi,

Thanks for the code-snippets. That was very helpful in reproducing the issue with no effort required ;)

I can confirm that this is some kind of bug; I'll investgate further and get a fix in.

CE.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Tue Oct 31, 2006 12:25

I have committed a fix for this kind of error. svn rev. 1428.

Thanks again for the report :D

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests