Error : Expected '{' or ':', found 'T' instead.
« on: 04 January 2016, 10:48:40 »
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
« Last Edit: 04 January 2016, 10:54:38 by billarhos »

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #1 on: 04 January 2016, 11:09:46 »
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).

Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #2 on: 04 January 2016, 18:47:40 »
Thanks for the tip...

Here is some code for anybody who want to set select the text into an edit box via code:
Code: [Select]
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

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #3 on: 04 January 2016, 18:49:13 »
Why would you need to select text inside the editbox from your code?

Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #4 on: 04 January 2016, 19:06:16 »
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

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #5 on: 04 January 2016, 19:16:21 »
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.

Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #6 on: 04 January 2016, 19:32:07 »
ok.
i just made a video that has more to tell u than my mouth have.

http://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

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #7 on: 04 January 2016, 19:40:35 »
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.

Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #8 on: 04 January 2016, 19:54:37 »
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!
« Last Edit: 04 January 2016, 19:57:29 by billarhos »

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Error : Expected '{' or ':', found 'T' instead.
« Reply #9 on: 04 January 2016, 20:21:30 »
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.

Quote
And 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.