home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ring.yamanashi.ac.jp/pub/pc/freem/action/
/
action.zip
/
baku100.zip
/
baku100
/
Kernel
/
Util
/
TextEditor.tonyu
< prev
next >
Wrap
Text File
|
2005-09-09
|
1KB
|
57 lines
extends Object;
function setTextListener(l) {
flushTextListener();
textListener=l;
subProcess(l);
}
function onSubProcess(l) {
print ("SBP :"+textListener);
while(!isEditing()) suspend();
while(isEditing()) suspend();
flushTextListener();
}
function flushTextListener() {
print ("FTL :"+textListener);
if (textListener) {
textListener.onTextEditComplete(getText());
textListener=null;
}
}
constructor TextEditor () {
x=50;y=50;w=200;h=200;
fontName="élér âSâVâbâN";
fontSize=11;
lines=0;
}
function setPosition(x,y,w,h) {
if (h==0) lines=1; else lines=0;
this.x=x;this.y=y;
this.w=w;this.h=h;
}
function setFont(size,name) {
if (name) fontName=name;
fontSize=size;
}
native _n_edit;
function edit() {
_n_edit(x,y,w,h,fontName,fontSize,lines);
}
native _n_isEditing;
function isEditing() {
return _n_isEditing();
}
native _n_getText;
function getText() {
return _n_getText();
}
native _n_setText;
function setText(s) {
return _n_setText(s);
}