
! script name: colors.d/chfillcolor
! topic: change the area fill color

!A
!A NAME:
!A
!A 	Change Area Fill Color
!A
!A DESCRIPTION:
!A
!A 	This script changes the area fill color.
!A
!B INSTRUCTIONS:
!B
!B 	PICK POINT INSIDE AREA: Pick a point inside the filled area to be
!B 		changed.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: change area fill color ")

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[256]

ActivateUndo
Start:!
Pen_color= CurrentColor
RaiseColorBox

Stat=SetInputFormat("n4=","")
Pt= InputFreePoint("PICK POINT INSIDE AREA")
IF (ExitScript(Destination$)) THEN Leave

Fill1= FindAreaFill(Pt)
Stat= DeleteEntity(Pt)
IF (NOT ValidGeometry(Fill1)) THEN Start

ActivateUndo
Stat= AdvanceUndoNumber("fill color")
Stat= AddItemToUndo(WsUBModifyMode,Fill1)

Fill_pen= CurrentColor
stat= ChangeFillColor(Fill1,Fill_pen)
GOTO Start


Leave:!
Stat= DeleteEntity(Pt)
LowerColorBox
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END

