|
以下是通过form工具生成的form代码!发现一个问题!
当程序按下OK时,在allegro中输出为:*****OK*******
但是当关闭此插件时在allegro中输出也是:*****OK*******
执行的两个地方如图所示!!
求大神帮助!!!!- axlCmdRegister("zz1" 'my_form)
-
- (defun my_form ()
- time = getCurrentTime()
- time = parseString(time)
- day = nth(1 time)
- month = car(time)
- month = upperCase(month)
- year = nth(3 time)
- date = strcat(" Date: " day " " month " " year)
- CreateForm()
- myform=axlFormCreate( (gensym) form_file nil 'Form_Action t)
- axlFormDisplay(myform)
- axlUIWPrint(myform date)
- )
- (defun CreateForm ()
- drain()
- form_file = "creat_shape1_form.form"
- myform = outfile(form_file "w")
- fprintf(myform "#Created by xml2bnf perl utility\n")
- fprintf(myform "#Coded by Venkata Ramanan/Santa Clara, CA\n\n")
- fprintf(myform "FILE_TYPE=FORM_DEFN VERSION=2\n")
- fprintf(myform "FORM AUTOGREYTEXT\n")
- fprintf(myform "FIXED\n")
- fprintf(myform "PORT 28 24\n")
- fprintf(myform "HEADER \"Form Field Type Demo\"\n\n")
- fprintf(myform "POPUP <ENUM>\"ITEM1\"\"0\",\"ITEM2\"\"1\",\"ITEM3\"\"2\",\"LAST ONE\"\"3\".\n\n")
- fprintf(myform "TILE\n\n")
- fprintf(myform "## Button Field in FORM ## \n")
- fprintf(myform "FIELD OK\n")
- fprintf(myform "FLOC 5 17\n")
- fprintf(myform "MENUBUTTON \"OK\" 8 3\n")
- fprintf(myform "FGROUP \"Form1\"\n")
- fprintf(myform "ENDFIELD \n\n")
- fprintf(myform "## Button Field in FORM ## \n")
- fprintf(myform "FIELD Exit\n")
- fprintf(myform "FLOC 15 17\n")
- fprintf(myform "MENUBUTTON \"Exit\" 8 3\n")
- fprintf(myform "FGROUP \"Form1\"\n")
- fprintf(myform "ENDFIELD \n\n")
- fprintf(myform "ENDTILE\n\n")
- fprintf(myform "ENDFORM\n\n")
- close(myform)
- )
- (defun Form_Action (myform)
- (let (t1 item index field cnt)(printf "field/value %L = %L (int %L\n)"
- myform->curField myform->curValue, myform->curValueInt )
- (printf "doneState %L\n" myform->doneState )
- case(myform->curField
- ("OK"
- printf("*****OK*******")
- ;Button Field
- ;Enter Action Here
-
- )
- ("Exit"
- axlFormClose(myform)
- ;Button Field
- ;Enter Action Here
-
- )
- )
- )
- if((nequal myform->doneState 0)
- axlFormClose(myform))
- )
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|