home *** CD-ROM | disk | FTP | other *** search
- <<title Object Definitions Library>>
- <<uicode>>
-
- function pgheader
- param pgnumber
- private ldate,lfile,lpage,lline
- if ! (pgnumber < 2)
- ?
- endif
- ldate = ampm({time})+", {date}"
- lfile = upper(trim(wwfile))
- lpage = "Page {pgnumber}"
- lline = ldate+space(40-((len(lfile)/2)+len(ldate)) )+lfile
- lline = lline+space(80-(len(lline)+len(lpage)))+lpage
- ? lline
- ?
- ?
- lnctr = 4
- return(pgnumber+1)
-
- function environment
- sectheader("Environment",0)
- ? align("Flavor : "+;
- iif(db3,"dBASE III",iif(db3plus,"dBASE III Plus","Clipper")),32)
- ? align("MRD Calls : "+iif(mrd,"Enabled","Disabled"),32)
- ? align(".WW Directory : "+upper(trim(wwdir)),32)
- ? align(".DBF Directory : "+upper(trim(dbfdir)),32)
- ? align(".TEM Directory : "+upper(trim(temdir)),32)
- ? align(".PRG Directory : "+upper(trim(gendir)),32)
- ?
- lnctr = lnctr + 7
- return
-
- function objsummary
- sectheader("Object Summary",0)
- ? align("Databases Used : {number_of_dbfs()}",32)
- ? align("Indexes Referenced : {number_of_indexes()}",32)
- ? align("Fields : {number_of_fields()}",32)
- ? align("Memory Variables : {number_of_memvars()}",32)
- ? align("Variables Total : {number_of_vars()}",32)
- ? align("Boxes Defined : {number_of_boxes()}",32)
- ? align("Options Defined : {number_of_options()}",32)
- ?
- lnctr = lnctr + 8
- return
-
- function scrdump
- private row,delim1,delim2
- sectheader("Screen Image",0)
- delim1 = " 1 2 3 "+;
- "4 5 6 7"
- delim2 = "01234567890123456789012345678901234567890"+;
- "123456789012345678901234567890123456789"
- ? delim1
- ? delim2
- for row = 0 to 24
- ? text_at(row,0)
- endfor
- ? delim2
- ? delim1
- ?
- lnctr = lnctr + 30
- return
-
- function dbfsummary
- private dbflimit,dptr
- sectheader("Database Summary",0)
- if ! (number_of_dbfs() > 0)
- ? " < No Databases Defined >"
- ?
- lnctr = lnctr + 2
- return
- endif
- dptr = 1
- do while ! (dptr > number_of_dbfs())
- if (lnctr > 48)
- ? chr(12)
- pgctr = pgheader(pgctr)
- sectheader("Database Summary",1)
- ?
- lnctr = lnctr + 1
- endif
- ? align("Database : {upper(dbf_array[dptr].name)}",32)
- ? align("Alias : {dbf_array[dptr].alias}",32)
- ? align("Select Area : {dbf_array[dptr].area}",32)
- ? align("Fields Referenced : {dbf_array[dptr].refs}",32)
- lineout = align("Field List : ",32)
- cmpstr = upper(trim(dbf_array[dptr].name))
- fldlimit = number_of_fields()
- fptr = 1
- do while ! (fptr > fldlimit)
- if (upper(trim(field_array[fptr].dbf)) = cmpstr)
- if (len(lineout) > 68)
- ? substr(lineout,1,len(lineout)-1)
- lineout = space(33)
- lnctr = lnctr + 1
- endif
- lineout = "{lineout}{field_array[fptr].name},"
- endif
- fptr = fptr + 1
- enddo
- ? substr(lineout,1,len(lineout)-1)
- ?
- lnctr = lnctr + 6
- dptr = dptr + 1
- enddo
- return
-
- function idxsummary
- private iptr,tmp,lineout
- sectheader("Index Summary",0)
- if ! (number_of_indexes() > 0)
- ? " < No Indexes Defined >"
- ?
- lnctr = lnctr + 2
- return
- endif
- ? "Index Expression"
- ?
- lnctr = lnctr + 2
- iptr = 1
- do while ! (iptr > number_of_indexes())
- if lnctr > 58
- ? chr(12)
- ? pgctr = pgheader(pgctr)
- sectheader("Index Summary",1)
- ? "Index Expression"
- ?
- lnctr = lnctr + 2
- endif
- tmp = upper(trim(stripdir(index_array[iptr].name)))
- lineout = substr(tmp+space(13),1,13)
- tmp = trim(index_array[iptr].expr)
- lineout = lineout+substr(tmp,1,min(56,len(tmp)))
- ? lineout
- lnctr = lnctr + 1
- iptr = iptr + 1
- enddo
- return
-
- function fldsummary
- private noapp,fptr,tmp,lineout
- if (lnctr > 40)
- ? chr(12)
- pgctr = pgheader(pgctr)
- endif
- sectheader("Fields Summary",0)
- if ! (number_of_fields() > 0)
- ? " < No Fields Defined >"
- ?
- lnctr = lnctr + 2
- return
- endif
- * 1 2 3 4 5 6
- * 123456789012345678901234567890123456789012345678901234567890123456789
- ? "Field Type Len Dec Status Row Col Box Database Alias"
- ?
- noapp = replicate(chr(196),3)
- fptr = 1
- do while ! (fptr > number_of_fields())
- if lnctr > 54
- ? chr(12)
- pgctr = pgheader(pgctr)
- sectheader("Fields Summary",1)
- ?
- ? "Field Type Len Dec Status Row "+;
- "Col Box Database Alias"
- ?
- lnctr = lnctr + 3
- endif
- lineout = upper(trim(field_array[fptr].name))+space(14)
- lineout = substr(lineout,1,12)+field_array[fptr].type+space(3)
- tmp = "{field_array[fptr].len}"
- lineout = lineout+space(3-len(tmp))+tmp
- tmp = "{field_array[fptr].dec}"
- lineout = lineout+space(4-len(tmp))+tmp+space(2)+;
- iif(field_array[fptr].input,"Input","Display")+space(10)
- tmp = "{field_array[fptr].row}"
- lineout = substr(lineout,1,34)+space(3-len(tmp))+tmp
- tmp = "{field_array[fptr].col}"
- lineout = substr(lineout,1,38)+space(4-len(tmp))+"{tmp} "
- tmp = trim(field_array[fptr].owner)
- lineout = lineout+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
- noapp,tmp)+space(11)
- tmp = upper(trim(stripdir(field_array[fptr].dbf)))
- lineout = substr(lineout,1,54)+tmp+space(11)
- tmp = trim(field_array[fptr].alias)
- lineout = substr(lineout,1,67)+iif(len(tmp) > 0,noapp,tmp)
- ? lineout
- lnctr = lnctr + 1
- if detail
- tmp = trim(field_array[fptr].init_val)
- ? " Initial Value : "+iif((len(tmp) < 1 .or. ;
- ctrl_in_str(tmp)),"<undef>",tmp)
- tmp = trim(field_array[fptr].picture)
- ? " Picture Clause : "+iif((len(tmp) < 1 .or.;
- ctrl_in_str(tmp)),"<undef>",iif(len(tmp)>56,;
- substr(tmp,1,52)+"..."+chr(34),tmp))
- tmp = trim(field_array[fptr].valid)
- ? " Valid Clause : "+iif((len(tmp) < 1 .or. ;
- ctrl_in_str(tmp)),"<undef>",tmp)
- tmp = trim(field_array[fptr].range)
- ? " Range Clause : "+iif((len(tmp) < 1 .or.;
- ctrl_in_str(tmp)),"<undef>",tmp)
- tmp = trim(field_array[fptr].slot1)
- lnctr = lnctr + 4
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Field Slot 1 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- tmp = trim(field_array[fptr].slot2)
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Field Slot 2 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- tmp = trim(field_array[fptr].slot3)
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Field Slot 3 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- ?
- lnctr = lnctr + 1
- endif
- fptr = fptr + 1
- enddo
- return
-
- function memsummary
- private noapp,mptr,tmp,lineout
- if (lnctr > 40)
- ? chr(12)
- pgctr = pgheader(pgctr)
- endif
- sectheader("MemVar Summary",0)
- if ! (number_of_memvars() > 0)
- ? " < No MemVars Defined >"
- ?
- lnctr = lnctr + 2
- return
- endif
- * 1 2 3 4 5 6
- * 123456789012345678901234567890123456789012345678901234567890123456789
- ? "Variable Type Len Dec Status Row Col Box"
- ?
- noapp = replicate(chr(196),3)
- mptr = 1
- do while ! (mptr > number_of_memvars())
- if lnctr > 54
- ? chr(12)
- pgctr = pgheader(pgctr)
- sectheader("MemVar Summary",1)
- ?
- ? "Variable Type Len Dec Status Row Col Box"
- ?
- lnctr = lnctr + 3
- endif
- lineout = upper(trim(memvar_array[mptr].name))+space(14)
- lineout = substr(lineout,1,12)+memvar_array[mptr].type+space(3)
- tmp = "{memvar_array[mptr].len}"
- lineout = lineout+space(3-len(tmp))+tmp
- tmp = "{memvar_array[mptr].dec}"
- lineout = lineout+space(4-len(tmp))+tmp+space(2)+;
- iif(memvar_array[mptr].input,"Input","Display")+space(10)
- tmp = "{memvar_array[mptr].row}"
- lineout = substr(lineout,1,34)+space(3-len(tmp))+tmp
- tmp = "{memvar_array[mptr].col}"
- lineout = substr(lineout,1,38)+space(4-len(tmp))+"{tmp} "
- tmp = trim(memvar_array[mptr].owner)
- lineout = lineout+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
- noapp,tmp)+space(11)
- ? lineout
- lnctr = lnctr + 1
- if detail
- tmp = trim(memvar_array[mptr].init_val)
- ? " Initial Value : "+iif((len(tmp) < 1 .or. ;
- ctrl_in_str(tmp)),"<undef>",tmp)
- tmp = trim(memvar_array[mptr].picture)
- ? " Picture Clause : "+iif((len(tmp) < 1 .or.;
- ctrl_in_str(tmp)),"<undef>",iif(len(tmp)>56,;
- substr(tmp,1,52)+"..."+chr(34),tmp))
- tmp = trim(memvar_array[mptr].valid)
- ? " Valid Clause : "+iif((len(tmp) < 1 .or. ;
- ctrl_in_str(tmp)),"<undef>",tmp)
- tmp = trim(memvar_array[mptr].range)
- ? " Range Clause : "+iif((len(tmp) < 1 .or.;
- ctrl_in_str(tmp)),"<undef>",tmp)
- tmp = trim(memvar_array[mptr].slot1)
- lnctr = lnctr + 4
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Field Slot 1 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- tmp = trim(memvar_array[mptr].slot2)
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Field Slot 2 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- tmp = trim(memvar_array[mptr].slot3)
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Field Slot 3 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- ?
- lnctr = lnctr + 1
- endif
- mptr = mptr + 1
- enddo
- return
-
- function boxsummary
- private bptr,tmp,lineout
- sectheader("Boxes Summary",0)
- if ! (number_of_boxes() > 0)
- ? " < No Boxes Defined >"
- ?
- lnctr = lnctr + 2
- return
- endif
- * 1 2 3 4 5 6
- * 123456789012345678901234567890123456789012345678901234567890123456789
- ? "Name Row Col Height Width Outline Border Contents PopUp"
- ?
- bptr = 1
- do while ! (bptr > number_of_boxes())
- if lnctr > 48
- ? chr(12)
- pgctr = pgheader(pgctr)
- sectheader("Boxes Summary",1)
- ?
- ? "Name Row Col Height Width "+;
- "Outline Border Contents PopUp"
- ?
- lnctr = lnctr + 3
- endif
- tmp = "{box_array[bptr].name}"
- lineout = iif(len(tmp) < 1 .or. ctrl_in_str(tmp),"<undef>",tmp)+;
- space(20)
- tmp = "{box_array[bptr].row}"
- lineout = substr(lineout,1,18)+space(3-len(tmp))+"{tmp} "
- tmp = "{box_array[bptr].col}"
- lineout = lineout+space(3-len(tmp))+"{tmp} "
- tmp = "{box_array[bptr].height}"
- lineout = lineout+space(6-len(tmp))+"{tmp} "
- tmp = "{box_array[bptr].width}"
- lineout = lineout+space(5-len(tmp))+"{tmp} "
- if (box_array[bptr].outline.type)
- tmp = chr(34)+trim(box_array[bptr].outline.string)+chr(34)
- else
- tmp = "<none>"
- endif
- lineout = lineout+tmp+space(10)
- tmp = trim(box_array[bptr].outline.color)
- lineout = substr(lineout,1,51)+tmp+space(10)
- tmp = trim(box_array[bptr].contents.color)
- lineout = substr(lineout,1,58)+tmp+space(10)
- tmp = iif(box_array[bptr].popup,"Yes","No")
- lineout = substr(lineout,1,67)+tmp
- ? lineout
- lnctr = lnctr + 1
- if detail
- tmp = trim(box_array[bptr].slot1)
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Box Slot 1 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- tmp = trim(box_array[bptr].slot2)
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Box Slot 2 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- tmp = trim(box_array[bptr].slot3)
- if (len(tmp) > 0) .and. ! (ctrl_in_str(tmp))
- ? " Box Slot 3 : "+substr(tmp,1,min(60,len(tmp)))
- lnctr = lnctr + 1
- endif
- dumpbox(box_array[bptr])
- ?
- lnctr = lnctr + 1
- endif
- bptr = bptr + 1
- enddo
- return
-
- function optsummary
- private optr,tmp,lineout
- if lnctr > 48
- ? chr(12)
- pgctr = pgheader(pgctr)
- endif
- sectheader("Options Summary",0)
- if ! (number_of_options() > 0)
- ? " < No Options Defined >"
- ?
- lnctr = lnctr + 2
- return
- endif
- * 1 2 3 4 5 6
- * 123456789012345678901234567890123456789012345678901234567890123456789
- ? " Selected UnSelected"
- ? "Name Row Col Height Width Outline Border Content Border "+;
- "Content PopUp"
- ?
- lnctr = lnctr + 3
- optr = 1
- do while ! (optr > number_of_options())
- if lnctr > 54
- ? chr(12)
- pgctr = pgheader(pgctr)
- sectheader("Options Summary",1)
- ?
- ? " "+;
- "Selected UnSelected"
- ? "Name Row Col Height Width Outline Border "+;
- "Content Border Content PopUp"
- ?
- lnctr = lnctr + 4
- endif
- tmp = "{option_array[optr].name}"
- lineout = iif(len(tmp) < 1 .or. ctrl_in_str(tmp),"<undef>",tmp)+;
- space(20)
- tmp = "{option_array[optr].row}"
- lineout = substr(lineout,1,12)+space(3-len(tmp))+tmp+space(1)
- tmp = "{option_array[optr].col}"
- lineout = lineout+space(3-len(tmp))+tmp+space(1)
- tmp = "{option_array[optr].height}"
- lineout = lineout+space(6-len(tmp))+tmp+space(1)
- tmp = "{option_array[optr].width}"
- lineout = lineout+space(5-len(tmp))+tmp+space(1)
- if (option_array[optr].outline.type)
- tmp = chr(34)+trim(option_array[optr].outline.string)+chr(34)
- else
- tmp = "<none>"
- endif
- lineout = lineout+tmp+space(10)
- if (option_array[optr].outline.type)
- tmp = trim(option_array[optr].outline.color.selected)
- else
- tmp = "<n/a>"
- endif
- lineout = substr(lineout,1,45)+tmp+space(10)
- tmp = trim(option_array[optr].contents.color.selected)
- lineout = substr(lineout,1,52)+tmp+space(10)
- if (option_array[optr].outline.type)
- tmp = trim(option_array[optr].outline.color.unselected)
- else
- tmp = "<n/a>"
- endif
- lineout = substr(lineout,1,60)+tmp+space(10)
- tmp = trim(option_array[optr].contents.color.unselected)
- lineout = substr(lineout,1,67)+tmp+space(10)
- tmp = iif(option_array[optr].popup,"Yes","No")
- lineout = substr(lineout,1,75)+tmp
- ? lineout
- lnctr = lnctr + 1
- if detail
- tmp = "{option_array[optr].trigger}"
- ? "Option Trigger : "+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
- "<undef>",tmp)
- tmp = chr(34)+box_text(option_array[optr],0,0)+chr(34)
- ? " Option Text : "+tmp
- * ─────────────────────────────────────────────────────────────────────────
- * The following commented code creates a FREESP uninitialized pointer error
- * in the UI2 beta release one.
- *
- * tmp = "{option_array[optr].message}"
- * ? "Option Message : "+iif(len(tmp) < 1 .or. ctrl_in_str(tmp),;
- * "<undef>",tmp)
- * tmp = "{option_array[optr].action[1]}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " Option Action : "+tmp
- * lnctr = lnctr + 1
- * tmp = "{option_array[optr].action[2]}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " "+tmp
- * lnctr = lnctr + 1
- * endif
- * tmp = "{option_array[optr].action[3]}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " "+tmp
- * lnctr = lnctr + 1
- * endif
- * tmp = "{option_array[optr].action[4]}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " "+tmp
- * lnctr = lnctr + 1
- * endif
- * tmp = "{option_array[optr].action[5]}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " "+tmp
- * lnctr = lnctr + 1
- * endif
- * endif
- * tmp = "{option_array[optr].slot1}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " Option Slot 1 : "+tmp
- * lnctr = lnctr + 1
- * endif
- * tmp = "{option_array[optr].slot2}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " Option Slot 2 : "+tmp
- * lnctr = lnctr + 1
- * endif
- * tmp = "{option_array[optr].slot3}"
- * if (len(tmp) > 0 .and. (! ctrl_in_str(tmp)))
- * ? " Option Slot 3 : "+tmp
- * lnctr = lnctr + 1
- * endif
- ?
- * lnctr = lnctr + 3
- lnctr = lnctr + 1
- endif
- optr = optr + 1
- enddo
- return
-
-
-
- function sectheader
- param lstr,cflag
- ?
- ? replicate(chr(196),31-len(lstr))+" {lstr}"
- ? iif(cflag>0,"{space(21)}(continued)"," ")
- lnctr = lnctr + 3
- return
-
- function dumpbox
- param bx
- private row
- ? "* {replicate(chr(196),76)} *"
- for row = 0 to (bx.height - 1)
- ? box_text(bx,row,0)
- endfor
- ? "* {replicate(chr(196),76)} *"
- lnctr = lnctr + (bx.height+2)
- return
-
- function align
- param lstr,column
- return(space(column-at(":",lstr))+lstr)
-
- * ────────────────────────────────────────────────────────────── Primitives
-
- function rjust
- param lstr,width
- return(space(width-len(lstr))+lstr)
-
- function center
- param lstr,width
- return(space((width/2)-(len(lstr)/2))+lstr)
-
- function replicate
- param s,n
- private ls
- ls = s
- n = n - 1
- do while (n > 0)
- ls = ls + s
- n = n - 1
- enddo
- return ls
-
- function min
- param p1,p2
- return(iif(p1>p2,p2,p1))
-
- function max
- param p1,p2
- return(iif(p1>p2,p1,p2))
-
- function ampm
- param lstime
- colonpos = at(":",lstime)
- lstime = substr(lstime,1,colonpos+2)
- do case
- case (val(lstime) < 12)
- lstime = lstime+" am"
- case (val(lstime) = 12)
- lstime = lstime+" pm"
- otherwise
- lstime = ltrim(str(val(lstime)-12))+substr(lstime,colonpos,3)+" pm"
- endcase
- return(lstime)
-
- <<enduicode>>