Module fileview
[hide private]
[frames] | no frames]

Module fileview

source code

Classes [hide private]
  MediaDataObject
  MediaEntry
  MyFileDropTarget
  FileView
  FileViewDisplayItem
Functions [hide private]
 
DrawTextWithLimit(dc, x, y, text, widthavailable, guardspace, term='...')
Draws text and if it will overflow the width available, truncates and puts ...
source code
Variables [hide private]
  mediaobjectfactory = database.dataobjectfactory(MediaDataObject)
  media_codec = 'phone_media'
Function Details [hide private]

DrawTextWithLimit(dc, x, y, text, widthavailable, guardspace, term='...')

source code 

Draws text and if it will overflow the width available, truncates and puts ... at the end

Parameters:
  • x - start position for text
  • y - start position for text
  • text - the string to draw
  • widthavailable - the total amount of space available
  • guardspace - if the text is longer than widthavailable then this amount of space is reclaimed from the right handside and term put there instead. Consequently this value should be at least the width of term
  • term - the string that is placed in the guardspace if it gets truncated. Make sure guardspace is at least the width of this string!
Returns:
The extent of the text that was drawn in the end as a tuple of (width, height)