Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /leo/plugins/cleo.py

leo
Discussion topic

Back to topic list

CVS update: /leo/plugins/cleo.py

Author terry_n_brown
Full name Terry Brown
Date 2007-10-08 18:27:25 PDT
Message User: terry_n_brown
Date: 2007-10-08 18:27:25-0700
Log:
 
 add menu/command to propagate colors from node to subtree

File Changes:

Directory: /leo/plugins/
========================

File [changed]: cleo.py
Url: http://leo.tigris.or​g/source/browse/leo/​plugins/cleo.py?r1=1​.14&r2=1.15
Delta lines: +18 -1
--------------------
--- cleo.py 2007-10-04 07:31:59-0700 1.14
+++ cleo.py 2007-10-08 18:27:22-0700 1.15
@@ -468,6 +468,19 @@
         self.c.redraw()
     #@nonl
     #@-node:tbrown.20060​903121429.25:remove_​colours
+ #@+node:tbrown.20071​008150126:subtree_co​lours
+ def subtree_colours(self,v):
+
+ fg = self.getat(v, 'fg')
+ bg = self.getat(v, 'bg')
+ child = v.firstChild()
+ while child:
+ self.setat(child, 'fg', fg)
+ self.setat(child, 'bg', bg)
+ self.subtree_colours(child)
+ child = child.next()
+ self.c.redraw()
+ #@-node:tbrown.20071​008150126:subtree_co​lours
     #@+node:tbrown.20060​912130940:add_colour​
     def add_colour(self):
 
@@ -888,16 +901,20 @@
 
         def cleoColorsMenuCallback():
             self.remove_colours(p.v)
+ def cleoColorsMenuSubtree():
+ self.subtree_colours(p.v)
 
         parent.add_command(l​abel='Remove Colouring', underline=0,
             command=cleoColorsMenuCallback)
 
+ parent.add_command(l​abel='Colour subtree', underline=0,
+ command=cleoColorsMenuSubtree)
+
         def cleoAddColorsMenuCallback():
             self.add_colour()
 
         parent.add_command(label='New Colour', underline=0,
             command=cleoAddColor​sMenuCallback)
- #@nonl
     #@-node:tbrown.20060​903121429.50:colours​_menu
     #@+node:tbrown.20060​903121429.51:node menu
     def nodes_menu(self,parent,p):

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /leo/plugins/cleo.py terry_n_brown Terry Brown 2007-10-08 18:27:25 PDT
Messages per page: