This project is read-only.

use of ListControls

Apr 3, 2011 at 1:38 PM

Hi all,

first of all thank you for writing the framework... xna really needs some more support especially in terms of GUI libraries.

I just started using your framework for a 2d project of my own. I have found some problems though in using the listControl.
I extended your listControl in order to have a control that stores base object IDs (and not only strings) so when i select an item I can retrieve the  associated object.
Maybe it would be a good extension to allow a user to directly stores any kind of object in the control, and having the control simply call the ToString() method on that object when it needs to be displayed.. however it is not a big issue to extend it so it's not that important after all.

Everything works fine except for the selection. I didn't find a lot of documentation and I am not sure I am doing things write, however it seems to me that the list selection is a bit buggy.

First of all when you select something, the eventHandlers are called 2/3 times instead of 1. This is a really annoying bug because it makes the listcontrol almost unusable for what I have to do with my project :(

Second, I am not really getting how the selectedItems list works. I expect it to containa list of indexes representing the selected items in the Item list. However this selectedItem list is sometimes empty when the event is fired, and sometimes not (probably related to the bug described above).

 

As said, maybe I am doing something wrong.. if that is the case, could you provide with a small code example where you use this control and retrieve the selected value? 
If it is really a bug, can we expect a fix really soon?

Thank you again for any help/answer! 

Mar 4, 2012 at 6:32 AM

Hi, I see that you have managed to return the selected item. Mind sharing how'd you implement that? I can't seem to obtain the selected item in the list.

Mar 4, 2012 at 7:59 AM

Oh,i think  managed to return the selected list index.Think i'll make do with it first.