]> git.saurik.com Git - wxWidgets.git/commitdiff
bugfix
authorRobin Dunn <robin@alldunn.com>
Thu, 22 Apr 2004 22:48:18 +0000 (22:48 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 22 Apr 2004 22:48:18 +0000 (22:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/lib/calendar.py

index 257b8c1c457931731f7d6ad2e9e7fa64ad820633..4cb46b1b3fd12e215eea4d99573015b55588e829 100644 (file)
@@ -292,6 +292,8 @@ class CalDraw:
             self.cal_days.append(str(i))
             i = i + 1
 
             self.cal_days.append(str(i))
             i = i + 1
 
+        self.end_pos = dow + dim
+
         return start_pos
 
     def SetWeekEnd(self, font_color=None, backgrd = None):
         return start_pos
 
     def SetWeekEnd(self, font_color=None, backgrd = None):
@@ -540,6 +542,9 @@ class CalDraw:
         f = wx.Font(10, self.font, wx.NORMAL, self.bold)      # initial font setting
         self._CalcFontSize(DC, f)
 
         f = wx.Font(10, self.font, wx.NORMAL, self.bold)      # initial font setting
         self._CalcFontSize(DC, f)
 
+        if key > self.end_pos: 
+            key = self.end_pos
+
         val = self.cal_days[key]
         cnt_x = key % 7
         cnt_y = int(key / 7)+1
         val = self.cal_days[key]
         cnt_x = key % 7
         cnt_y = int(key / 7)+1