|
如题所示,我想建一个这样的form,现在有一个问题是,form的显示是采用自动抓取的方式,但是我无法定义输入框的操作。
本人是菜,求指教!!
所写代码如下:
axlCmdRegister("zz1" 'CreateShape)
procedure(CreateShape()
let((CreateShapefile Dmyform)
CreateShapefile = axlTempFile()
Dmyform = outfile(CreateShapefile "w")
if(car(axlDBGetDesignUnits())=="mils" then
ZUnit = "mil"
else ZUnit ="mm"
);if
fprintf(Dmyform "#Created by xml2bnf perl utility\n")
fprintf(Dmyform "#Coded by Venkata Ramanan/Santa Clara, CA\n\n")
fprintf(Dmyform "FILE_TYPE=FORM_DEFN VERSION=2\n")
fprintf(Dmyform "FORM AUTOGREYTEXT\n")
fprintf(Dmyform "FIXED\n")
fprintf(Dmyform "PORT 70 34\n")
fprintf(Dmyform "HEADER \"Form Field Type Demo\"\n\n")
fprintf(Dmyform "POPUP <ENUM>\"ITEM1\"\"0\",\"ITEM2\"\"1\",\"ITEM3\"\"2\",\"LAST ONE\"\"3\".\n\n")
fprintf(Dmyform "TILE\n\n")
n_layer=axlGetXSection()
nbLayer = length(n_layer)
p = axlGetParam("paramLayerGroup:ETCH")
l_layer = p->groupMembers
; p = axlGetParam("paramLayerGroup:ETCH")
; l_layer = p->groupMembers
; print(l_layer)
; nblayer = p->nChildren
declare(layer[nbLayer])
declare(xw[nbLayer])
arrayp(layer)
arrayp(xw)
/* for(lay 0 nbLayer-1
layer[lay] = nth(lay l_layer)
name = layer[lay]
xw[lay] = nth(lay l_layer)
xWidth = xw[lay]
; xWidth = xWidth1[lay]
; print(layer[lay])
printf("-----%s-----\n" xWidth)
i = (lay+1)*2
; if(mod(lay+1 1)==0 then
*/
for(lay 0 nbLayer/2-1
layer[lay] = nth(lay l_layer)
name = layer[lay]
xw[lay] = nth(lay l_layer)
xWidth = xw[lay]
; print(layer[lay])
printf("-----%s-----\n" xWidth)
i = (lay+1)*2
;if(mod(lay-1 2)==0 then
; printf("****nbLayer=%d****\n" nbLayer);test
; printf("****lay=%d****\n" lay);test
fprintf(Dmyform "## Text Field in Form## \n")
fprintf(Dmyform "TEXT \"%s :\" \n" name)
; fprintf(Dmyform "TEXT name \n" ) ;right
fprintf(Dmyform "FLOC 2 %d\n" i)
fprintf(Dmyform "TGROUP \"Form1\"\n")
fprintf(Dmyform "ENDTEXT\n\n")
fprintf(Dmyform "TEXT Width \n" )
fprintf(Dmyform "FLOC 14 %d\n" i)
fprintf(Dmyform "TGROUP \"Form1\"\n")
fprintf(Dmyform "ENDTEXT\n\n")
fprintf(Dmyform "FIELD %s \n" xWidth)
fprintf(Dmyform "FLOC 20 %d\n" i)
fprintf(Dmyform "FSIZE 5 4\n")
fprintf(Dmyform "STRFILLIN 5 5\n")
fprintf(Dmyform "ENDFIELD \n\n\n")
fprintf(Dmyform "## Text Field in Form## \n")
fprintf(Dmyform "TEXT \"%s\"\n" ZUnit)
fprintf(Dmyform "FLOC 32 %d\n" i)
fprintf(Dmyform "TGROUP \"Form1\"\n")
fprintf(Dmyform "ENDTEXT\n\n")
;);if
);for
fprintf(Dmyform "## Button Field in FORM ## \n")
fprintf(Dmyform "FIELD OK\n")
fprintf(Dmyform "FLOC 9 27\n")
fprintf(Dmyform "MENUBUTTON \"OK\" 14 3\n")
fprintf(Dmyform "FGROUP \"Form1\"\n")
fprintf(Dmyform "ENDFIELD \n\n")
fprintf(Dmyform "## Button Field in FORM ## \n")
fprintf(Dmyform "FIELD Exit\n")
fprintf(Dmyform "FLOC 33 27\n")
fprintf(Dmyform "MENUBUTTON \"Exit\" 14 3\n")
fprintf(Dmyform "FGROUP \"Form1\"\n")
fprintf(Dmyform "ENDFIELD \n\n")
fprintf(Dmyform "ENDTILE\n\n")
fprintf(Dmyform "ENDFORM\n\n")
close(Dmyform)
myform = axlFormCreate(gensym() CreateShapefile '("NE" "msglines" 0) 'CreateShapefileAction t nil)
axlFormDisplay(myform)
axlFormSetField(myform "sub_menuclass" 1)
when(isFile(CreateShapefile)
deleteFile(CreateShapefile)
)
)
for(lay 0 nbLayer/2-1
xw[lay] = nth(lay l_layer)
xWidth = xw[lay]
if( boundp('xxs)==nil then
xxs = "30"
)
axlFormSetField(myform xWidth xxs)
printf("*****%s*****\n" xWidth )
)
; for(lay 0 nbLayer-1
; layer[lay] = nth(lay l_layer)
; name = layer[lay]
; xWidth = xWidth1[lay]
/* if( boundp('xxs)==nil then
xxs = "30"
yys = "30"
rrs = "20"
)
axlFormSetField(myform "xWidth" xxs)
axlFormSetField(myform "yLength" yys)
axlFormSetField(myform "rCurved" rrs)
*/
; )
)
procedure(n()
let(n( ) ;xWidthNumber yLengthNumber rCurvedNumber
case(myform->curField
; 现在主要是这里的设定不知道应该怎么做,比如说和之前一样自动定义每一个输入框
/*
("GND1"
;for(i 0 nbLayer/2-1
;printf("+++++++++%s++++++++++++++" xxs)
xxs=myform->curValue
printf("+++++++++%s++++++++++++++" xxs)
;Input Field
;Enter Action Here
)
*/
("OK"
;Button Field
;Enter Action Here
)
("Exit"
axlFormClose(myform)
;Button Field
;Enter Action Here
)
)
)
)
procedure(DiplayExit()
axlFormClose(Dmyform)
)
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|