Obj with reset on layer scaling

From Vectorlab
Jump to: navigation, search


Object that gets reset if the layer scale changes:

by  Charles Chandler, Januar 2007

PROCEDURE Example5;
CONST
	kObjOnInitXProperties = 5;
	kResetEventID = 3;
	kObjXPropHasLayerScaleDeps = 2;
VAR
	theEvent, theButton :LONGINT;
	result :BOOLEAN;
BEGIN
	vsoGetEventInfo(theEvent, theButton);
	CASE theEvent OF

		{User has single-clicked the object's icon.}
		kObjOnInitXProperties: 
			BEGIN
				{This tells VW to reset the object if the layer scale changes.}
				result := SetObjPropVS(kObjXPropHasLayerScaleDeps, TRUE);
			END;

		{Object reset has been called.}
		kResetEventID: 
			BEGIN
				Rect(0, 0, 1, 1);
				AlrtDialog('yep, I am regenerating');
			END;

	END;
END;
RUN(Example5);

See also

Events