From 91e4e726536ead93dea2749c535480048043bc15 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 17 Oct 2009 16:23:03 +0000 Subject: adjusting coord. graphics --- diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 02449d4..4a672c1 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -178,7 +178,7 @@ class TurtleArtActivity(activity.Activity): separator.show() self.coordinates_label = \ - gtk.Label(_("(x,y): ") + "(0,0)") + gtk.Label(_("x") + " 0 " + _("y") + " 0 " + _("heading") + " 0") self.coordinates_label.set_line_wrap(True) self.coordinates_label.show() self.coordinates_toolitem = gtk.ToolItem() @@ -710,23 +710,6 @@ class TurtleArtActivity(activity.Activity): self.step_button.set_icon("run-slowoff") self.run_button.set_icon("run-fastoff") - def _do_Cartesian_cb(self, button): - if self.tw.Cartesian is True: - tawindow.hide(self.tw.Cartesian_coordinates_spr) - self.tw.Cartesian = False - else: - tawindow.setlayer(self.tw.Cartesian_coordinates_spr,700) - self.tw.Cartesian = True - - def _do_polar_cb(self, button): - if self.tw.polar is True: - tawindow.hide(self.tw.polar_coordinates_spr) - self.tw.polar = False - else: - tawindow.setlayer(self.tw.polar_coordinates_spr,700) - self.tw.polar = True - - """ Sample projects open dialog """ def _do_samples_cb(self, button): tawindow.load_file(self.tw, True) @@ -752,6 +735,26 @@ class TurtleArtActivity(activity.Activity): self.recenter() """ + Display coordinate grids + """ + def _do_Cartesian_cb(self, button): + if self.tw.Cartesian is True: + tawindow.hide(self.tw.Cartesian_coordinates_spr) + self.tw.Cartesian = False + else: + tawindow.setlayer(self.tw.Cartesian_coordinates_spr,610) + self.tw.Cartesian = True + + def _do_polar_cb(self, button): + if self.tw.polar is True: + tawindow.hide(self.tw.polar_coordinates_spr) + self.tw.polar = False + else: + tawindow.setlayer(self.tw.polar_coordinates_spr,610) + self.tw.polar = True + + + """ Either set up initial share... """ def _shared_cb(self, activity): diff --git a/images/Cartesian.svg b/images/Cartesian.svg index dc06f3d..7a29e22 100644 --- a/images/Cartesian.svg +++ b/images/Cartesian.svg @@ -125,6 +125,7 @@ + diff --git a/images/polar.svg b/images/polar.svg new file mode 100644 index 0000000..6a5f841 --- /dev/null +++ b/images/polar.svg @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/tasetup.py b/tasetup.py index 58a8166..c19f4f4 100644 --- a/tasetup.py +++ b/tasetup.py @@ -274,15 +274,15 @@ def setup_misc(tw): tw.media_shapes['pythonloaded'] = \ load_image(tw.path_lang, 'sensors', 'nop-loaded') # coordinare systems - tw.Cartesian_coordinates_spr = sprNew(tw, 0, 0, load_image(tw.path, '', \ - "Cartesian")) + tw.Cartesian_coordinates_spr = sprNew(tw, tw.width/2-600, tw.height/2-450, \ + load_image(tw.path, '', "Cartesian")) tw.Cartesian_coordinates_spr.type = 'coordinates' - setlayer(tw.Cartesian_coordinates_spr, 700) + setlayer(tw.Cartesian_coordinates_spr, 610) hide(tw.Cartesian_coordinates_spr) - tw.polar_coordinates_spr = sprNew(tw, 0, 0, load_image(tw.path, '', \ - "polar")) + tw.polar_coordinates_spr = sprNew(tw, tw.width/2-600, tw.height/2-450, \ + load_image(tw.path, '', "polar")) tw.polar_coordinates_spr.type = 'coordinates' - setlayer(tw.polar_coordinates_spr, 700) + setlayer(tw.polar_coordinates_spr, 610) hide(tw.polar_coordinates_spr) # status shapes get positioned at the bottom of the screen tw.status_shapes = {} -- cgit v0.9.1