PROGRAM CheckBox_Sizes; {-- *************************************************************************** -- ** Descr. : A simple script that loops through all Forms Items and looks -- ** for to small checkbox widths that might render not nice when -- ** deployed over the internet. -- *************************************************************************** -- ** 03/12/01 1.001.00 Initial Creation, muellers@orcl-toolbox.com -- ** 28/12/01 1.002.00 replace legacy code with new formsapi helper functions, muellers@orcl-toolbox.com -- ***************************************************************************} var ps : TParamScreen; pb : TParamBoard; i,j : number; frm : number; ts : tstringlist; shortname : varchar2; formsname : varchar2; filename : varchar2; fname : varchar2; itmlist : tstringlist; BEGIN ps := TParamScreen.create; pb := ps.AddBoard('Analyze too small checkboxes',picOptions); pb.addparam(parLabel,'MYLABEL','Please select the basepath of the modules that you wish to analyze for to small checkboxes:','',''); pb.addparam(parPathname,'MYPATH','Basepath','w:\formsapi master',''); pb.addparam(parLabel,'MYLABEL2','... and specify the filename for the results:','',''); pb.addparam(parsaveFilename,'P_LOGSAVE','Log Filename','c:\small_checkboxes.txt',''); pb.addparam(parLabel,'MYDBLAB','Connection to use:','',''); pb.addparam(parDatabaseLogon,'MYDB','Database','keyowner/ty12@ty12',''); if ps.ShowParamScreen('') then begin fname := ps.paramvalue('P_LOGSAVE'); deletefile(fname); ts := GetFileList(ps.paramvalue('MYPATH') ,'*.fmb', true); logadd('number of objects: '+to_char(ts.count)); api_connect(ps.paramvalue('MYDB')); for i := 0 to ts.count-1 do begin try filename := ts.strings[i]; frm := api_loadmodule(filename); formsname := api_getobjectname(frm); shortname := rpad(extractfilename(filename),20); logadd(filename+' ('+to_char(i+1)+'/'+to_char(ts.count)+')'); itmlist := api_getallitemObjects(frm); for j := 0 to itmlist.count-1 do begin if generic_GetNumProp(itmlist.objects[j], D2FP_ITM_TYP) = D2FC_ITTY_CB then if generic_GetNumProp(itmlist.objects[j], D2FP_width) <22 then saveappendstring( api_GetObjectPath(itmlist.objects[j])+ ' [checkbox smaller than 22!]'+c_cr ,fname); end; itmlist.free; api_destroymodule(frm); except logadd('Error loading '+filename,logerror); end; end; api_disconnect; ts.free; host('notepad.exe '+fname,false); end else begin logadd('pressed cancelbutton on parameterscreen!'); end; ps.free; END.