Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tawindow.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-03 17:35:22 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-03 17:35:22 (GMT)
commit9e0bf5bf04e7ad25fa7ff59e1438b4f6a4913304 (patch)
tree877ce248a5d9b88c4903d9024128f41d91994d9a /tawindow.py
parentd306fb21464579a3a7d727812f060ce02c54a19a (diff)
expandable identity block
Diffstat (limited to 'tawindow.py')
-rw-r--r--tawindow.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tawindow.py b/tawindow.py
index 3fdfa64..6841d01 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -430,6 +430,10 @@ class TurtleArtWindow():
self.palettes[n][i].spr.set_image(self.media_shapes[
name+'small'], 1, int(MEDIA_X*scale/BLOCK_SCALE),
int(MEDIA_Y*scale/BLOCK_SCALE))
+ elif name[:8] == 'template':
+ self.palettes[n][i].spr.set_image(self.media_shapes[
+ name[8:]], 1, int(TEMPLATE_X*scale/BLOCK_SCALE),
+ int(TEMPLATE_Y*scale/BLOCK_SCALE))
elif name == 'nop':
self.palettes[n][i].spr.set_image(self.media_shapes[
'pythonsmall'], 1, int(PYTHON_X*scale/BLOCK_SCALE),
@@ -1038,6 +1042,17 @@ class TurtleArtWindow():
blk.spr.labels[0] += CURSOR
elif blk.name in BOX_STYLE_MEDIA:
self._import_from_journal(self.selected_blk)
+ elif blk.name=='identity2':
+ group = self._find_group(blk)
+ r,g,b,a = blk.spr.get_pixel((x, y))
+ if (r == 255 and g == 0) or g == 255:
+ dx = blk.reset_x()
+ else:
+ dx = 20
+ blk.expand_in_x(dx)
+ for b in group:
+ if b != blk:
+ b.spr.move_relative((dx*blk.scale, 0))
elif blk.name=='vspace':
group = self._find_group(blk)
r,g,b,a = blk.spr.get_pixel((x, y))
@@ -1588,7 +1603,7 @@ class TurtleArtWindow():
if btype == 'vspace':
if value is not None:
blk.expand_in_y(value)
- elif btype == 'hspace':
+ elif btype == 'hspace' or btype == 'identity2':
if value is not None:
blk.expand_in_x(value)
elif btype == 'list':