Current selection in a ComboDropList

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
cippyboy
Quite a regular
Quite a regular
Posts: 51
Joined: Wed Jul 30, 2008 13:23

Current selection in a ComboDropList

Postby cippyboy » Thu Nov 06, 2008 17:14

I've been trying for some time to make it so that a droplist inside a window will be focused upon showing the window, without clicking on it once. Selecting something from the list works from the first click, but the hovering doesn't . I tried

ParentWindow->show();
ParentWindow->activate();
DropList->activate();

but it's as if nothing happened. Isn't activate() supposed to mimic clicking functionality and give focus to a window ?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Thu Nov 06, 2008 20:20

Is the DropList added directly to the Window, as in, it's not part of a Combobox?

If that's so, while I'll not say you can't use ComboDropList in that manner, it was written with the intention that it be part of a Combobox.

If you are using the ComboDropList directly, can you give us some info about what kind of usage you have in mind, and how you're setting things up currently. If we can't offer useful solutions, we may be able to enhance the ComboDropList for future releases :)

CE.

User avatar
cippyboy
Quite a regular
Quite a regular
Posts: 51
Joined: Wed Jul 30, 2008 13:23

Postby cippyboy » Fri Nov 07, 2008 11:52

Well yeah, I don't use it inside a ComboBox because I need to highlight current selection BEFORE you click it, and I saw that I can't do that in a standard ListBox, because there the selection gets highlighted only AFTER you click. It's basically setting the selectionimage when you hover it, and that's what I need from it. The non-activation is just a side effect though :D

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Fri Nov 07, 2008 13:12

Ok, thanks for clarifying. As previously stated the drop-list is very special case, and so its apparent behaviour as part of a combobox is not always what it appears to be from the outside.

Anyway, I think you'll get what you need if you enable the 'auto arming' for the list. Basically, when you click the list the first time you are 'arming' it for selection, with auto-arm enabled, it's basically permanently armed for selection.

See: ComboDropList::setAutoArmEnabled

FX:

Code: Select all

// set auto-armed state for the list
mydroplist->setAutoArmEnabled(true);


HTH

CE

User avatar
cippyboy
Quite a regular
Quite a regular
Posts: 51
Joined: Wed Jul 30, 2008 13:23

Postby cippyboy » Wed Nov 12, 2008 11:22

That worked just fine, thanks ;)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: Baidu [Spider] and 9 guests