
! script name: property.d/propgrouptable
! topic: make a table from a group of info packets

!A
!A NAME:
!A
!A 	Make Property Group Table
!A
!A DESCRIPTION:
!A
!A 	This script makes a table from a group of info packets.  You can use
!A 	the table as a visual display of the information contained in the
!A 	group of packets, or you can export the table so that the data can
!A 	be used by a program outside of Synergy. 
!A
!B INSTRUCTIONS:
!B
!B	SELECT PACKET GROUP: Select the packet group that you wish
!B 	to make a table from.
!B
!B 	TABLE LOCATION: Enter the xy location of the table.
!B
!# see also - htdocs/help.d/property.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: make packet group table")

DIM Destination$[256]
DIM Answer$[256]
DIM A$[256]
DIM B$[256]
DIM Name$[256]
DIM Class_dir$[256]
DIM Filename$[256]
DIM D_label$[256]
DIM Choice$[256]

ActivateUndo
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:!
Pick_group: !
Stat=ListGrpNames("PACKET GROUPS","selected group","",WsGrpOfProperties)
IF Stat=1 THEN Leave
Stat=SetInputFormat("a99","")
Stat=GetValue("SELECT PACKET GROUP",Answer$)
IF (ExitScript(Destination$)) THEN Leave
Group=FindNamedGrp(Answer$)
IF NOT ValidGeometry(Group) THEN Pick_group
Stat=SetInputFormat("n4","")
LowerSelectBox


Table_pos:Stat=SetInputFormat("n4","")
Pc=XyzInput("TABLE LOCATION ",WsXyzInput)
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(Pc) THEN Table_pos

Table1= TableFromPropGrp(Group,Pc,":",WsUpperLeft)
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= PlotEntity(Table1)

ActivateUndo
Stat= AdvanceUndoNumber("property table")
Stat= AddItemToUndo(WsUBCreateMode,Table1)

GOTO Start

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


