Questions

Started by Law, 10 August 2014, 14:47:07

Law

1. I see thanks.
2. Okay never mind.
3. Well I was planning to make 4 ListBoxes (A, B, C and D), and given other options, double clicking an Item of ListBox A would add that Item to ListBox B, C or D. Also, I was thinking of deleting the Item if you double click it in ListBox B, C and D.

texus

Double click callback in ListBox sounds reasonable. I'll see if I can add it.

Law

Something I just encountered, I don't know if that is easy for you to fix, but the text wrapper of TextBoxes cuts words in half.

Also, that just crossed my mind: ListBox B, C and D I mentionned earlier will actually be Grids. Each line will countain the name of the Item I double clicked, but also the number of times I double clicked it, on its left. For example

2 Item_2345
1 Item_697
3 Item_5409

etc. I don't know if you could do that with Grids too.

texus

TextBox isn't supposed to work yet. The first preview of v0.7 that I send had the class entirely commented out. But when I send the fix with these combo boxes I was too lazy to do that again. The code in TextBox is being entirely rewritten.
TextBox is kindof useless until I'm finished with it. I think it already exists since v0.4 but the performance is too bad to actually use it. I hope to have it rewritten and fully usable by the end of next week.

The double click will only work in list boxes. But since ListBox A is still a list box this is no problem.
You can use grids for the others, just put Label widgets in them to contain the text.

Law

I look forward to v0.7 then.

Quote from: texus on 22 August 2014, 14:23:07
The double click will only work in list boxes. But since ListBox A is still a list box this is no problem.
You can use grids for the others, just put Label widgets in them to contain the text.
I'll just have to find another way to delete Items in Grid B, C and D then Q_Q

texus

QuoteI'll just have to find another way to delete Items in Grid B, C and D then
I'll just have to add double click to labels too :)

texus

This version has a LeftMouseDoubleClicked callback in both ListBox and Label:
https://www.dropbox.com/s/cai8p2j1j2vhldr/texus-tgui-devel-aef1e62a6d20.zip

Ignore the warnings when you compile it, its all from TextBox because half of its code is still in comments.
(at least your text will display nicely in it, since word wrap is already implemented. All the rest just isn't)

In order to remove the item which you double click on in the list box, you can call listBox->removeItemByIndex(callback.value).
Removing from a Grid has to be done manually and costs a lot more work.

texus

The v0.7-dev branch is now public here: https://github.com/texus/TGUI/tree/v0.7-dev

The TextBox is fully rewritten there.