[fixed][gui artifact] Combo box

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.

[fixed][gui artifact] Combo box

Postby REDDemon » Wed Mar 30, 2011 7:34 am

There is a little gui artifact that appens when you use combo boxes that have 4/6+ items.

When number of items is greater than a certain value a ScrollBar is added to the combobox so you can scroll all items, if you scroll the Combobox using the ScrollBar or the Mouse Wheel, the highlight of the item lose its focus and it stops updating.

You can always click and select the right item, but while you are doing that the "blue highlight" still remains in the last place it was before you have clicked the scroll bar.

That's nothing really important anyway.
OpenGL is not hard. What you have to do is just explained in specifications. What is hard is dealing with poor OpenGL implementations.
User avatar
REDDemon
 
Posts: 831
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Postby CuteAlien » Tue Apr 19, 2011 9:11 pm

Bug was sitting a few stages deeper in the scrollbar which did eat all mouse-move events when it had the focus. I've changed it in 1.7 branch in revision 3645 so that mouse-move-events are now passed on to the parent of the scrollbar (the listbox in this case) when it doesn't need them itself.

Test-code:
Code: Select all
#include <irrlicht.h>

#include <iostream>



using namespace irr;

using namespace core;

using namespace scene;

using namespace video;

using namespace io;

using namespace gui;



#ifdef _IRR_WINDOWS_

#pragma comment(lib, "Irrlicht.lib")

#endif





int main()

{

   video::E_DRIVER_TYPE driverType = video::EDT_OPENGL;

   IrrlichtDevice * device = createDevice(driverType, core::dimension2d<u32>(640, 480));

   if (device == 0)

      return 1; // could not create selected driver.



   video::IVideoDriver* driver = device->getVideoDriver();

   IGUIEnvironment* env = device->getGUIEnvironment();



   core::rect<s32> rect(10, 10, 200, 30);

   IGUIComboBox * combo = env->addComboBox (rect, 0, /*s32 id=*/-1);

   for ( int i = 0; i < 6; ++i)

   {

      core::stringw wstr(i);

      wstr += L"Alpha";

      combo->addItem(wstr.c_str());

      wstr += L"-Beta";

      combo->addItem(wstr.c_str());

   }



   while(device->run() && driver)

   {

      if (device->isWindowActive())

      {

         driver->beginScene(true, true, SColor(0,200,200,200));



         env->drawAll();



         driver->endScene();

      }

   }



   device->drop();



   return 0;

}




Thanks for reporting.
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5364
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 0 guests