.需要自己布局,自己动脑
.下面是仿iapp代码补全辅助工具
ss gbwz0=0
.ug(xbx.19,"text",txjq2)
//xbx.19为编辑框的id
s txjq2=st_sS
sss txjq=txjq2
sr(txjq2,"\n","щ",txjq)
ug(xbx.19,"selectionstart",gbwz)
ss gbwz0=gbwz
ssg(txjq,0,gbwz,jq)
sss jq=jq
s zf=","={}><(); -*!|/:?&\#@$p[]_щ "
s zkh="("
s ykh=")"
sss gbwz=gbwz
t()
{
w(ss.gbwz0>0)
{
s-(ss.gbwz0,1,ss.gbwz0)
s-(ss.gbwz0,1,gbwz1)
ssg(jq,ss.gbwz0,gbwz,jq2)
ssg(jq,gbwz1,ss.gbwz0,jq3)
f(jq3==null)
{
s jq3=" "
}
sss jq2=jq2
f(zf?jq3&&zf!="")
{
sss gbwz0=ss.gbwz0
ss gbwz0=0
f(jq2!=zhk&&jq2!=ykh&&jq2!=" ")
{
fn ss.tx(jq2)
}
else f(jq2!=zhk||jq2!=ykh||jq2!=" ")
{
ufnsui()
{
us(xbx.87,"visibility","gone")
//xbx.87为显示在右上角那个列表控件
}
}
}
}
}
写入ss.myu模块里
fn tx(ssgj)
ufnsui()
{
us(xbx.87,"visibility","gone")
}
ula(ssjg, "clear")
s sslj="@function/"
ss(sslj "fix.txt",ssnr1)
//要搜索的函数表
fr(ssnr1,nr1)
s fh="sl(nr1,fh,sc1)
s ssjg=null
s ssjl=0
t()
{
f(ssgj=="")
{
.tw("输入不能为空")
}
else
{
for(sd1;sc1)
{
sj(sd1,"「","」",hsj)
sj(sd1,"《","》",hsdm)
sj(sd1,"〖","〗",hsys)
f(hsdm?*ssgj)
{
s (ssjl,1,ssjl)
ula(ssjg,2=hsdm,3=hsys,-1=hsj)
}
}
f(ssjl>=5)
{
s w="200dp"
}
else
{
s h=-2
}
us(xbx.87,"height",h)
f(ssjl!=0)
{
ufnsui()
{
us(xbx.87,"visibility","visible")
uls(xbx.87,ssjg,"zdtxlb.iyu",-1,-2)
}
}
else
{
ufnsui()
{
us(xbx.87,"visibility","gone")
.tw("无匹配")
}
}
}
}
显示到右上角列表的单击项目事件
ulag(st_vW,st_pN,2,cr)
ulag(st_vW,st_pN,-1,ts)
s bjk=sss.bjk
ug(bjk,"selectionstart",dqgb)
f(sss.gbwz==dqgb)
{
sr(sss.jq2,"щ","\n",jq2x)
sr(sss.jq,"щ","\n",jqx)
slg(cr,jcd)
s (sss.gbwz0,jcd,szgb)
ss(jq2x "@jsmjq",jq2)
ss(jqx "@jsmjq",jq)
sr(sss.txjq,jqx,jq,zbcr)
sr(zbcr,jq2,cr,wccr)
us(bjk,"text",wccr)
us(bjk,"selection",szgb)
}
else
{
fn charu.cr(cr)
//这里是插入文本模块,前面貌似讲过
}
tw(ts)
us(st_vW,"visibility","gone")
.作者:嘻嘻哈哈走过去