
! script name: vdraft.d/settextsize
! var_topic: set text size default

!A
!A NAME:
!A
!A 	SET TEXT SIZE	VARIATIONAL
!A
!A DESCRIPTION:
!A
!A 	This script changes the default text size.
!A
!B INSTRUCTIONS:
!B 	
!B 	INPUT TEXT HEIGHT: Input the new text height. 	
!B
!B 	INPUT TEXT WIDTH: Input the new text width.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: set text size ")

DIM Answer$[256]
DIM Destination$[256]
DIM Height_var$[256]
DIM Width_var$[256]

Var_object= CheckVarObject
IF ExitScript(Destination$) THEN Leave
DEG

DeActivateUndo
Nocalc=0
Calculate=1

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
No_height_var= LastVariableInput(Height_var$)

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

RecordFunctionOn
Stat= RecordDescr("TEXT: Set size")
IF No_height_var THEN
	V1= FreeParameter("Text height",Text_height)
ELSE
	V1= FreeParameter("Text height",Height_var$)
END IF
IF No_width_var THEN
	V2= FreeParameter("Text width",Text_width)
ELSE
	V2= FreeParameter("Text width",Width_var$)
END IF
Stat=SetDefaults(WsTextHeight,V1)
Stat=SetDefaults(WsTextWidth,V2)
Stat=SetDefaults(WsArrowHeight,V1)
Stat=SetDefaults(WsArrowWidth,V2)
RecordFunctionOff
CloseVarRecord

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