Error : Expected '{' or ':', found 'T' instead.

Started by billarhos, 04 January 2016, 10:48:40

billarhos

Hi Texus and happy new year.
Just download latest tgui from github and run my project with the new built libraries. However, i got this error in DataIO::parse

"Error while parsing input. Expected '{' or ':', found 'T' instead."

This is happening whatever widget i tried to load.

I have change nothing the last three months. I build everything in the way i did.

the block "if (stream.peek() == '#')" is missing in this version of tgui

texus

Happy new year to you too.

I have indeed removed the possibility to start comments with '#' in the theme files because I found out that the symbol was also used to store colors in the form of #00FF00. So you will have to use // instead (both ways were supported earlier).

billarhos

Thanks for the tip...

Here is some code for anybody who want to set select the text into an edit box via code:
pEditBox->focus();
sf::Event::KeyEvent event;
event.alt = false;
vent.shift = false;
event.system = false;
event.control = true;
event.code = sf::Keyboard::A;
pEditBox->keyPressed(event);


hope in the future u add a setTextSelect function to widgets like edit box

texus

Why would you need to select text inside the editbox from your code?

billarhos

Thanks for being interested Texus.

It is a project of mine that is quite demanding on tgui. If u have windows pc, i can make a free version for u (using sentinel hasp key) and send a setup in your email (i don't have it) if u still interested. So u can see yourself where i need this functionality.



texus

Although I'm always interested to see where tgui is used, I'm only asking for a simple explanation on why you need to do this. I'm not going to add a function to edit box if it has no use, but if you can give me a use case then I will add such a select function. The function would be editBox->select(begin index, end index) rather than the setTextSelect that you suggest, but it can do the same. I currently just can't come up with any situation in which you would need such function.

I only use windows when I have to, I'm normally always on linux.

billarhos

ok.
i just made a video that has more to tell u than my mouth have.

https://www.mediafire.com/watch/qeyjlpfauy94kwk/Demo.avi
tip:
On sixth edit box when the key 'enter'  is pressed the "amount" edit box text is setting selected.
This is helping speeding up the whole process!

texus

That is indeed a good enough reason. Since exact control about what is being selected isn't really needed, I will just add a selectText() function which will select the entire text of the edit box. I still have to study a bit and I'm also working on adding a built-in font in tgui, so I'll add the function after that. So you can expect it in several hours or otherwise tomorrow.

billarhos

#8
To be honest i made a similar function by just borrowing the code from "ctrl+A" from keyPressed function. On second thoughts i remove it and implemented with the code in previous post.

Do not bother to finish it quickly. I am glad that u will add this.
When i 'll finish my project i will share all my ideas for tgui. U will be surprized for what tgui can do!

And please correct the tip on facebook-twitter (switch) when hovering mouse on forum site!! ha!

texus

The selectText function has been added in the latest version. If I don't do small changes like this right away then it would probably be forgotten.

QuoteAnd please correct the tip on facebook-twitter (switch) when hovering mouse on forum site!! ha!
Haha, nice catch. I have fixed it now but the old css file will still remain cached for a while.