|
For example:All Controls in the window are Existent,Theis "name","age","sex" editboxes are editable others are non-editable when click "edit" button
function checkeditable(ButtonId)
dim objChild,objDesc
dim editboxname(2)
editboxname(0)="name"
editboxname(1)="age"
editboxname(2)="sex"
set objDict=Description.create()
objDict."micclass"="Javaedit"
set objChild=javawindow("xxx").Childobjects(objDic)
select case cint(ButtonID)
case 1
javawindow("xxx").javabutton("Inquire").click
k=0
for i=0 to objChild.count-1
if objChild(i).checkproperty("editable",1,1) then
k=k+1
end if
next
if k=0 then
msgbox "all editboxes are non-editable "
else
msgbox "Error"
end if
case 2
javawindow("xxx").javabutton("edit").click
for i=0 to objChild.count-1
for k=0 to ubound(editboxname)
if objChild(i).getroproperty("editname")=editboxname(k) and objChild(i).checkproperty("editable",1,1) then
msgbox "the"&editboxname(k)&"is editable "
else if objChild(i).getroproperty("editname")=editboxname(k) and objChild(i).checkproperty ("editable",0,1) then
msgbox "the"&editboxname(k)&"is non-editable "
else if objChild(i).getroproperty("editname")<>editboxname(k) and objChild(i).checkproperty ("editable",0,1) then
msgbox "the "&objChild(i).getroproperty("editname")&"is non-editable "
else if objChild(i).getroproperty("editname")<>editboxname(k) and objChild(i).checkproperty ("editable",1,1) then
msgbox "the "&objChild(i).getroproperty("editname")&"is editable "
next
next
case else
msgbox "wrong prm"
end select
end function |
|