[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.
Post Reply
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

[fixed][gui artifact] Combo box

Post by REDDemon »

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.
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

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.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