[Feature Request] ComboBox Problems

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
kungfoomasta
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Apr 06, 2005 08:25

[Feature Request] ComboBox Problems

Postby kungfoomasta » Tue Mar 13, 2007 01:22

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
Last edited by kungfoomasta on Tue Mar 13, 2007 01:57, edited 2 times in total.

User avatar
kungfoomasta
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Wed Apr 06, 2005 08:25

Postby kungfoomasta » Tue Mar 13, 2007 01:54

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


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 38 guests