Page 1 of 1

[Feature Request] ComboBox Problems

Posted: Tue Mar 13, 2007 01:22
by kungfoomasta
As far as I know, CEGUI::ListboxTextItem does not have a "setMouseCursor" function. When the mouse moves over the ListboxTextItems within my ComboBox, the cursor disappears:

Mouse is visible:

Image

Mouse is no longer visible:

Image

Here is my code:

Code: Select all

CEGUI::Combobox* MenuBasedSystem::createComboBox( Ogre::String name, Ogre::String type, Ogre::StringVector items, CEGUI::UVector2 pos, CEGUI::UVector2 size )
{
   CEGUI::Combobox* newComboBox = static_cast<CEGUI::Combobox*>(mWindowManager->createWindow(type.c_str(),name.c_str()));
   newComboBox->setSize(size);
   newComboBox->setPosition(pos);
   newComboBox->setMouseCursor("WindowsLook","MouseArrow");
   newComboBox->setReadOnly(true);

   // iterate through list and add items

   // if empty list, don't add anything
   if( items == NULL ) return newComboBox;

   std::vector<Ogre::String>::iterator it;
   int index = 0;
   for( it = items->begin(); it != items->end(); ++it, ++index )
   {
      CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem((CEGUI::utf8*)it->c_str(), index);
        newComboBox->addItem(item);
   }

   return newComboBox;
}


I did a search on the forums, and could not find anything. What am I missing from my code?

I am using OGRE 1.4 RC2 and CEGUI 0.5.0.

Thanks in advance,

KungFooMasta

Posted: Tue Mar 13, 2007 01:54
by kungfoomasta
I found the answer to my problem, and I believe it reveals the need for some functionality. CEGUI::ListboxTextItem does not have a "setMouseCursor" function, and the only way to display a cursor over this item is by executing the following code:

Code: Select all

CEGUI::System::getSingleton().setDefaultMouseCursor("WindowsLook", "MouseArrow");


:?: Can we add a setMouseCursor function to CEGUI::ListboxTextItem class?

:!: Also, I believe the ComboBox may have a bug, as I explicitly set the mouse cursor to the windows look mouse pointer, however I see a Text Cursor whenever hovering over the ComboBox. Am I setting the cursor incorrectly? Code is in the first post.

Let me know if I am incorrect, or if there is a proper solution. In either case, I believe this function should be implemented for the class..

KungFooMasta