Path obj with 2D Reshape on double-click

From Vectorlab
Jump to: navigation, search


Path object that goes into 2D Reshape mode on double-click:

by  Charles Chandler, Januar 2007

PROCEDURE Example9;
CONST
	kObjOnInitXProperties = 5;
	kResetEventID = 3;
	kObjXPropSpecialEdit = 3;
	kDefaultSpecialEdit = 0;
	kCustomSpecialEdit = 1;
	kPropertiesSpecialEdit = 2;
	kReshapeSpecialEdit = 3;
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 double-click behavior to active the 2D Reshape tool.}
				result := SetObjPropCharVS(kObjXPropSpecialEdit, Chr(kReshapeSpecialEdit));
			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(Example9);

See also

Events