[Solved] Need a 'spreadsheet' style widget...

ZealAddon

19-02-2010 01:22:39

I am trying to create a simple variable watcher window, with 3 collums (variable name, variable type, and variable value), and N rows (to track N variables). It would seem like a MultiList widget would work for this, but I have found a few problems with them. For one, I cant seem to change the text color of the collum 'labels'. And two, I would like to be able to click and edit the 'Variable name' elements and change them at run time, however MultiList elements dont seem to be editable.

Any ideas/suggestions?

my.name

19-02-2010 09:20:29

>> I cant seem to change the text color of the collum 'labels'
setColumnNameAt(0, "#00FF00Green");

ZealAddon

19-02-2010 14:41:18

Ah cool! Maybe multilists will work, I suppose I could add a 'click listener', and have a edit box popup which allows you to edit the "Variable" field.

One last question about multilists - All of the 'insert at' commands seem to take a single index. How does that work when I have a 2d table (with columns AND rows)? For example how do I change the value of the field at column 2, row 7?

ZealAddon

19-02-2010 18:08:57

Ah ok setSubItemNameAt(Column, Row, "") is what I was looking for.

However I am really hating how when I get a value, I have to strip off the #FFFFFF part (since it comes prefixed to ALL my values now). There has to be some other way to set the color of the text...

Altren

19-02-2010 22:58:12

TextIterator::getOnlyText(someString);this will strip all colours.
Also, you probably store some data in that multilist that is not always strings(for example printed integers). You should try using Any. This is data holder attached to all items in most widgets with items(List, ComboBox, Multilist).
//write
multilist->setSubItemDataAt(column, index, someInt);

//read
int data = *multilist->getSubItemDataAt<int>(column, index);