From 30159238e235c2a889fa37cc80b4d9648c8ba760 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 09 Jun 2011 21:48:22 +0000 Subject: adding CC coordinate grid for XO hardware --- (limited to 'TurtleArt') diff --git a/TurtleArt/taconstants.py b/TurtleArt/taconstants.py index fdc42d1..30920d6 100644 --- a/TurtleArt/taconstants.py +++ b/TurtleArt/taconstants.py @@ -140,7 +140,7 @@ MEDIA_SHAPES = ['audiooff', 'audioon', 'audiosmall', 'pythonoff', 'pythonon', 'pythonsmall', 'list', '1x1', '1x1a', '2x1', '1x2', '2x2'] -OVERLAY_SHAPES = ['Cartesian', 'Cartesian_labeled', 'polar'] +OVERLAY_SHAPES = ['Cartesian', 'Cartesian_labeled', 'polar', 'metric'] STATUS_SHAPES = ['status', 'info', 'nostack', 'dupstack', 'noinput', 'emptyheap', 'emptybox', 'nomedia', 'nocode', 'overflowerror', diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py index 5aff270..64a32fd 100644 --- a/TurtleArt/tawindow.py +++ b/TurtleArt/tawindow.py @@ -185,6 +185,7 @@ class TurtleArtWindow(): self.media_shapes = {} self.cartesian = False self.polar = False + self.metric = False self.overlay_shapes = {} self.toolbar_shapes = {} self.toolbar_offset = 0 @@ -485,6 +486,15 @@ class TurtleArtWindow(): self.overlay_shapes['polar'].hide() self.polar = False + def set_metric(self, flag): + """ Turn on/off metric coordinates """ + if flag: + self.overlay_shapes['metric'].set_layer(OVERLAY_LAYER) + self.metric = True + else: + self.overlay_shapes['metric'].hide() + self.metric = False + def update_overlay_position(self, widget, event): """ Reposition the overlays when window size changes """ self.width = event.width @@ -507,6 +517,7 @@ class TurtleArtWindow(): self.overlay_shapes[name].type = 'overlay' self.cartesian = False self.polar = False + self.metric = False self.canvas.width = self.width self.canvas.height = self.height self.canvas.move_turtle() -- cgit v0.9.1