Module wxmpl :: Class Painter
[show private | hide private]
[frames | no frames]

Class Painter

DestructableViewMixin --+
                        |
                       Painter

Known Subclasses:
CrosshairPainter, LocationPainter, RubberbandPainter

Painters encapsulate the mechanics of drawing some value in a wxPython window and erasing it. Subclasses override template methods to process values and draw them.
Method Summary
  __init__(self, view, enabled)
Create a new painter attached to the wxPython window view.
  _paint(self, value, dc)
Draws a previously processed value on this painter's window.
  clear(self, dc)
Clear the painter's current value from the screen and the painter itself.
  clearValue(self, dc, value)
Template method that clears a previously processed value that was previously drawn, using the wxPython device context dc.
  drawValue(self, dc, value)
Template method that draws a previously processed value using the wxPython device context dc.
  formatValue(self, value)
Template method that processes the value tuple passed to the set() method, returning the processed version.
  redraw(self, dc)
Redraw this painter's current value.
  set(self, *value)
Update this painter's value and then draw it.
  setEnabled(self, state)
Enable or disable this painter.
    Inherited from DestructableViewMixin
  destroy(self)
Sets this object's view attribute to None.

Class Variable Summary
wxBrushPtr BRUSH: wx.Brush to use (defaults to wx.TRANSPARENT_BRUSH)
wxFontPtr FONT: wx.Font to use (defaults to wx.NORMAL_FONT)
int FUNCTION: Logical function to use (defaults to wx.COPY)
wxPenPtr PEN: wx.Pen to use (defaults to wx.BLACK_PEN)
wxColourPtr TEXT_BACKGROUND: wx.Colour to use (defaults to wx.WHITE)
wxColourPtr TEXT_FOREGROUND: wx.Colour to use (defaults to wx.BLACK)

Method Details

__init__(self, view, enabled=True)
(Constructor)

Create a new painter attached to the wxPython window view. The keyword argument enabled has the same meaning as the argument to the setEnabled() method.

_paint(self, value, dc)

Draws a previously processed value on this painter's window.

clear(self, dc=None)

Clear the painter's current value from the screen and the painter itself.

clearValue(self, dc, value)

Template method that clears a previously processed value that was previously drawn, using the wxPython device context dc. This DC has already been configured, so calls to BeginDrawing() and EndDrawing() may not be made.

drawValue(self, dc, value)

Template method that draws a previously processed value using the wxPython device context dc. This DC has already been configured, so calls to BeginDrawing() and EndDrawing() may not be made.

formatValue(self, value)

Template method that processes the value tuple passed to the set() method, returning the processed version.

redraw(self, dc=None)

Redraw this painter's current value.

set(self, *value)

Update this painter's value and then draw it. Values may not be None, which is used internally to represent the absence of a current value.

setEnabled(self, state)

Enable or disable this painter. Disabled painters do not draw their values and calls to set() have no effect on them.

Class Variable Details

BRUSH

wx.Brush to use (defaults to wx.TRANSPARENT_BRUSH)
Type:
wxBrushPtr
Value:
<wxPython.gdi.wxBrushPtr instance; proxy of C++ wxBrush instance at _8\
1e9f40_wxBrush_p>                                                      

FONT

wx.Font to use (defaults to wx.NORMAL_FONT)
Type:
wxFontPtr
Value:
<wxPython.fonts.wxFontPtr instance; proxy of C++ wxFont instance at _8\
1e8cf0_wxFont_p>                                                       

FUNCTION

Logical function to use (defaults to wx.COPY)
Type:
int
Value:
5                                                                     

PEN

wx.Pen to use (defaults to wx.BLACK_PEN)
Type:
wxPenPtr
Value:
<wxPython.gdi.wxPenPtr instance; proxy of C++ wxPen instance at _81e9c\
98_wxPen_p>                                                            

TEXT_BACKGROUND

wx.Colour to use (defaults to wx.WHITE)
Type:
wxColourPtr
Value:
wxColour(177, 228, 0)                                                  

TEXT_FOREGROUND

wx.Colour to use (defaults to wx.BLACK)
Type:
wxColourPtr
Value:
wxColour(21, 0, 108)                                                   

Generated by Epydoc 2.1 on Mon Aug 28 13:47:49 2006 http://epydoc.sf.net