Mousewheel in ItemListbox

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

MarkR
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Jul 15, 2010 06:55

Mousewheel in ItemListbox

Postby MarkR » Mon Aug 09, 2010 11:12

The mousewheel functionality in the ItemListbox shows a strange behavior, which is a little bit hard to describe:
Scrolling works initially, but if you scroll near to the end of the list, the scrolling functionality stops until you change the y-position of the mouse cursor.

Not sure if this has something to do with the "setMouseInputPropagationEnabled" / "setMousePassThroughEnabled".
The code basically looks like this:

Code: Select all

    CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
    CEGUI::Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
    myRoot->setMousePassThroughEnabled(true);
    CEGUI::System::getSingleton().setGUISheet( myRoot );

    CEGUI::FrameWindow* mainWindow = (CEGUI::FrameWindow*)wmgr.createWindow( "WindowsLook/FrameWindow" );
    myRoot->addChildWindow( mainWindow );
    mainWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( 0, 50.0f ), CEGUI::UDim( 0, 50.0f ) );
    mainWindow->setSize( CEGUI::UVector2( CEGUI::UDim( 0, 150.0f ), CEGUI::UDim( 0, 80.0f ) );
    mainWindow->setMouseInputPropagationEnabled(true);

    CEGUI::ItemListbox* listBox = (CEGUI::ItemListbox*)wmgr.createWindow("WindowsLook/ItemListbox", "playerList");
    mainWindow->addChildWindow(listBox);
    listBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 0), CEGUI::UDim(0, 0)));
    listBox->setSize(CEGUI::UVector2(CEGUI::UDim(1.0f, 0), CEGUI::UDim(1.0f, 0)));
    listBox->setSortEnabled(true);
    listBox->setMouseInputPropagationEnabled(true);

    for (size_t i = 0; i < 20; ++i)
    {
        CEGUI::ItemEntry* item = (CEGUI::ItemEntry*)CEGUI::WindowManager::getSingleton().createWindow("WindowsLook/ItemEntry");
        item->setText("Test Item");
        listBox->addItem(item);
    }

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

Re: Mousewheel in ItemListbox

Postby CrazyEddie » Tue Aug 10, 2010 08:25

Thanks for the report; I'll check it out and report back soon.

CE.

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

Re: Mousewheel in ItemListbox

Postby CrazyEddie » Sat Aug 14, 2010 07:11

I ran a little test on this but found no issues. I made a video of my endeavours just in case you could see either something I could not, or whether I tested it incorrectly :)



Cheers

CE

MarkR
Quite a regular
Quite a regular
Posts: 64
Joined: Thu Jul 15, 2010 06:55

Re: Mousewheel in ItemListbox

Postby MarkR » Sat Aug 14, 2010 09:05

I found it. I didn't call

Code: Select all

item->setMouseInputPropagationEnabled(true);

on every item, but I disabled some of them. The mousewheel worked correctly while the mouse was hovering over an disabled item, while the enabled item "ate" the mousewheel events.

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

Re: Mousewheel in ItemListbox

Postby CrazyEddie » Sun Aug 15, 2010 07:54

Yeah, ok, that makes sense.

If your ItemEntry based content is skinned, you should consider having that property set automatically via the WidgetLook definition :)

CE.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 7 guests