Obj with Edit Path triggered by Edit Group

From Vectorlab
Jump to: navigation, search


Path object with "edit path" as the Edit Group behavior:

by  Charles Chandler, Januar 2007

PROCEDURE Example6;
CONST
	kObjOnInitXProperties = 5;
	kResetEventID = 3;
	kObjXPropEditGroup = 1;
	kObjXPropEditGroupPath = 2;
	kObjXPropEditGroupProfile = 1;
VAR
	theEvent, theButton :LONGINT;
	result :BOOLEAN;
	objHand, recHand, wallHand, pathHand, dupeHand :HANDLE;
	objName :STRING;
BEGIN
	vsoGetEventInfo(theEvent, theButton);
	CASE theEvent OF

		{User has single-clicked the object's icon.}
		kObjOnInitXProperties: 
			BEGIN
				{This defines the Edit Group behavior to be "path".}
				result := SetObjPropCharVS(kObjXPropEditGroup, Chr(kObjXPropEditGroupPath));
			END;

		{Object reset has been called.}
		kResetEventID: 
			BEGIN
				IF GetCustomObjectInfo(objName, objHand, recHand, wallHand) THEN BEGIN
					pathHand := GetCustomObjectPath(objHand);
					dupeHand := CreateDuplicateObject(pathHand, objHand);
				END;
			END;

	END;
END;
RUN(Example6);

See also

Events