Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: singl line editor control  (Read 1916 times)

0 Members and 1 Guest are viewing this topic.

HIman

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 24
  • Russian adventure !
    • View Profile
    • Home WEB by QSP
singl line editor control
« 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?
« Last Edit: August 24, 2005, 06:49:08 PM by HIman »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: singl line editor control
« Reply #1 on: August 25, 2005, 10:27:25 AM »

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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

HIman

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 24
  • Russian adventure !
    • View Profile
    • Home WEB by QSP
Re: singl line editor control
« Reply #2 on: August 25, 2005, 12:07:53 PM »

In an example wme_demo I have found code intervace\system\avegame.script
Code: [Select]
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?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: singl line editor control
« Reply #3 on: August 25, 2005, 01:28:30 PM »

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.

Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.143 seconds with 24 queries.