Browse Source

add comment about fact that PointerMove() handles coordinates in component coordinates, not context coordinates.
Moving an object using its PointerMove method needs to take the displacement of the component AND the PointerMessage into account to compute the proper new position.

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6809 8c9fc860-2736-0410-a75d-ab315db34111

eth.hunzikerp 9 years ago
parent
commit
9d9ce69202
1 changed files with 8 additions and 1 deletions
  1. 8 1
      source/WMComponents.Mod

+ 8 - 1
source/WMComponents.Mod

@@ -1649,6 +1649,8 @@ TYPE
 			Acquire; extGetPositionOwner := handler; Release;
 		END SetExtGetPositionOwnerHandler;
 
+
+
 		(** Indicates the pointing device has left the component without a key pressed down.
 			May only be called from the sequencer thread.
 			Components interested in this message can override this method instead of searching for the message in HandleInternal. *)
@@ -1656,6 +1658,8 @@ TYPE
 		BEGIN ASSERT(IsCallFromSequencer());
 		END PointerLeave;
 
+
+
 	(** Indicates one of the pointer keys went down. keys is the set of buttons currently pressed. x, y is the position in component
 		coordinates.
 		May only be called from the sequencer thread.
@@ -1669,7 +1673,10 @@ TYPE
 	(** Indicates the pointer was moved. keys is the set of buttons currently pressed. x, y is the position in component
 		coordinates.
 		May only be called from the sequencer thread.
-		Components interested in this message can override this method instead of searching for the message in HandleInternal. *)
+		Components interested in this message can override this method instead of searching for the message in HandleInternal. 
+		When using PointerMove to move the component itself within a context (window or parent component), 
+		remember that Component.PointerMove are given in component coordinates (thus, a moving coordinate origin ...), but you want to move the component in context coordinates !
+		*)
 		PROCEDURE PointerMove*(x, y: LONGINT; keys: SET); (** PROTECTED *)
 		BEGIN ASSERT(IsCallFromSequencer());
 		END PointerMove;