phoenix_title wx.lib.calendar.CalDraw

A class to draw a calendar.


class_hierarchy Class Hierarchy

Inheritance diagram for class CalDraw:

sub_classes Known Subclasses

wx.lib.calendar.PrtCalDraw


method_summary Methods Summary

__init__

Default class constructor

AddSelect

Add a selection of days.

Center

Calculate the dimensions in the center of the drawing area.

DefParms

Setup the default parameters.

DrawBorder

Draw a border around the outside of the main display rectangle.

DrawCal

Draw the calendar.

DrawDayText

Draw the day text.

DrawFocusIndicator

Draw the focus indicator

DrawGrid

Calculate and draw the grid lines.

DrawMonth

Draw the month and year titles.

DrawNum

Draw the day numbers

DrawNumVal

Draw the numeric values.

DrawSel

Highlight selected days.

DrawWeek

Draw the week days.

GetCal

Get the calendar days.

GetColor

Get a color.

GetOffset

Get the offset position.

GetRect

Get the display rectangle list of the day grid.

InitScale

Set the default scale values.

InitValues

Default dimensions of various elements of the calendar.

SetCal

Calculate the calendar days and offset position.

SetColor

Set a color.

SetMarg

Set the margins.

SetPos

Set the position.

SetSize

Set the size.

SetWeekColor

Set the font and background color of the week title.

SetWeekEnd

Set the weekend backgrounds.


api Class API

class CalDraw

A class to draw a calendar.


Methods

__init__(self, parent)

Default class constructor

Parameters:

parent (wx.Window) – parent window.



AddSelect(self, list, cfont=None, cbackgrd=None)

Add a selection of days.

Parameters:
  • 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.

Parameters:
  • DC – the wx.DC to use

  • transparent – use a transparent brush, default is False.



DrawCal(self, DC, sel_lst=[])

Draw the calendar.

Parameters:
  • 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.

Parameters:
  • DC – the wx.DC to use.

  • key – the day to draw



DrawFocusIndicator(self, DC)

Draw the focus indicator

Parameters:

DC – the wx.DC to use



DrawGrid(self, DC)

Calculate and draw the grid lines.

Parameters:

DC – the wx.DC to use



DrawMonth(self, DC)

Draw the month and year titles.

Parameters:

DC – the wx.DC to use.



DrawNum(self, DC)

Draw the day numbers

Parameters:

DC – the wx.DC to use.



DrawNumVal(self)

Draw the numeric values.



DrawSel(self, DC)

Highlight selected days.

Parameters:

DC – the wx.DC to use



DrawWeek(self, DC)

Draw the week days.

Parameters:

DC – the wx.DC to use.



GetCal(self)

Get the calendar days.



GetColor(self, name)

Get a color.

Parameters:

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.

Parameters:
  • year (int) – the year to calculate.

  • month (int) – the month to calculate.



SetColor(self, name, value)

Set a color.

Parameters:
  • name – the name to assign the color too.

  • value – the color to use, see wx.Colour



SetMarg(self, xmarg, ymarg)

Set the margins.

Parameters:
  • xmarg – the x margin

  • ymarg – the y margin, also used for the end margin



SetPos(self, xpos, ypos)

Set the position.

Parameters:
  • xpos (int) – the x position

  • ypos (int) – the y position



SetSize(self, size)

Set the size.

Parameters:

size – a tuple/list with width and height



SetWeekColor(self, font_color, week_color)

Set the font and background color of the week title.

Parameters:
  • font_color – the font color, a value as is accepted by wx.Colour

  • week_color – the week color, a value as is accepted by wx.Colour



SetWeekEnd(self, font_color=None, backgrd=None)

Set the weekend backgrounds.

Parameters:
  • 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.