[fixed]IGUIComboBox - weird scroll bug

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Mloren
Posts: 114
Joined: Mon Aug 07, 2006 2:30 am
Location: Australia
Contact:

[fixed]IGUIComboBox - weird scroll bug

Post by Mloren »

Found a weird bug:

Create a IGUIComboBox with enough elements for the scroll bar to appear, better if there are lots of elements so you can scroll a lot.

Now scroll it all the way to the bottom.

Now if you just move the mouse up the currently visible items on the list, as you move the cursor past the top one, the list will scroll up a couple. If you move the mouse up and down at the right spot (just where the drop down box meets the edit box where the selected item is displayed), it will scroll all the way up to the top in uneven jumps.

I'm guessing that what is occurring here is that you are managing to highlight the element that is currently scrolled just off the top of the list, maybe by just one pixel and the list scrolls to make it visible.

This seems like odd behavior, especially since it doesn't scroll down if you move the mouse off the bottom of the list.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Thanks, that sounds indeed wrong. I've just finished the project on Monday which had kept me so busy over the last 4 months, so unless hell freezes again (happens occasionally) I should find time this weekend to start catching up on the GUI-Bugs.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

something is wrong with tab not having children assigned. tried debugging gui editor without much luck so far. I traced bug to the CGUIPanel::resizeInnerPane(), InnerPane->getChildren() never has any children.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

roxaz wrote:something is wrong with tab not having children assigned. tried debugging gui editor without much luck so far. I traced bug to the CGUIPanel::resizeInnerPane(), InnerPane->getChildren() never has any children.
Is this a gui-editor problem? I'm sorry - I think right now we have no maintainer for that.

If it is a gui-problem it would help if you have code to reproduce the problem.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post by roxaz »

oh crap sorry, yesterday i was quite tired, thought thread is a bout gui editor.. yeah, i was talking about gui editor issue, tabs with lots of elements have no scrollbar.. sorry for confusion :)
Kukuy
Posts: 1
Joined: Wed Nov 24, 2010 8:13 pm

Add scrolling GUIEditor 1.7.2

Post by Kukuy »

Good news!
Put in the GUIEditor 1.7.2 one oak crutch. And now the editor works.
Well, can be not quite optimum, but works.

(Apologies for the bad english)

Add scrolling GUIEditor 1.7.2 can be as follows:
step 1: Open GUIEditor project(irrlicht\examples\BuildAllExamples.workspace -> GUI Editor).
step 2: Open CGUIEditWindow.cpp file.
step 3: Go to f-tion: "bool CGUIEditWindow::OnEvent(const SEvent &event)"
step 4: Before line "switch(event.EventType)..." create two var:

Code: Select all

static f32 attrEdScroll,envEdScroll;
step 5: After "switch(event.EventType)...", after this block:

Code: Select all

   case EET_MOUSE_INPUT_EVENT:
      switch(event.MouseInput.Event)
      {
      ...
insert this:

Code: Select all

        case EMIE_MOUSE_WHEEL:
        if( getAttributeEditor()->getParent()->isVisible() )
        {
            attrEdScroll -= event.MouseInput.Wheel/10;
            if (attrEdScroll>3) attrEdScroll = 3;
            if (attrEdScroll<0) attrEdScroll = 0;
            getAttributeEditor()->setRelativePositionProportional( core::rect<f32>(0.0f,-attrEdScroll,1.0f,1.0f) );
        }

        if( getEnvironmentEditor()->getParent()->isVisible() )
        {
            envEdScroll -= event.MouseInput.Wheel/10;
            if (envEdScroll>11) envEdScroll = 11;
            if (envEdScroll<0) envEdScroll = 0;
            getEnvironmentEditor()->setRelativePositionProportional( core::rect<f32>(0.0f,-envEdScroll,1.0f,1.0f) );
        }

         break;

And compile this.

Now two panel: "Env" and "Element" to be scrolling on mouse wheel. Simply sometimes necessary to click on panels by left button mouse(to set the focus).

Patch(corrected) file CGUIEditWindow.cpp(ANSI):
http://www.irrlicht.ru/forum/download/file.php?id=13
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: IGUIComboBox - weird scroll bug

Post by CuteAlien »

Thanks for reporting and patch proposal. It could be fixed different (basically someone stumbled over the mess Irrlicht made by calling virtual functions in the constructor - that's another thing that urgently needs fixing...). It's fixed now in 1.7 release branch and will be in trunk soon.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply