[SOLVED]Listbox won't allow selection of multiple items

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
DepletedCache
Just popping in
Just popping in
Posts: 5
Joined: Wed Aug 17, 2011 02:00

[SOLVED]Listbox won't allow selection of multiple items

Postby DepletedCache » Wed Aug 17, 2011 03:58

Hello,

I have a project using CEGUI with OpenGL via SDL, running on Windows 7 Pro SP1 64-bit and using Visual Studio 2010 Ultimate.
Everything seems to be working fine except one odd issue I haven't had any luck in finding the answer to.

I have a Listbox that I want to be able to select multiple items from, however no matter what I have tried the Listbox will only have one Item selected at a time.
The Listbox is defined, as a child window of a root DefaultWindow, in an XML layout as the following:

Code: Select all

..
<Window Type="TaharezLook/Listbox" Name="TextureListbox" >
            <Property Name="Sort" Value="True" />
            <Property Name="AlwaysOnTop" Value="True" />
            <Property Name="MultiSelect" Value="True" />
            <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.2,0},{0.8,0},{0.8,0}}" />
</Window>
..

Notice that MultiSelect is set to True, and I have also checked during run-time, via the isMultiselectEnabled() method of the Listbox, that Multiselect is indeed enabled.

Here is the relevant code dealing with populating the Listbox:

Code: Select all

..
//Create the new ListboxItem with a given text(std::string texName) and a given ID(unsigned int indexID)
CEGUI::ListboxTextItem *newItem = new CEGUI::ListboxTextItem(texName, indexId);

//Set the selection overlay color to be green
newItem->setSelectionColours(CEGUI::colour(0.0, 1.0, 0.0, 0.5));

//Use the default TaharezLook Listbox Selection Brush Image
newItem->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");

//Add the new item to the Listbox
listbox->addItem(newItem);


Here is my CEGUI.log, in its entirety:

Code: Select all

