
! script name: datatable.d/sizeentrytext
! topic: Size text entry in a table.

!A
!A NAME:
!A
!A 	Size text entry in a table.
!A
!A DESCRIPTION:
!A
!A 	Size text entry in a table.
!A
!B INSTRUCTIONS:
!B
!B	INPUT TEXT HEIGHT: Give the height of the text characters.
!B
!B	INPUT TEXT WIDTH: Give the width of the text characters. 
!B
!B	INPUT TEXT SLANT:  Give slant in degrees.
!B
!B	PICK ENTRY TO BE SIZED:  Pick the entry in the table.
!B
!# see also - htdocs/help.d/datatables.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: Size text entry ")

DIM Answer$[256]
DIM A$[256]
DIM Destination$[256]
DEG

ActivateUndo
Text_height= GetDefault(WsTextHeight)
Text_width= GetDefault(WsTextWidth)
Start:!

Text_height= GetDefault(WsTextHeight)
Text_width= GetDefault(WsTextWidth)

Text_size:stat= SetInputFormat("n4=","")
stat= SetEqualsValue(Text_height)
Text_height= GetValue("INPUT TEXT HEIGHT ",Answer$)
IF (ExitScript(Destination$)) THEN Leave

stat= SetInputFormat("n4=","")
stat= SetEqualsValue(Text_width)
Text_width= GetValue("INPUT TEXT WIDTH ",Answer$)
IF (ExitScript(Destination$)) THEN Leave

stat= SetInputFormat("n4=","")
stat= SetEqualsValue(Slant_angle)
Slant_angle= GetValue("INPUT TEXT SLANT ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
Text_slant= TAN(Slant_angle)


Element_loop:!
stat= SetInputFormat("n4a1",",N,")
Element1=PickEntity("PICK ENTRY TO BE SIZED, New size ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "N" THEN Start
IF NOT ValidGeometry(Element1) THEN Element_loop
T1= LastPickPara

R1=TableParaRow(Element1,T1)
C1=TableParaColumn(Element1,T1)

ActivateUndo
Stat= AdvanceUndoNumber("size entry")
Stat= AddItemToUndo(WsUBModifyMode,Element1)

Stat= EraseEntity(Element1)
Stat= TableTextSizes(Element1,R1,C1,Text_width,Text_height,Text_slant)
Stat= PlotEntity(Element1)

GOTO Element_loop

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