Lpara tObj, cParentSort If vartype(cParentSort)#"C" cParentSort='' Endif Local cSort, i cSort=cParentSort if type('tObj.tabindex')='N' cSort=cSort+right(tran(tObj.tabindex,"@0"),4) endif * rekurzija, vidi pod rekurzija. Do case Case type("tObj.say")="L" && do your changes here If type("tobj.value")#"U" && and here tek=tek+1 Dime this.tabf[tek,2] This.tabf[tek,1]=cSort This.tabf[tek,2]=tObj Endif * the above check means we don't register labels, shapes etc. Case inlist(lower(tObj.baseclass), "pageframe") Local i For i=1 to tObj.pagecount cSort=cSort+ right(tran(i,"@0"),4) This.regobj(tObj.pages[i], cSort) Endfor Case inlist(lower(tObj.baseclass), "container") Local i For i=1 to tObj.controlcount This.regobj(tObj.controls[i], cSort) Endfor Case inlist(lower(tObj.baseclass), "page","column") Local i For i=1 to tObj.controlcount This.regobj(tObj.controls[i], cSort) Endfor Case inlist(lower(tObj.baseclass), "grid") Local i For i=1 to tObj.columncount cSort=cSort+ right(tran(i,"@0"),4) This.regobj(tObj.columns[i], cSort) Endfor EndcIn form's .init, this is all it takes:
Private tek Dime This.tabf[1,2] && has to exist or should be addobject()ed. tek=0 For i=1 To This.ControlCount loObj=This.Controls[i] This.RegObj(loObj) Endfor =Asort(This.tabf, 1)Checking for .say property is the way I know if I got an object from one of my control classes. You'd probably check for PemStatus(tObj, "valid", 5) instead. Of course, in the form's destroy,
For i=1 to alen(this.tabf,1) If TYPE("this.tabf[i,2]")="O" AND not isnull(this.tabf[i,2]) With this.tabf[i,2] If pemstatus(.class, 'destroy',5) .destroy Endif Endw Endif * this.tabf[i,2]=null Endfor This.tabf=.f.