16/08/2011 23:23:50 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
16/08/2011 23:23:50 (Std)    +                     Crazy Eddie's GUI System - Event log                    +
16/08/2011 23:23:50 (Std)    +                          (http://www.cegui.org.uk/)                         +
16/08/2011 23:23:50 (Std)    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

16/08/2011 23:23:50 (Std)    CEGUI::Logger singleton created. (008BD8F8)
16/08/2011 23:23:50 (Std)    
16/08/2011 23:23:50 (Std)    ********************************************************************************
16/08/2011 23:23:50 (Std)    * Important:                                                                   *
16/08/2011 23:23:50 (Std)    *     To get support at the CEGUI forums, you must post _at least_ the section *
16/08/2011 23:23:50 (Std)    *     of this log file indicated below.  Failure to do this will result in no  *
16/08/2011 23:23:50 (Std)    *     support being given; please do not waste our time.                       *
16/08/2011 23:23:50 (Std)    ********************************************************************************
16/08/2011 23:23:50 (Std)    ********************************************************************************
16/08/2011 23:23:50 (Std)    * -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
16/08/2011 23:23:50 (Std)    ********************************************************************************
16/08/2011 23:23:50 (Std)    ---- Version 0.7.6 (Build: Aug 16 2011 Microsoft Windows MSVC++ 10.0 32 bit) ----
16/08/2011 23:23:50 (Std)    ---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based 2nd generation renderer module.  TextureTarget support enabled via FBO extension. ----
16/08/2011 23:23:50 (Std)    ---- XML Parser module is: CEGUI::TinyXMLParser - Official tinyXML based parser module for CEGUI ----
16/08/2011 23:23:50 (Std)    ---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
16/08/2011 23:23:50 (Std)    ---- Scripting module is: None ----
16/08/2011 23:23:50 (Std)    ********************************************************************************
16/08/2011 23:23:50 (Std)    * -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
16/08/2011 23:23:50 (Std)    ********************************************************************************
16/08/2011 23:23:50 (Std)    
16/08/2011 23:23:50 (Std)    ---- Begining CEGUI System initialisation ----
16/08/2011 23:23:50 (Std)    CEGUI::ImagesetManager singleton created (008BF0A0)
16/08/2011 23:23:50 (Std)    CEGUI::FontManager singleton created. (008BE508)
16/08/2011 23:23:50 (Std)    CEGUI::WindowFactoryManager singleton created
16/08/2011 23:23:50 (Std)    CEGUI::WindowManager singleton created (008BD8A0)
16/08/2011 23:23:50 (Std)    CEGUI::SchemeManager singleton created. (008BE698)
16/08/2011 23:23:50 (Std)    CEGUI::MouseCursor singleton created. (008BE768)
16/08/2011 23:23:50 (Std)    CEGUI::GlobalEventSet singleton created. (008BB190)
16/08/2011 23:23:50 (Std)    CEGUI::AnimationManager singleton created (008BF2E0)
16/08/2011 23:23:50 (Std)    CEGUI::WidgetLookManager singleton created. (008B9858)
16/08/2011 23:23:50 (Std)    CEGUI::WindowRendererManager singleton created (008B9840)
16/08/2011 23:23:50 (Std)    CEGUI::RenderEffectManager singleton created (008BB1B8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'DefaultWindow' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'DefaultWindow' windows added. (008C27E8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'DragContainer' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'DragContainer' windows added. (008C3B90)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'ScrolledContainer' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'ScrolledContainer' windows added. (008C3C38)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'ClippedContainer' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'ClippedContainer' windows added. (008C3A98)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Checkbox' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Checkbox' windows added. (008C3CE0)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/PushButton' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/PushButton' windows added. (008C3E80)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/RadioButton' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/RadioButton' windows added. (008C3D88)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Combobox' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Combobox' windows added. (008C3F28)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/ComboDropList' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/ComboDropList' windows added. (008C40C8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Editbox' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Editbox' windows added. (008C4188)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/FrameWindow' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/FrameWindow' windows added. (008C4230)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/ItemEntry' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/ItemEntry' windows added. (008C42D8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Listbox' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Listbox' windows added. (008C4380)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/ListHeader' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/ListHeader' windows added. (008C4428)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/ListHeaderSegment' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/ListHeaderSegment' windows added. (008C44D0)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Menubar' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Menubar' windows added. (008C4578)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/PopupMenu' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/PopupMenu' windows added. (008C4620)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/MenuItem' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/MenuItem' windows added. (008C46C8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/MultiColumnList' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/MultiColumnList' windows added. (008C4770)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/MultiLineEditbox' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/MultiLineEditbox' windows added. (008C4818)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/ProgressBar' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/ProgressBar' windows added. (008C48C0)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/ScrollablePane' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/ScrollablePane' windows added. (008C4968)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Scrollbar' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Scrollbar' windows added. (008C4A10)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Slider' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Slider' windows added. (008C4AB8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Spinner' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Spinner' windows added. (008C4B60)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/TabButton' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/TabButton' windows added. (008C4C08)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/TabControl' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/TabControl' windows added. (008C4CB0)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Thumb' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Thumb' windows added. (008C4D58)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Titlebar' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Titlebar' windows added. (008C4E00)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Tooltip' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Tooltip' windows added. (008C4EA8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/ItemListbox' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/ItemListbox' windows added. (008C4F50)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/GroupBox' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/GroupBox' windows added. (008C4FF8)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'CEGUI/Tree' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'CEGUI/Tree' windows added. (008C50A0)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'HorizontalLayoutContainer' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'HorizontalLayoutContainer' windows added. (008C5148)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'VerticalLayoutContainer' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'VerticalLayoutContainer' windows added. (008C51F0)
16/08/2011 23:23:50 (Std)    Created WindowFactory for 'GridLayoutContainer' windows.
16/08/2011 23:23:50 (Std)    WindowFactory for 'GridLayoutContainer' windows added. (008C5298)
16/08/2011 23:23:50 (Std)    Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
16/08/2011 23:23:50 (Std)    CEGUI::System singleton created. (008BD5A8)
16/08/2011 23:23:50 (Std)    ---- CEGUI System initialisation completed ----
16/08/2011 23:23:50 (Std)    
16/08/2011 23:23:50 (Std)    Started creation of Scheme from XML specification:
16/08/2011 23:23:50 (Std)    ---- CEGUI GUIScheme name: TaharezLook
16/08/2011 23:23:50 (Std)    Started creation of Imageset from XML specification:
16/08/2011 23:23:50 (Std)    ---- CEGUI Imageset name: TaharezLook
16/08/2011 23:23:50 (Std)    ---- Source texture file: TaharezLook.tga in resource group: (Default)
16/08/2011 23:23:50 (Std)    Started creation of Font from XML specification:
16/08/2011 23:23:50 (Std)    ---- CEGUI font name: DejaVuSans-10
16/08/2011 23:23:50 (Std)    ----       Font type: FreeType
16/08/2011 23:23:50 (Std)    ----     Source file: DejaVuSans.ttf in resource group: (Default)
16/08/2011 23:23:50 (Std)    ---- Real point size: 10
16/08/2011 23:23:50 (Std)    ===== Falagard 'root' element: look and feel parsing begins =====
16/08/2011 23:23:50 (Std)    ===== Look and feel parsing completed =====
16/08/2011 23:23:50 (Std)    No window renderer factories specified for module 'CEGUIFalagardWRBase' - adding all available factories...
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Button' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Button' added. (008C5A78)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Default' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Default' added. (008C5BC8)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Editbox' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Editbox' added. (008C5C70)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/FrameWindow' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/FrameWindow' added. (008C6060)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/ItemEntry' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/ItemEntry' added. (0620CFD0)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/ListHeader' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/ListHeader' added. (0620D078)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/ListHeaderSegment' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/ListHeaderSegment' added. (0620D120)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Listbox' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Listbox' added. (0620D1C8)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Menubar' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Menubar' added. (0620D270)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/MenuItem' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/MenuItem' added. (0620D318)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/MultiColumnList' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/MultiColumnList' added. (0620D3C0)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/MultiLineEditbox' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/MultiLineEditbox' added. (0620D468)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/PopupMenu' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/PopupMenu' added. (0620D510)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/ProgressBar' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/ProgressBar' added. (0620D5B8)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/ScrollablePane' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/ScrollablePane' added. (0620D660)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Scrollbar' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Scrollbar' added. (0620D708)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Slider' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Slider' added. (0620D7B0)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Static' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Static' added. (0620D858)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/StaticImage' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/StaticImage' added. (0620D900)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/StaticText' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/StaticText' added. (0620D9A8)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/SystemButton' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/SystemButton' added. (0620DA50)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/TabButton' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/TabButton' added. (0620DAF8)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/TabControl' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/TabControl' added. (0620DBA0)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Titlebar' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Titlebar' added. (0620DC48)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/ToggleButton' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/ToggleButton' added. (0620DCF0)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Tooltip' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Tooltip' added. (0620DD98)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/ItemListbox' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/ItemListbox' added. (0620DE40)
16/08/2011 23:23:50 (Std)    Created WindowRendererFactory for 'Falagard/Tree' WindowRenderers.
16/08/2011 23:23:50 (Std)    WindowRendererFactory 'Falagard/Tree' added. (0620DEE8)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Button' using base type 'CEGUI/PushButton', window renderer 'Falagard/Button' Look'N'Feel 'TaharezLook/Button' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Checkbox' using base type 'CEGUI/Checkbox', window renderer 'Falagard/ToggleButton' Look'N'Feel 'TaharezLook/Checkbox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ImageButton' using base type 'CEGUI/PushButton', window renderer 'Falagard/Button' Look'N'Feel 'TaharezLook/ImageButton' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/RadioButton' using base type 'CEGUI/RadioButton', window renderer 'Falagard/ToggleButton' Look'N'Feel 'TaharezLook/RadioButton' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/FrameWindow' using base type 'CEGUI/FrameWindow', window renderer 'Falagard/FrameWindow' Look'N'Feel 'TaharezLook/FrameWindow' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Titlebar' using base type 'CEGUI/Titlebar', window renderer 'Falagard/Titlebar' Look'N'Feel 'TaharezLook/Titlebar' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/SystemButton' using base type 'CEGUI/PushButton', window renderer 'Falagard/Button' Look'N'Feel 'TaharezLook/Button' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Editbox' using base type 'CEGUI/Editbox', window renderer 'Falagard/Editbox' Look'N'Feel 'TaharezLook/Editbox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/MultiLineEditbox' using base type 'CEGUI/MultiLineEditbox', window renderer 'Falagard/MultiLineEditbox' Look'N'Feel 'TaharezLook/MultiLineEditbox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Menubar' using base type 'CEGUI/Menubar', window renderer 'Falagard/Menubar' Look'N'Feel 'TaharezLook/Menubar' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/PopupMenu' using base type 'CEGUI/PopupMenu', window renderer 'Falagard/PopupMenu' Look'N'Feel 'TaharezLook/PopupMenu' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/MenuItem' using base type 'CEGUI/MenuItem', window renderer 'Falagard/MenuItem' Look'N'Feel 'TaharezLook/MenuItem' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/AlternateProgressBar' using base type 'CEGUI/ProgressBar', window renderer 'Falagard/ProgressBar' Look'N'Feel 'TaharezLook/AltProgressBar' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ProgressBar' using base type 'CEGUI/ProgressBar', window renderer 'Falagard/ProgressBar' Look'N'Feel 'TaharezLook/ProgressBar' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/VUMeter' using base type 'CEGUI/ProgressBar', window renderer 'Falagard/ProgressBar' Look'N'Feel 'TaharezLook/VUMeter' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/VerticalScrollbar' using base type 'CEGUI/Scrollbar', window renderer 'Falagard/Scrollbar' Look'N'Feel 'TaharezLook/VerticalScrollbar' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/HorizontalScrollbar' using base type 'CEGUI/Scrollbar', window renderer 'Falagard/Scrollbar' Look'N'Feel 'TaharezLook/HorizontalScrollbar' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/VerticalScrollbarThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' Look'N'Feel 'TaharezLook/VerticalScrollbarThumb' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/HorizontalScrollbarThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' Look'N'Feel 'TaharezLook/HorizontalScrollbarThumb' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/LargeVerticalScrollbar' using base type 'CEGUI/Scrollbar', window renderer 'Falagard/Scrollbar' Look'N'Feel 'TaharezLook/LargeVerticalScrollbar' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/LargeVerticalScrollbarThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' Look'N'Feel 'TaharezLook/LargeVerticalScrollbarThumb' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/TabButton' using base type 'CEGUI/TabButton', window renderer 'Falagard/TabButton' Look'N'Feel 'TaharezLook/TabButton' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/TabControl' using base type 'CEGUI/TabControl', window renderer 'Falagard/TabControl' Look'N'Feel 'TaharezLook/TabControl' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/TabContentPane' using base type 'DefaultWindow', window renderer 'Falagard/Default' Look'N'Feel 'TaharezLook/TabContentPane' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/TabButtonPane' using base type 'DefaultWindow', window renderer 'Falagard/Default' Look'N'Feel 'TaharezLook/TabButtonPane' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ComboDropList' using base type 'CEGUI/ComboDropList', window renderer 'Falagard/Listbox' Look'N'Feel 'TaharezLook/ComboDropList' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ComboEditbox' using base type 'CEGUI/Editbox', window renderer 'Falagard/Editbox' Look'N'Feel 'TaharezLook/ComboEditbox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Combobox' using base type 'CEGUI/Combobox', window renderer 'Falagard/Default' Look'N'Feel 'TaharezLook/Combobox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Listbox' using base type 'CEGUI/Listbox', window renderer 'Falagard/Listbox' Look'N'Feel 'TaharezLook/Listbox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ListHeader' using base type 'CEGUI/ListHeader', window renderer 'Falagard/ListHeader' Look'N'Feel 'TaharezLook/ListHeader' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ListHeaderSegment' using base type 'CEGUI/ListHeaderSegment', window renderer 'Falagard/ListHeaderSegment' Look'N'Feel 'TaharezLook/ListHeaderSegment' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/MultiColumnList' using base type 'CEGUI/MultiColumnList', window renderer 'Falagard/MultiColumnList' Look'N'Feel 'TaharezLook/MultiColumnList' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Slider' using base type 'CEGUI/Slider', window renderer 'Falagard/Slider' Look'N'Feel 'TaharezLook/Slider' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/SliderThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' Look'N'Feel 'TaharezLook/SliderThumb' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ScrollablePane' using base type 'CEGUI/ScrollablePane', window renderer 'Falagard/ScrollablePane' Look'N'Feel 'TaharezLook/ScrollablePane' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Spinner' using base type 'CEGUI/Spinner', window renderer 'Falagard/Default' Look'N'Feel 'TaharezLook/Spinner' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Tooltip' using base type 'CEGUI/Tooltip', window renderer 'Falagard/Tooltip' Look'N'Feel 'TaharezLook/Tooltip' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/StaticImage' using base type 'DefaultWindow', window renderer 'Falagard/StaticImage' Look'N'Feel 'TaharezLook/StaticImage' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/StaticText' using base type 'DefaultWindow', window renderer 'Falagard/StaticText' Look'N'Feel 'TaharezLook/StaticText' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ItemListbox' using base type 'CEGUI/ItemListbox', window renderer 'Falagard/ItemListbox' Look'N'Feel 'TaharezLook/ItemListbox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/ListboxItem' using base type 'CEGUI/ItemEntry', window renderer 'Falagard/ItemEntry' Look'N'Feel 'TaharezLook/ListboxItem' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/GroupBox' using base type 'CEGUI/GroupBox', window renderer 'Falagard/Default' Look'N'Feel 'TaharezLook/GroupBox' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Creating falagard mapping for type 'TaharezLook/Tree' using base type 'CEGUI/Tree', window renderer 'Falagard/Tree' Look'N'Feel 'TaharezLook/Tree' and RenderEffect ''. (0039D48C)
16/08/2011 23:23:50 (Std)    Started creation of Font from XML specification:
16/08/2011 23:23:50 (Std)    ---- CEGUI font name: DejaVuSans-10
16/08/2011 23:23:50 (Std)    ----       Font type: FreeType
16/08/2011 23:23:50 (Std)    ----     Source file: DejaVuSans.ttf in resource group: (Default)
16/08/2011 23:23:50 (Std)    ---- Real point size: 10
16/08/2011 23:23:50 (Std)    ---- Returning existing instance of Font named 'DejaVuSans-10'.
16/08/2011 23:23:50 (Std)    Started creation of Font from XML specification:
16/08/2011 23:23:50 (Std)    ---- CEGUI font name: Batang-26
16/08/2011 23:23:50 (Std)    ----       Font type: FreeType
16/08/2011 23:23:50 (Std)    ----     Source file: batang.ttf in resource group: (Default)
16/08/2011 23:23:50 (Std)    ---- Real point size: 26
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'Batang-26_auto_glyph_images_ ' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'DejaVuSans-10_auto_glyph_images_ ' with texture only.
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'AddBlock.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'AddTextures.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'Alert.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'BlockProperties.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'EditorMenu.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'LoadMap.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'MainMenu.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'MapProperties.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'NewMap.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'TileProperties.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'RemoveTextures.layout' ----
16/08/2011 23:23:51 (Std)    ---- Successfully completed loading of GUI layout from 'HUD.layout' ----
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-0' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-1' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-2' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-3' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-4' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-5' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-6' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-7' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-8' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-9' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture2-10' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-0' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-1' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-2' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-3' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-4' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-5' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-6' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-7' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-8' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-9' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-10' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-11' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-12' with texture only.
16/08/2011 23:23:51 (Std)    Attempting to create Imageset 'PrevTexture3-13' with texture only.
16/08/2011 23:23:53 (Std)    Attempting to create Imageset 'PrevTexture0-0' with texture only.
16/08/2011 23:23:53 (Std)    Attempting to create Imageset 'PrevTexture0-1' with texture only.
16/08/2011 23:23:53 (Std)    Attempting to create Imageset 'PrevTexture0-2' with texture only.
16/08/2011 23:23:53 (Std)    Attempting to create Imageset 'PrevTexture0-3' with texture only.


Another thing to note is that I do have all the mouse/keyboard input being injected into CEGUI, which is evident by being able to click on and select/highlight an Item in the Listbox, type into an Editbox, click a Pushbutton, etc.

Any assistance is greatly appreciated.
Last edited by DepletedCache on Thu Aug 18, 2011 20:19, edited 1 time in total.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Listbox won't allow selection of multiple items

Postby Jamarr » Wed Aug 17, 2011 15:37

A couple of things to check: did you subscribe any event handlers, and if so are they preventing multi-selection? are you injecting MouseUp events? are you sure you enabled multi-select on the correct listbox?

And just for curiosity sake, is there any particular reason why you choose /Listbox over /ItemListbox? The /Listbox widget is deprecated (we should really add a warning to the CEGUI log when using this), as it does not support window-based items; whereas /ItemListbox does.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
DepletedCache
Just popping in
Just popping in
Posts: 5
Joined: Wed Aug 17, 2011 02:00

Re: Listbox won't allow selection of multiple items

Postby DepletedCache » Wed Aug 17, 2011 18:46

Thank you for the reply.

Jamarr wrote:A couple of things to check: did you subscribe any event handlers, and if so are they preventing multi-selection? are you injecting MouseUp events? are you sure you enabled multi-select on the correct listbox?

I do have event handlers subscribed for some Pushbuttons, but not for the Listbox.
Both injectMouseButtonDown(..) and injectMouseButtonUp(..) are being appropriately called for the three mouse buttons (LeftButton, RightButton, MiddleButton).
Currently I only have this one Listbox in my project, so I am sure that multiselect is enabled on the correct Listbox.

Jamarr wrote:And just for curiosity sake, is there any particular reason why you choose /Listbox over /ItemListbox? The /Listbox widget is deprecated (we should really add a warning to the CEGUI log when using this), as it does not support window-based items; whereas /ItemListbox does.

Interesting, I was unaware that Listbox was deprecated.
I just updated my code to use an ItemListbox and ItemEntrys instead, but still have the problem of only one item being able to be selected at a time.

Another oddity I just noticed after switching to ItemListbox from Listbox is that, after an initial call to getFirstSelectedItem(),
the first call to getNextSelectedItem() returns a pointer to the same item as getFirstSelectedItem() did, causing a single selected item to be processed twice,
unless I add some simple code to check for duplicates(which I did). When I was using Listbox, getFirstSelectedItem() and getNextSelected() worked together as expected though.
The code where this occurs:

Code: Select all

CEGUI::ItemListbox *listbox = static_cast<CEGUI::ItemListbox*>(CEGUI::WindowManager::getSingleton().getWindow("TextureListbox"));
CEGUI::ItemEntry *tmp = NULL;
CEGUI::ItemEntry *last = NULL;
CEGUI::ItemEntry *curItem = listbox->getFirstSelectedItem();
while(curItem != NULL)
{
   if(curItem != last)
   {
      if(map->removeTexture(curItem->getID()))
      {
         last = tmp = curItem;
         curItem = listbox->getNextSelectedItem();
         listbox->removeItem(tmp);
      }
   }
   else
      curItem = listbox->getNextSelectedItem();
}


Here is the updated definition in the XML layout(not much different):

Code: Select all

..
    <Window Type="TaharezLook/ItemListbox" Name="TextureListbox" >
                <Property Name="AlwaysOnTop" Value="True" />
                <Property Name="MultiSelect" Value="True" />
                <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.2,0},{0.8,0},{0.8,0}}" />
    </Window>
..


The updated code for populating the ItemListbox:

Code: Select all

CEGUI::ItemEntry *newItem = NULL;
..
newItem = static_cast<CEGUI::ItemEntry*>(CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ListboxItem", texName));
newItem->setText(texName);
newItem->setID(indexId);
newItem->setSelectable(true);

listbox->addItem(newItem);


The CEGUI.log hasn't changed at all after the transition.

Thanks again.

User avatar
DepletedCache
Just popping in
Just popping in
Posts: 5
Joined: Wed Aug 17, 2011 02:00

Re: Listbox won't allow selection of multiple items

Postby DepletedCache » Thu Aug 18, 2011 17:59

In hopes this might help identify the issue, I've uploaded a short video demonstrating it:

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Listbox won't allow selection of multiple items

Postby Kulik » Thu Aug 18, 2011 18:08

Very strange, are you sure you are injecting CTRL properly? Does it work in other areas? It is possible that this has been broken, I will try to test it sometime soon.

User avatar
DepletedCache
Just popping in
Just popping in
Posts: 5
Joined: Wed Aug 17, 2011 02:00

Re: Listbox won't allow selection of multiple items

Postby DepletedCache » Thu Aug 18, 2011 20:17

Well I feel foolish, that was exactly the issue.

For some reason, my SDL to CEGUI input mapping function was missing only the control and shift buttons.
I fixed that and sure enough I can select multiple items and the behavior is as expected.

I'll mark this thread solved, but I am still curious as to why the ItemListbox would return the same item twice when iterating through its selected list.
Now that I can select multiple items, I see that each item that gets selected is returned exactly twice when querying/stepping through the selected list using
getFirstSelectedItem() and getNextSelectedItem().

A big thank you to everyone who posted, your assistance was much appreciated.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Listbox won't allow selection of multiple items

Postby Jamarr » Fri Aug 19, 2011 14:38

DepletedCache wrote:I am still curious as to why the ItemListbox would return the same item twice when iterating through its selected list.
Now that I can select multiple items, I see that each item that gets selected is returned exactly twice when querying/stepping through the selected list using getFirstSelectedItem() and getNextSelectedItem().


Here is the code for item selection.

Code: Select all

   136 /************************************************************************
   137     Get a pointer to the first selected item starting from the given index
   138 ************************************************************************/
   139 ItemEntry* ItemListbox::findSelectedItem(size_t start_index) const
   140 {
   141     size_t max = d_listItems.size();
   142     if (start_index >= max)
   143     {
   144         return 0;
   145     }
   146
   147     for (size_t i=start_index; i<max; ++i)
   148     {
   149         ItemEntry* li = d_listItems[i];
   150         if (li->isSelected())
   151         {
   152             d_nextSelectionIndex = i;
   153             return li;
   154         }
   155     }
   156
   157     return 0;
   158 }
   159
   160 /************************************************************************
   161     Get a pointer to the first selected item
   162 ************************************************************************/
   163 ItemEntry* ItemListbox::getFirstSelectedItem(size_t start_index) const
   164 {
   165     if (!d_multiSelect)
   166     {
   167         return d_lastSelected;
   168     }
   169     return findSelectedItem(start_index);
   170 }
   171
   172 /************************************************************************
   173     Get a pointer to the next selected item using internal counter
   174 ************************************************************************/
   175 ItemEntry* ItemListbox::getNextSelectedItem() const
   176 {
   177     if (!d_multiSelect)
   178     {
   179         return 0;
   180     }
   181     return findSelectedItem(d_nextSelectionIndex);
   182 }


Honestly I wonder how it works at all. To me it looks like this code would just return the same item over and over, so long as the item at d_nextSelectionIndex is already selected. I think findSelectedItem should set d_nextSelectionIndex = i + 1?
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

User avatar
DepletedCache
Just popping in
Just popping in
Posts: 5
Joined: Wed Aug 17, 2011 02:00

Re: Listbox won't allow selection of multiple items

Postby DepletedCache » Fri Aug 19, 2011 19:12

Jamarr wrote:Honestly I wonder how it works at all. To me it looks like this code would just return the same item over and over, so long as the item at d_nextSelectionIndex is already selected. I think findSelectedItem should set d_nextSelectionIndex = i + 1?


I just made that change, setting d_nextSelectionIndex to i+1 instead of just i, recompiled CEGUI and it does fix the issue of each selected item being returned twice.
However, it seems it must be incremented elsewhere, because that caused it to occasionally return only n-1 of n selected items.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Listbox won't allow selection of multiple items

Postby Jamarr » Mon Aug 22, 2011 18:43

DepletedCache wrote:I just made that change, setting d_nextSelectionIndex to i+1 instead of just i, recompiled CEGUI and it does fix the issue of each selected item being returned twice. However, it seems it must be incremented elsewhere, because that caused it to occasionally return only n-1 of n selected items.


Strange. Which of the selected items is it not returning? item-last-selected, last-selected-item, or something else?

If the built-in iteration approach is not working, you could just perform the iteration in client code using ItemListbox::isItemSelected(size_t index) and just iterate from index=0; note that I did not see a method for returning the number if items in the list, so you may need to track that manually. This is essentially what the built-in code does. However, It is a bit inefficient and scales poorly although it does get the job done. If efficiency is important you can always implement a custom-solution that tracks items as they are selected, avoiding the need to iterate the entire list later; and of course it would be nice if such a solution could be incorporated into the CEGUI code ;)

I would at least suggest creating a mantis ticket and linking to this thread so that the CEGUI developers can look into fixing the issues with this class.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests