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

Module calendarcontrol

source code

A calendar control that shows several weeks in one go

The design is inspired by the Alan Cooper article http://www.cooper.com/articles/art_goal_directed_design.htm about goal directed design. I also have to apologise for it not quite living up to that vision :-)

It is fairly feature complete and supports all sorts of interaction, scrolling and customization of appearance

Classes [hide private]
  FontscaleCache
A cache used internally to remember how much to shrink fonts by
  CalendarCellAttributes
A class represnting appearance attributes for an individual day.
  CalendarCell
A control that is used for each day in the calendar
  CalendarLabel
The label window on the left of the day cells that shows the month with rotated text
  Calendar
The main calendar control.
  PopupCalendar
The control that pops up when you click the year button
Functions [hide private]
 
GetCalendarCellAttributes(attr=None) source code
int
monthrange(year, month)
How many days are in the specified month?
source code
tuple
normalizedate(year, month, day)
Return a valid date (and an excellent case for metric time)
source code
 
getupbitmapData()
Returns raw data for the up icon
source code
 
getupbitmapBitmap()
Returns a wx.Bitmap of the up icon
source code
 
getupbitmapImage()
Returns wx.Image of the up icon
source code
 
getdownbitmapData()
Returns raw data for the down icon
source code
 
getdownbitmapBitmap()
Returns a wx.Bitmap of the down icon
source code
 
getdownbitmapImage()
Returns wx.Image of the down icon
source code
Variables [hide private]
  thefontscalecache = {}
  DefaultCalendarCellAttributes = None
  _monthranges = [0, 31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30,...
Function Details [hide private]

normalizedate(year, month, day)

source code 

Return a valid date (and an excellent case for metric time)

And example is the 32nd of January is first of Feb, or Jan -2 is December 29th of previous year. You should call this after doing arithmetic on dates (for example you can just subtract 14 from the current day and then call this to get the correct date for two weeks ago.

Returns: tuple
(year, month, day)

Variables Details [hide private]

_monthranges

Value:
[0, 31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]