]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxCalendarCtrl.py
corrected assert even better
[wxWidgets.git] / wxPython / demo / wxCalendarCtrl.py
CommitLineData
f6bcfd97
BP
1
2from wxPython.wx import *
3from wxPython.calendar import *
4from wxPython.utils import *
5
6#----------------------------------------------------------------------
7
8class TestPanel(wxPanel):
9 def __init__(self, parent, ID, log):
10 wxPanel.__init__(self, parent, ID)
11 self.log = log
12
b96c7a38 13 cal = wxCalendarCtrl(self, -1, wxDateTime_Now(), pos = (25,50),
f6bcfd97
BP
14 style = wxCAL_SHOW_HOLIDAYS | wxCAL_SUNDAY_FIRST)
15
b96c7a38 16 EVT_CALENDAR(self, cal.GetId(), self.OnCalSelected)
f6bcfd97 17
b96c7a38
RD
18 b = wxButton(self, -1, "Destroy the Calendar", pos = (250, 50))
19 EVT_BUTTON(self, b.GetId(), self.OnButton)
20 self.cal = cal
21
22 def OnButton(self, evt):
23 self.cal.Destroy()
24 self.cal = None
f6bcfd97
BP
25
26 def OnCalSelected(self, evt):
27 self.log.write('OnCalSelected: %s\n' % evt.GetDate())
28
29
30#----------------------------------------------------------------------
31
32def runTest(frame, nb, log):
33 win = TestPanel(nb, -1, log)
34 return win
35
36#----------------------------------------------------------------------
37
38
39overview = """\
40<html><body>
41<h2>wxCalendarCtrl</h2>
42
43Yet <i>another</i> calendar control. This one is a wrapper around the C++
44version described in the docs. This one will probably be a bit more efficient
45than the one in wxPython.lib.calendar, but I like a few things about it better,
46so I think both will stay in wxPython.
47"""