Permalink
Browse files

if selection length type is changed in Calendar View, reflect it in t…

…he tiles.
  • Loading branch information...
1 parent 2a43cd9 commit d32e9fc5253d9a0c3d4139923f5371833cf0eb74 @luddep committed Jul 28, 2010
Showing with 28 additions and 21 deletions.
  1. +28 −21 LPCalendarMonthView.j
View
@@ -60,27 +60,24 @@ var _startAndEndOfWeekCache = {};
@implementation LPCalendarMonthView : CPView
{
- CPArray dayTiles;
- CPDate date @accessors;
- CPDate previousMonth @accessors(readonly);
- CPDate nextMonth @accessors(readonly);
- BOOL _dataIsDirty;
-
- BOOL allowsMultipleSelection @accessors;
- int startSelectionIndex;
- int currentSelectionIndex;
- id selectionLengthType @accessors;
- CPArray selection;
-
- BOOL highlightCurrentPeriod @accessors;
-
- BOOL weekStartsOnMonday @accessors;
-
- id _delegate @accessors(property=delegate);
-
- LPCalendarView calendarView @accessors;
-
- CPArray hiddenRows @accessors;
+ CPArray dayTiles;
+ CPDate date @accessors;
+ CPDate previousMonth @accessors(readonly);
+ CPDate nextMonth @accessors(readonly);
+ BOOL _dataIsDirty;
+
+ BOOL allowsMultipleSelection @accessors;
+ int startSelectionIndex;
+ int currentSelectionIndex;
+ id selectionLengthType @accessors;
+ CPArray selection;
+
+ BOOL highlightCurrentPeriod @accessors;
+ BOOL weekStartsOnMonday @accessors;
+
+ id _delegate @accessors(property=delegate);
+ LPCalendarView calendarView @accessors;
+ CPArray hiddenRows @accessors;
}
+ (CPString)themeClass
@@ -144,6 +141,16 @@ var _startAndEndOfWeekCache = {};
[self reloadData];
}
+- (void)setSelectionLengthType:(id)aSelectionType
+{
+ if (selectionLengthType === aSelectionType)
+ return;
+
+ selectionLengthType = aSelectionType;
+
+ [self reloadData];
+}
+
- (void)tileSize
{
var tileSize = [calendarView currentValueForThemeAttribute:@"tile-size"];

0 comments on commit d32e9fc

Please sign in to comment.