Browse Source

fixed invalidate, now also handles 'invalidate' type messages

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7340 8c9fc860-2736-0410-a75d-ab315db34111
skoster 7 years ago
parent
commit
fcbf1ad5d4
1 changed files with 9 additions and 2 deletions
  1. 9 2
      source/WMImageGrid.Mod

+ 9 - 2
source/WMImageGrid.Mod

@@ -128,7 +128,7 @@ TYPE GridWindow* = OBJECT(WMWindowManager.Window)
 		END Draw;
 
 		PROCEDURE Invalidate*(rect : Rectangle);
-		VAR w, h : LONGINT; fx, fy : REAL;
+		VAR w, h : LONGINT; fx, fy : LONGREAL;
 		BEGIN
 			w := GetWidth(); h := GetHeight();
 			IF (w > 0) & (h > 0) & ((w # totalW) OR (h # totalH))  THEN
@@ -149,8 +149,15 @@ TYPE GridWindow* = OBJECT(WMWindowManager.Window)
 				fy := totalH/ h;
 				m.x := ENTIER(m.x * fx); m.y := ENTIER(m.y * fy);
 				m.x := m.x + bounds.l; m.y := m.y+bounds.l;
+			ELSIF m.msgType = Messages.MsgInvalidate THEN
+				IF m.msgSubType = Messages.MsgSubAll THEN
+					Invalidate(Rectangles.MakeRect(0, 0, totalW, totalH));
+				ELSE
+					HALT(200)
+				END;			
+			ELSE 
+				Handle^(m)
 			END;
-			Handle^(m)
 		END Handle;
 
 	END GridWindow;