自定义Form作为Dialog
Job:
1 static void testDialogJob(Args _args) 2 { 3 testDialogClass testDialogClass ; 4 ; 5 testDialogClass = new testDialogClass() ; 6 info(testDialogClass.mystr()) ; 7 }
Class:
1 class testDialogClass 2 { 3 str mystr ; 4 } 5 void new() 6 { 7 Args args = new Args(); 8 FormRun formRun; 9 ; 10 args = new Args(FormStr('testdialogform')); 11 args.parmObject(this); 12 formRun = classFactory.formRunClass(args); 13 formRun.init(); 14 formRun.run() ; 15 formRun.wait(); 16 } 17 //访问变量的方法 18 public str mystr(str _str = mystr) 19 { 20 ; 21 mystr = _str ; 22 return mystr ; 23 }
Form:
1 public class FormRun extends ObjectRun 2 { 3 testdialogclass testdialogclass ; 4 } 5 public void init() 6 { 7 super(); 8 testdialogclass = this.args().parmObject(); 9 } 10 public boolean modified() 11 { 12 boolean ret; 13 ret = super(); 14 testdialogclass.mystr(StringEdit.text()); 15 return ret; 16 }