Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: HIman on August 24, 2005, 06:38:03 PM
-
Hello,
And it is possible to show a small example how to work with a line,
read, write, erase
for singl line editor control?
-
Well, the editor control provides the .Text property, which is a normal string. You can manipulate strings using the methods in the String() object. Check the docs for more details.
-
In an example wme_demo I have found code intervace\system\avegame.script
self.xResult = false;
if(self.xDescription!=null)
{
var Editor = self.GetWidget("desc");
Editor.Text = self.xDescription;
Editor.SelStart = 0;
Editor.SelEnd = 1000;
}
self.xDescription = "";
Other way to take the text is not present? Only so?
If yes, I could not find in the documentation
xResult
xDescription
And how to null a line if there the text has already been entered?
-
This code you posted comes from the window for entering savegame description. The xResult and xDescription properties are used as "parameters" of the window, i.e. the script calling the window first fills-in the DescWindow.xDescription, then displays the window. And after the player closes the window, the DescWindow.xResult property is filled with "true" if he clicked "OK".
These preudo-properties are NOT related to the editor control and they are NOT standard WME properties. They are custom properties only used in this single script. That's why you won't find them in the documentation.
But back to your question, you simply set the text in the editor control by calling:
Editor.Text = "some text";
Or if you want to empty the editor, simply call:
Editor.Text = "";
And, of course, you read the text the other way around:
var SomeVariable = Editor.Text;
There's nothing complicated about it.