A class to draw a calendar.
Default class constructor |
|
Add a selection of days. |
|
Calculate the dimensions in the center of the drawing area. |
|
Setup the default parameters. |
|
Draw a border around the outside of the main display rectangle. |
|
Draw the calendar. |
|
Draw the day text. |
|
Draw the focus indicator |
|
Calculate and draw the grid lines. |
|
Draw the month and year titles. |
|
Draw the day numbers |
|
Draw the numeric values. |
|
Highlight selected days. |
|
Draw the week days. |
|
Get the calendar days. |
|
Get a color. |
|
Get the offset position. |
|
Get the display rectangle list of the day grid. |
|
Set the default scale values. |
|
Default dimensions of various elements of the calendar. |
|
Calculate the calendar days and offset position. |
|
Set a color. |
|
Set the margins. |
|
Set the position. |
|
Set the size. |
|
Set the font and background color of the week title. |
|
Set the weekend backgrounds. |
CalDraw
¶A class to draw a calendar.
AddSelect
(self, list, cfont=None, cbackgrd=None)¶Add a selection of days.
list – a list of days to select
cfont – the font color to use
cbackgrd – the background color to use
Center
(self)¶Calculate the dimensions in the center of the drawing area.
DefParms
(self)¶Setup the default parameters.
DrawBorder
(self, DC, transparent=False)¶Draw a border around the outside of the main display rectangle.
DC – the wx.DC
to use
transparent – use a transparent brush, default is False
.
DrawCal
(self, DC, sel_lst=[])¶Draw the calendar.
DC – the wx.DC
to use to draw upon.
sel_list – a list of days to override the weekend highlight.
DrawDayText
(self, DC, key)¶Draw the day text.
DC – the wx.DC
to use.
key – the day to draw
DrawNumVal
(self)¶Draw the numeric values.
GetCal
(self)¶Get the calendar days.
GetColor
(self, name)¶Get a color.
name – one of the defined color names.
GetOffset
(self)¶Get the offset position.
GetRect
(self)¶Get the display rectangle list of the day grid.
InitScale
(self)¶Set the default scale values.
InitValues
(self)¶Default dimensions of various elements of the calendar.
SetCal
(self, year, month)¶Calculate the calendar days and offset position.
year (int) – the year to calculate.
month (int) – the month to calculate.
SetColor
(self, name, value)¶Set a color.
name – the name to assign the color too.
value – the color to use, see wx.Colour
SetMarg
(self, xmarg, ymarg)¶Set the margins.
xmarg – the x margin
ymarg – the y margin, also used for the end margin
SetPos
(self, xpos, ypos)¶Set the position.
xpos (int) – the x position
ypos (int) – the y position
SetSize
(self, size)¶Set the size.
size – a tuple/list with width and height
SetWeekColor
(self, font_color, week_color)¶Set the font and background color of the week title.
SetWeekEnd
(self, font_color=None, backgrd=None)¶Set the weekend backgrounds.
font_color – the font color to use, if None
the default is used.
backgrd – the background color to use, if None
the default is used.