Package osaf :: Package framework :: Package blocks :: Module DrawingUtilities
[frames | no frames]

Module osaf.framework.blocks.DrawingUtilities

Classes
Gradients Gradient cache.

Function Summary
  color2rgb(red, green, blue)
  DrawClippedText(dc, word, x, y, maxWidth, wordWidth)
Draw the text, clipping at letter boundaries.
  DrawClippedTextWithDots(dc, string, rect)
  DrawWrappedText(dc, text, rect, measurements)
Simple wordwrap - draws the text into the current DC
  rgb2color(r, g, b)
  SetTextColorsAndFont(grid, attr, dc, isSelected)
Set the text foreground, text background, brush and font into the dc for grids

Variable Summary
str __copyright__ = 'Copyright (c) 2003-2005 Open Source App...
str __date__ = '$Date: 2005/04/07 01:01:02 $'
str __license__ = 'http://osafoundation.org/Chandler_0.1_lic...
str __version__ = '$Revision: 1.104 $'

Function Details

DrawClippedText(dc, word, x, y, maxWidth, wordWidth=-1)

Draw the text, clipping at letter boundaries. This is optimized to reduce the number of calls to GetTextExtent by first estimating the length of the word that will fit in the given width.

Note that I did consider some sort of complex quicksearch algorithm to find the right fit, but generally you're dealing with less than 20 or so characters at a time and you can actually guess reasonably accurately even with proportional fonts. This means its probably cheaper to just start walking up or down from the guess, rather than trying to do a quicksearch -alecf

DrawWrappedText(dc, text, rect, measurements=None)

Simple wordwrap - draws the text into the current DC

returns the height of the text that was written

measurements is a FontMeasurements object as returned by Styles.getMeasurements()

SetTextColorsAndFont(grid, attr, dc, isSelected)

Set the text foreground, text background, brush and font into the dc for grids

Variable Details

__copyright__

Type:
str
Value:
'Copyright (c) 2003-2005 Open Source Applications Foundation'          

__date__

Type:
str
Value:
'$Date: 2005/04/07 01:01:02 $'                                         

__license__

Type:
str
Value:
'http://osafoundation.org/Chandler_0.1_license_terms.htm'              

__version__

Type:
str
Value:
'$Revision: 1.104 $'                                                   

Generated by Epydoc 2.1 on Mon Dec 19 13:33:34 2005 http://epydoc.sf.net