home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2002 September
/
PCWorld_2002-09_cd.bin
/
Software
/
Topware
/
winamp
/
wa3install-mad.exe
/
Wacs
/
xml
/
library
/
queryedit.m
< prev
next >
Wrap
Text File
|
2002-06-25
|
1KB
|
45 lines
#include <lib/std.mi>
Function sendQuery();
Global Group pgroup;
Global Edit editfield;
Global string lastquery;
System.onScriptLoaded() {
// we only run in groups!
pgroup = getScriptGroup();
if (pgroup == NULL) {
messageBox("queryedit.maki can only run within a group", "Error", 0, "");
return;
}
String id = getToken(getParam(), ";", 0);
editfield = pgroup.findObject(id);
if (editfield == NULL) {
messageBox("queryedit.maki cannot find the edit field (param 0 = " + id + ")", "Error", 0, "");
}
}
editfield.onEnter() {
sendQuery();
}
editfield.onIdleEditUpdate() {
if (lastquery == editfield.getText()) return;
sendQuery();
}
sendQuery() {
String id = getToken(getParam(), ";", 1);
GuiObject queryline = getScriptGroup().findObject(id);
lastquery = editfield.getText();
if (queryline != NULL) {
queryline.setXmlParam("auto", "1");
queryline.setXmlParam("query", lastquery);
} else
messageBox("queryedit.maki cannot find the queryline field (param 1 = " + id + ")", "Error", 0, "");
}