Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: RetroJay on Fri 16/03/2012 06:12:01

Title: un-editable textbox woes. [Solved]
Post by: RetroJay on Fri 16/03/2012 06:12:01
Hi Peeps.

Ok. I have created my own load, save, and quit GUI's.
On the load gui I have a text box that when you click on a save from the list appears in this textbox.

The problem is, though, that if the player types anything it goes in to the box (obviously).
I want the textbox to be un-editable and just show a line of text without the player being able to change it.
I understood, by what I was reading, that this line was what I needed:-


txtLoadName.Clickable = false;


Alas. This doesn't work.
I have been trying to use the search to get the answer to this problem but am having probs with it... again. ::)
Tried the Wiki and found the same line as I have been using, to no avail.

Any help would be fantastic.

Jay.
Title: Re: un-editable textbox woes.
Post by: Gilbert on Fri 16/03/2012 06:17:26
There are workarounds, such as forcefully resetting its content in repeatedly_execute[_always]() and the like. Also, txtLoadName.Enable = false may work, but I'm not sure about it.

However, one question:
If that line of text is not supposed to be editable by the player, why don't you use a label instead?
Title: Re: un-editable textbox woes.
Post by: RetroJay on Fri 16/03/2012 06:24:16
Hi Iceboty.

What it's for is the load screen.

I have a Delete button.
when the player selects a game, from the list, they wish to delete the name of that save is displayed in the textbox.

It's just a way, for the player, to confirm that it's the correct save they are about to delete.

Edit:
Ooh! That's close. txtLoadName.Enable = false; works.
Is there a way of clearing the textbox once the game has been deleted, though.

Many thanks.
Jay.
Title: Re: un-editable textbox woes.
Post by: Gilbert on Fri 16/03/2012 06:29:58
Quote from: Iceboty V7000a on Fri 16/03/2012 06:17:26
However, one question:
If that line of text is not supposed to be editable by the player, why don't you use a label instead?

Edited to answer your edit:
To clear the TextBox, just invoke txtLoadName.Text = "";, which is exactly what the example given in the manual entry for the Text property is doing.

Still, why don't you use a label? It has pretty much everything TextBox has, minus the keyboard input capturing part.
Title: Re: un-editable textbox woes.
Post by: RetroJay on Fri 16/03/2012 06:46:42
Sorry.

Yeah. The label idea works aswell. I just tried it.

It has the same prob as the text box, though.
Once the save has been deleted the name is still there until you click on another save.

Is there a way to clear the Label or TextBox once the save has been deleted or to make it display the next save down, even?

Edit:
Damn. this is getting confusing. I finish my message go back and you have already replied.
I will do as you suggest.

Many thanks for your help.

Jay.

Title: Re: un-editable textbox woes.
Post by: Gilbert on Fri 16/03/2012 06:48:54
Well...

Quote from: Iceboty V7000a on Fri 16/03/2012 06:29:58
To clear the TextBox, just invoke txtLoadName.Text = "";, which is exactly what the example given in the manual entry for the Text property is doing.

To change the Text to the name of another save entry, just... change it to the name of another entry.
Title: Re: un-editable textbox woes.
Post by: RetroJay on Fri 16/03/2012 07:21:06
Hi, again, Iceboty

My Load screen works just how I want it to now.

Thank you ever so much for your help. I realy appreciate it.

Jay.