Copy link to clipboard
Copied
In this script I create a window with an Edittext field and two buttons. The user can write something in Edittext field. How to read these data? I want to use it like a pattern in regular expressions.
I made an Edittext field a variable. How to transmit the data from it?
function SnpCreateDialog()
{
this.windowRef = null;
}
SnpCreateDialog.prototype.run = function()
{
// Create a window of type palette.
var win = new Window("palette", "Поиск",[100,100,400,250]); // bounds = [left, top, right, bottom]
this.windowRef = win;
// Add a frame for the contents.
win.pnl = win.add("panel", [25,15,275,135], "Введите данные для поиска");
// Add the components, two buttons
var txt = win.pnl.add("edittext", [15,25,230,45],"");
//win.pnl.txt = win.pnl.add("edittext", [15,25,230,45],"");
win.pnl.okBtn = win.pnl.add("button", [15,75,105,95], "OK");
win.pnl.cancelBtn = win.pnl.add("button", [140, 75, 230, 95], "Cancel");
// Register event listeners that define the button behavior
var re = new RegExp(pattern);
win.pnl.okBtn.onClick = function() {
$.writeln("OK pressed");
alert(re);
//win.close();
};
win.pnl.cancelBtn.onClick = function() {
$.writeln("Cancel pressed");
win.close();
};
// Display the window
win.show();
return true;
//var re = new RegExp (txt);
//alert(re);
}
if(typeof(SnpCreateDialog_unitTest) == "undefined") {
new SnpCreateDialog().run();
}
Use:
win.pnl.txt = win.pnl.add("edittext", [15,25,230,45],"");
And then in the OK BTN function:
var value = this.parent.txt.text;
Greet,
Willam
Copy link to clipboard
Copied
Charlotte
This isn't the place to ask that question, unless you are very lucky. Most of the folks in this forum are technical authors whose job is to document how software works for end users or to create knowledge bases. Relatively few will use regular expressions in any way and even fewer will write scripts. Some will but very few and even fewer are active supporters of the forum.
I think you will do much better Googling "regex forums" and trying somewhere like http://regexadvice.com/forums/
Good luck with your diploma project.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Use:
win.pnl.txt = win.pnl.add("edittext", [15,25,230,45],"");
And then in the OK BTN function:
var value = this.parent.txt.text;
Greet,
Willam
Copy link to clipboard
Copied
@Willam - LOL - I was just about to reply to the OP and tell her that "you need to have a chat with Willam"!
Copy link to clipboard
Copied
Sometimes I can read minds.
Greet,
Willam
Copy link to clipboard
Copied
Thank you very much!