Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins/turtle_blocks_extras/turtle_blocks_extras.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/turtle_blocks_extras/turtle_blocks_extras.py')
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py84
1 files changed, 67 insertions, 17 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index 0d31ced..d78ba94 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -92,6 +92,7 @@ class Turtle_blocks_extras(Plugin):
# internally expanded macro
palette.add_block('while',
+ hidden=True,
style='clamp-style-boolean',
label=_('while'),
prim_name='while',
@@ -102,6 +103,7 @@ boolean operators from Numbers palette'))
# internally expanded macro
palette.add_block('until',
+ hidden=True,
style='clamp-style-boolean',
label=_('until'),
prim_name='until',
@@ -112,6 +114,7 @@ boolean operators from Numbers palette'))
primitive_dictionary['clamp'] = self._prim_clamp
palette.add_block('sandwichclamp',
+ hidden=True,
style='clamp-style-collapsible',
label=' ',
special_name=_('top'),
@@ -120,10 +123,9 @@ boolean operators from Numbers palette'))
self.tw.lc.def_prim('clamp', 1, primitive_dictionary['clamp'], True)
def _media_palette(self):
- palette = make_palette('media',
- colors=["#A0FF00", "#80A000"],
- help_string=_('Palette of media objects'),
- position=7)
+ palette = make_palette('flow',
+ colors=["#FFC000", "#A08000"],
+ help_string=_('Palette of flow operators'))
palette.add_block('journal',
style='box-style-media',
@@ -138,6 +140,7 @@ boolean operators from Numbers palette'))
MEDIA_SHAPES.append('journalon')
palette.add_block('audio',
+ hidden=True,
style='box-style-media',
label=' ',
special_name=_('audio'),
@@ -150,6 +153,7 @@ boolean operators from Numbers palette'))
MEDIA_SHAPES.append('audioon')
palette.add_block('video',
+ hidden=True,
style='box-style-media',
label=' ',
special_name=_('video'),
@@ -162,6 +166,7 @@ boolean operators from Numbers palette'))
MEDIA_SHAPES.append('videoon')
palette.add_block('description',
+ hidden=True,
style='box-style-media',
label=' ',
special_name=_('description'),
@@ -174,6 +179,7 @@ boolean operators from Numbers palette'))
MEDIA_SHAPES.append('descriptionon')
palette.add_block('string',
+ hidden=True,
style='box-style',
label=_('text'),
default=_('text'),
@@ -182,6 +188,7 @@ boolean operators from Numbers palette'))
primitive_dictionary['show'] = self._prim_show
palette.add_block('show',
+ hidden=True,
style='basic-style-1arg',
label=_('show'),
default=_('text'),
@@ -209,6 +216,7 @@ Journal'))
primitive_dictionary['setscale'] = self._prim_setscale
palette.add_block('setscale',
+ hidden=True,
style='basic-style-1arg',
label=_('set scale'),
prim_name='setscale',
@@ -221,6 +229,7 @@ Journal'))
primitive_dictionary['savepix'] = self._prim_save_picture
palette.add_block('savepix',
+ hidden=True,
style='basic-style-1arg',
label=_('save picture'),
prim_name='savepix',
@@ -232,6 +241,7 @@ Journal'))
primitive_dictionary['savesvg'] = self._prim_save_svg
palette.add_block('savesvg',
+ hidden=True,
style='basic-style-1arg',
label=_('save SVG'),
prim_name='savesvg',
@@ -242,6 +252,7 @@ in the Sugar Journal'))
lambda self, x: primitive_dictionary['savesvg'](x))
palette.add_block('scale',
+ hidden=True,
style='box-style',
label=_('scale'),
prim_name='scale',
@@ -251,6 +262,7 @@ in the Sugar Journal'))
self.tw.lc.def_prim('scale', 0, lambda self: self.tw.lc.scale)
palette.add_block('mediawait',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('media wait'),
prim_name='mediawait',
@@ -259,6 +271,7 @@ complete'))
self.tw.lc.def_prim('mediawait', 0, self.tw.lc.media_wait, True)
palette.add_block('mediastop',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('media stop'),
prim_name='mediastop',
@@ -266,6 +279,7 @@ complete'))
self.tw.lc.def_prim('mediastop', 0, self.tw.lc.media_stop, True)
palette.add_block('mediapause',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('media pause'),
prim_name='mediapause',
@@ -273,6 +287,7 @@ complete'))
self.tw.lc.def_prim('mediapause', 0, self.tw.lc.media_pause, True)
palette.add_block('mediaplay',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('media resume'),
prim_name='mediaplay',
@@ -281,6 +296,7 @@ complete'))
primitive_dictionary['speak'] = self._prim_speak
palette.add_block('speak',
+ hidden=True,
style='basic-style-1arg',
label=_('speak'),
prim_name='speak',
@@ -291,6 +307,7 @@ complete'))
primitive_dictionary['sinewave'] = self._prim_sinewave
palette.add_block('sinewave',
+ hidden=True,
style='basic-style-3arg',
# TRANS: pitch, duration, amplitude
label=[_('sinewave') + '\n\n', _('pitch'),
@@ -304,10 +321,9 @@ amplitude, and duration (in seconds)'))
primitive_dictionary['sinewave'](x, y, z))
def _sensor_palette(self):
- palette = make_palette('sensor',
- colors=["#FF6060", "#A06060"],
- help_string=_('Palette of sensor blocks'),
- position=6)
+ palette = make_palette('flow',
+ colors=["#FFC000", "#A08000"],
+ help_string=_('Palette of flow operators'))
primitive_dictionary['mousebutton'] = self._prim_mouse_button
palette.add_block('mousebutton',
@@ -323,6 +339,7 @@ pressed'))
primitive_dictionary['mousebutton2'] = self._prim_mouse_button_bool
palette.add_block('mousebutton2',
+ hidden=True,
style='boolean-block-style',
label=_('button down'),
prim_name='mousebutton2',
@@ -334,6 +351,7 @@ pressed'))
primitive_dictionary['mousebutton2']())
palette.add_block('mousex',
+ hidden=True,
style='box-style',
label=_('mouse x'),
prim_name='mousex',
@@ -344,6 +362,7 @@ pressed'))
self.tw.mouse_x - (self.tw.canvas.width / 2))
palette.add_block('mousey',
+ hidden=True,
style='box-style',
label=_('mouse y'),
prim_name='mousey',
@@ -355,6 +374,7 @@ pressed'))
primitive_dictionary['kbinput'] = self._prim_kbinput
palette.add_block('kbinput',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('query keyboard'),
prim_name='kbinput',
@@ -364,6 +384,7 @@ stored in keyboard block)'))
lambda self: primitive_dictionary['kbinput']())
palette.add_block('keyboard',
+ hidden=True,
style='box-style',
label=_('keyboard'),
prim_name='keyboard',
@@ -400,6 +421,7 @@ block as number'))
primitive_dictionary['readpixel'] = self._prim_readpixel
palette.add_block('readpixel',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('read pixel'),
prim_name='readpixel',
@@ -411,6 +433,7 @@ to the stack'))
primitive_dictionary['see'] = self._prim_see
palette.add_block('see',
+ hidden=True,
style='box-style',
label=_('turtle sees'),
prim_name='see',
@@ -433,11 +456,11 @@ program started'))
def _extras_palette(self):
palette = make_palette('extras',
colors=["#FF0000", "#A00000"],
- help_string=_('Palette of extra options'),
- position=8)
+ help_string=_('Palette of extra options'))
primitive_dictionary['push'] = self._prim_push
palette.add_block('push',
+ hidden=True,
style='basic-style-1arg',
#TRANS: push adds a new item to the program stack
label=_('push'),
@@ -452,6 +475,7 @@ last-out heap)'))
primitive_dictionary['printheap'] = self._prim_printheap
palette.add_block('printheap',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('show heap'),
prim_name='printheap',
@@ -465,6 +489,7 @@ end\n')
primitive_dictionary['clearheap'] = self._prim_emptyheap
palette.add_block('clearheap',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('empty heap'),
prim_name='clearheap',
@@ -478,6 +503,7 @@ end\n')
primitive_dictionary['pop'] = self._prim_pop
palette.add_block('pop',
+ hidden=True,
style='box-style',
#TRANS: pop removes a new item from the program stack
label=_('pop'),
@@ -504,6 +530,7 @@ make "tmp first :taheap\nmake "taheap butfirst :taheap\noutput :tmp\nend\n')
primitive_dictionary['isheapempty2'] = self._prim_is_heap_empty_bool
palette.add_block('isheapempty2',
+ hidden=True,
style='boolean-block-style',
label=_('empty heap?'),
prim_name='isheapempty2',
@@ -515,6 +542,7 @@ make "tmp first :taheap\nmake "taheap butfirst :taheap\noutput :tmp\nend\n')
primitive_dictionary['print'] = self._prim_print
palette.add_block('comment',
+ hidden=True,
style='basic-style-1arg',
label=_('comment'),
prim_name='comment',
@@ -539,6 +567,7 @@ bottom of the screen'))
primitive_dictionary['chr'] = self._prim_chr
palette.add_block('chr',
+ hidden=True,
style='number-style-1arg',
label='chr',
prim_name='chr',
@@ -548,6 +577,7 @@ bottom of the screen'))
primitive_dictionary['int'] = self._prim_int
palette.add_block('int',
+ hidden=True,
style='number-style-1arg',
label='int',
prim_name='int',
@@ -557,6 +587,7 @@ bottom of the screen'))
primitive_dictionary['myfunction'] = self._prim_myfunction
palette.add_block('myfunc1arg',
+ hidden=True,
style='number-style-var-arg',
label=[_('Python'), 'f(x)', 'x'],
prim_name='myfunction',
@@ -598,6 +629,7 @@ advanced multi-variable math equations, e.g., sin(x+y+z)'))
primitive_dictionary['userdefined'] = self._prim_myblock
palette.add_block('userdefined',
+ hidden=True,
style='basic-style-var-arg',
label=' ',
prim_name='userdefined',
@@ -666,6 +698,7 @@ module found in the Journal'))
lambda self: self.tw.set_polar(True))
palette.add_block('addturtle',
+ hidden=True,
style='basic-style-1arg',
label=_('turtle'),
prim_name='turtle',
@@ -678,6 +711,7 @@ module found in the Journal'))
primitive_dictionary['activeturtle'] = self._prim_active_turtle
palette.add_block('activeturtle',
+ hidden=True,
style='box-style',
#TRANS: pop removes a new item from the program stack
label=_('active turtle'),
@@ -702,6 +736,7 @@ module found in the Journal'))
# macro
palette.add_block('reskin',
+ hidden=True,
style='basic-style-1arg',
label=_('turtle shell'),
help_string=_("put a custom 'shell' on the turtle"))
@@ -716,6 +751,7 @@ module found in the Journal'))
primitive_dictionary['loadblock'] = self._prim_load_block
palette.add_block('loadblock',
+ hidden=True,
style='basic-style-var-arg',
label=_('load'),
prim_name='loadblock',
@@ -726,8 +762,8 @@ module found in the Journal'))
primitive_dictionary['loadblock'](x))
palette.add_block('loadblock2arg',
- style='basic-style-var-arg',
hidden=True,
+ style='basic-style-var-arg',
label=_('load'),
prim_name='loadblock2',
string_or_number=True,
@@ -738,8 +774,8 @@ module found in the Journal'))
primitive_dictionary['loadblock']([x, y]))
palette.add_block('loadblock3arg',
- style='basic-style-var-arg',
hidden=True,
+ style='basic-style-var-arg',
label=_('load'),
string_or_number=True,
prim_name='loadblock3',
@@ -751,6 +787,7 @@ module found in the Journal'))
primitive_dictionary['loadpalette'] = self._prim_load_palette
palette.add_block('loadpalette',
+ hidden=True,
style='basic-style-1arg',
string_or_number=True,
label=_('palette'),
@@ -762,14 +799,13 @@ module found in the Journal'))
primitive_dictionary['loadpalette'](x))
def _portfolio_palette(self):
- palette = make_palette('portfolio',
- colors=["#0606FF", "#0606A0"],
- help_string=_('Palette of presentation \
-templates'),
- position=9)
+ palette = make_palette('extras',
+ colors=["#FF0000", "#FF0000"],
+ help_string=_('Palette of extra options'))
primitive_dictionary['hideblocks'] = self._prim_hideblocks
palette.add_block('hideblocks',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('hide blocks'),
prim_name='hideblocks',
@@ -779,6 +815,7 @@ templates'),
primitive_dictionary['showblocks'] = self._prim_showblocks
palette.add_block('showblocks',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('show blocks'),
prim_name='showblocks',
@@ -787,6 +824,7 @@ templates'),
lambda self: primitive_dictionary['showblocks']())
palette.add_block('fullscreen',
+ hidden=True,
style='basic-style-extended-vertical',
label=_('Fullscreen').lower(),
prim_name='fullscreen',
@@ -809,6 +847,7 @@ templates'),
# macros
palette.add_block('picturelist',
+ hidden=True,
style='basic-style-extended',
label=' ',
help_string=_('presentation template: list of \
@@ -816,6 +855,7 @@ bullets'))
MEDIA_SHAPES.append('list')
palette.add_block('picture1x1a',
+ hidden=True,
style='basic-style-extended',
label=' ',
help_string=_('presentation template: select \
@@ -823,6 +863,7 @@ Journal object (no description)'))
MEDIA_SHAPES.append('1x1a')
palette.add_block('picture1x1',
+ hidden=True,
style='basic-style-extended',
label=' ',
help_string=_('presentation template: select \
@@ -830,6 +871,7 @@ Journal object (with description)'))
MEDIA_SHAPES.append('1x1')
palette.add_block('picture2x2',
+ hidden=True,
style='basic-style-extended',
label=' ',
help_string=_('presentation template: select four \
@@ -837,6 +879,7 @@ Journal objects'))
MEDIA_SHAPES.append('2x2')
palette.add_block('picture2x1',
+ hidden=True,
style='basic-style-extended',
label=' ',
help_string=_('presentation template: select two \
@@ -844,6 +887,7 @@ Journal objects'))
MEDIA_SHAPES.append('2x1')
palette.add_block('picture1x2',
+ hidden=True,
style='basic-style-extended',
label=' ',
help_string=_('presentation template: select two \
@@ -852,6 +896,7 @@ Journal objects'))
# Display-dependent constants
palette.add_block('leftpos',
+ hidden=True,
style='box-style',
label=_('left'),
prim_name='lpos',
@@ -860,6 +905,7 @@ Journal objects'))
self.tw.lc.def_prim('lpos', 0, lambda self: CONSTANTS['leftpos'])
palette.add_block('bottompos',
+ hidden=True,
style='box-style',
label=_('bottom'),
prim_name='bpos',
@@ -868,6 +914,7 @@ Journal objects'))
self.tw.lc.def_prim('bpos', 0, lambda self: CONSTANTS['bottompos'])
palette.add_block('width',
+ hidden=True,
style='box-style',
label=_('width'),
prim_name='hres',
@@ -876,6 +923,7 @@ Journal objects'))
self.tw.lc.def_prim('hres', 0, lambda self: CONSTANTS['width'])
palette.add_block('rightpos',
+ hidden=True,
style='box-style',
label=_('right'),
prim_name='rpos',
@@ -884,6 +932,7 @@ Journal objects'))
self.tw.lc.def_prim('rpos', 0, lambda self: CONSTANTS['rightpos'])
palette.add_block('toppos',
+ hidden=True,
style='box-style',
label=_('top'),
prim_name='tpos',
@@ -892,6 +941,7 @@ Journal objects'))
self.tw.lc.def_prim('tpos', 0, lambda self: CONSTANTS['toppos'])
palette.add_block('height',
+ hidden=True,
style='box-style',
label=_('height'),
prim_name='vres',