
! script name: lathetools.d/boringbartable
! topic: make an html  table from a boring bar property class directory

!A
!A NAME:
!A
!A 	Make a html table from a boring bar property class directory.
!A
!A DESCRIPTION:
!A
!A 	This script makes a html table from a boring bar class directory.
!A
!B INSTRUCTIONS:
!B
!B	BORING BAR CLASS DIRECTORY: Select the property directory that
!B				  you wish to make a table from.
!B
!B
!# see also - htdocs/help.d/property.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: make html boring bar table")

DIM Destination$[256]
DIM Answer$[256]
DIM A$[256]
DIM B$[256]
DIM Name$[256]
DIM Base_dir$[256]
DIM Class_dir$[256]
DIM Filename$[256]
DIM Table_name$[256]
DIM Table_title$[256]
DIM Table_file$[256]
DIM Holder_class$[256]
DIM Namelist$[32000]
DIM Filelist$[32000]
DIM D_label$[256]
DIM Choice$[256]

Stat= NamedVarStr("properties dir",WsSystemVars,"/usr/weber/database/properties/",Base_dir$)

Base_dir$= FileNameString(Base_dir$,"Holders.d/BoringBars.d/")

Table_name$= "HTML BORINGBAR TABLE"
Table_file$= "boringbars"

Grid_color= 18
Entry_color= 12
Entry_text_height= GetDefault(WsTextHeight)
Entry_text_width= GetDefault(WsTextWidth)

Header_color= 17
Head_text_height= 1.2*Entry_text_height
Head_text_width= 1.2*Entry_text_width
Header_slant= TAN(20)


Start:!
D_label$="BORING BAR CLASSES"
Choice$="CLASS SELECTED"
Mask$= "*"
Stat=DirListBox(Base_dir$,Mask$,D_label$,Choice$,WsAscending)

Stat=SetInputFormat("a99","")
Stat=GetValue("BORING BAR CLASS DIRECTORY",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$="CANCEL" THEN Leave
Answer$= TRIM$(Answer$)
Class_dir$= FileNameString(Base_dir$,Answer$)
Holder_class$= TRIM$(Answer$)

LowerSelectBox

Table1= FindNamedEntity(Table_name$)
IF Table1 THEN Stat= DeleteEntity(Table1)

Table_title$= Answer$

PlotOff
Pc= PointXYZ(0,0,0)
Table1= TableFromPropDir(Class_dir$,Pc,":",WsUpperLeft,WsAscending)
Stat= DeleteEntity(Pc)

Set_table_props:!
Stat= TableTextOrigin(Table1,1,0,WsCenterText)
Stat= SetTableColors(Table1,0,0,Entry_color)
Stat= SetTableColors(Table1,1,0,Header_color)
Stat= TableTextSizes(Table1,1,0,Head_text_width,Head_text_height,Header_slant)
Stat= SetColor(Table1,Grid_color)
Stat= NameEntity(Table1,Table_name$)
PlotOn

LOAD "datatable.d/exporthtml: 0,"&Table_name$&",1,"&Table_title$&","&Table_file$

Leave:!
PlotOn
LowerSelectBox
Stat=SetInputFormat("n4","")
IF NOT LEN(Destination$) THEN
	LOAD "typecontrol"
ELSE
	LOAD Destination$
END IF
END

