~mcfletch/squaremap/trunk

« back to all changes in this revision

Viewing changes to squaremap/squaremap.py

  • Committer: Mike C. Fletcher
  • Date: 2013-08-22 06:08:49 UTC
  • Revision ID: mcfletch@vrplumber.com-20130822060849-7b8wn93dnbwp3jvi
Use SquareMap.BackgroundColour vs. BackgroundColor (bug fix, as code was using colour form elsewhere)

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
class SquareMap( wx.Panel ):
82
82
    """Construct a nested-box trees structure view"""
83
83
 
84
 
    BackgroundColor = wx.Colour( 128,128,128 )
 
84
    BackgroundColour = wx.Colour( 128,128,128 )
85
85
    max_depth = None
86
86
    max_depth_seen = None
87
87
 
255
255
    def BrushForNode( self, node, depth=0 ):
256
256
        """Create brush to use to display the given node"""
257
257
        if node == self.selectedNode:
258
 
            color = wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)
 
258
            colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHT)
259
259
        elif node == self.highlightedNode:
260
 
            color = wx.Colour( red=0, green=255, blue=0 )
 
260
            colour = wx.Colour( red=0, green=255, blue=0 )
261
261
        else:
262
 
            color = self.adapter.background_color(node, depth)
263
 
            if not color:
 
262
            colour = self.adapter.background_color(node, depth)
 
263
            if not colour:
264
264
                red = (depth * 10)%255
265
265
                green = 255-((depth * 5)%255)
266
266
                blue = (depth * 25)%255
267
 
                color = wx.Colour( red, green, blue )
268
 
        return wx.Brush( color  )
 
267
                colour = wx.Colour( red, green, blue )
 
268
        return wx.Brush( colour  )
269
269
 
270
270
    def PenForNode( self, node, depth=0 ):
271
271
        """Determine the pen to use to display the given node"""
274
274
        return self.DEFAULT_PEN
275
275
 
276
276
    def TextForegroundForNode(self, node, depth=0):
277
 
        """Determine the text foreground color to use to display the label of
 
277
        """Determine the text foreground colour to use to display the label of
278
278
           the given node"""
279
279
        if node == self.selectedNode:
280
 
            fg_color = wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
 
280
            fg_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
281
281
        else:
282
 
            fg_color = self.adapter.foreground_color(node, depth)
283
 
            if not fg_color:
284
 
                fg_color = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
285
 
        return fg_color
 
282
            fg_colour = self.adapter.foreground_color(node, depth)
 
283
            if not fg_colour:
 
284
                fg_colour = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
 
285
        return fg_colour
286
286
 
287
287
    def DrawBox( self, dc, node, x,y,w,h, hot_map, depth=0 ):
288
288
        """Draw a model-node's box and all children nodes"""