Module aggregatedisplay :: Class Item
[hide private]
[frames] | no frames]

Class Item

source code

object --+
         |
        Item

A generic item implementation.

You don't need to inherit from this - it is mainly to document what you have to implement.

Instance Methods [hide private]
 
Draw(self, dc, width, height, selected)
Draw yourself into the available space.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

Draw(self, dc, width, height, selected)

source code 

Draw yourself into the available space. 0,0 will be your top left.

Note that the width may be larger than the DataSource.GetItemSize method returned because unused space is spread amongst the items. It will never be smaller than what was returned. You should set the clipping region if necessary.

The main display code needs to know the bounding box for each item so that it can tell when an item has been clicked on, as opposed to the white space surrounding an item. By default it clears the bounding box and looks at what area you draw on in this function. If you return None, then that is what happens.

Instead you may also return a 4 item tuple of (minx, miny, maxx, maxy) and that will be used.

Parameters:
  • dc - The device context to draw into
  • width - maximum space to use
  • height - maximum space to use
  • selected - if the item is currently selected