- Revision
- 11366
- Author
- jeffrey
- Date
- 2006-08-09 17:21:03 -0700 (Wed, 09 Aug 2006)
Log Message
- Add dashed lines for anyTime, @time, and tentative events
Modified Paths
Diff
Modified: trunk/chandler/application/styles.conf (11365 => 11366)
--- trunk/chandler/application/styles.conf 2006-08-09 22:59:22 UTC (rev 11365) +++ trunk/chandler/application/styles.conf 2006-08-10 00:21:03 UTC (rev 11366) @@ -15,7 +15,7 @@ SectionSample_triageStatus_done = #555555 [colororder] -# listed colors are case sensitive and must all be on one line +# listed colors must all be on one line order = Blue, Green, Rose, Aqua, Salmon, Purple, Yellow, Violet, Fuschia [colors]
Modified: trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py (11365 => 11366)
--- trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py 2006-08-09 22:59:22 UTC (rev 11365) +++ trunk/chandler/parcels/osaf/framework/blocks/calendar/CalendarCanvas.py 2006-08-10 00:21:03 UTC (rev 11366) @@ -301,29 +301,42 @@ def invertColors(self): item = self.item - return (((item.anyTime or item.duration == zero_delta) and - not item.allDay) or - item.transparency == 'fyi' ) + return (self.anyOrZero() or item.transparency == 'fyi') + def dashedLine(self): + item = self.item + return (self.anyOrZero() or item.transparency == 'tentative') + def anyOrZero(self): + item = self.item + return (item.anyTime or item.duration == zero_delta) and not item.allDay + + + def getEventColors(self, selected): """ Returns the appropriate tuple of selected, normal, and visible colors. """ + if self.dashedLine(): + outline = self.colorInfo.selectedFYIColors[2] + mangleOutline = lambda x: (x[0], x[1], outline, x[3]) + else: + mangleOutline = lambda x: x + if self.invertColors(): if selected: - return self.colorInfo.selectedFYIColors + return mangleOutline(self.colorInfo.selectedFYIColors) elif self.isActive: - return self.colorInfo.defaultFYIColors + return mangleOutline(self.colorInfo.defaultFYIColors) - return self.colorInfo.visibleFYIColors + return mangleOutline(self.colorInfo.visibleFYIColors) else: if selected: - return self.colorInfo.selectedColors + return mangleOutline(self.colorInfo.selectedColors) elif self.isActive: - return self.colorInfo.defaultColors + return mangleOutline(self.colorInfo.defaultColors) - return self.colorInfo.visibleColors + return mangleOutline(self.colorInfo.visibleColors) def GetAnyTimeOrAllDay(self): item = self.item @@ -442,7 +455,13 @@ # draw the normal canvas item dc.SetBrush(brush) - dc.SetPen(wx.Pen(outlineColor)) + pen = wx.Pen(outlineColor, 1) + if self.dashedLine(): + pen.SetStyle(wx.USER_DASH) + pen.SetCap(wx.CAP_BUTT) + pen.SetDashes([2,1,4,1]) + dc.SetPen(pen) + self.DrawEventRectangle(dc, itemRect, brush, hasLeftRounded, hasTopRightRounded, @@ -504,7 +523,7 @@ dc.DestroyClippingRegion() if clipRect: - dc.SetClippingRegion(*clipRect) + dc.SetClippingRegion(*clipRect) def DrawEventRectangle(self, dc, rect, brush, hasLeftRounded=False, @@ -518,12 +537,7 @@ Side effect: Destroys the clipping region. """ - - # if your left side is rounded, then everything must be rounded - assert ((hasLeftRounded and - hasTopRightRounded and hasBottomRightRounded) or - not hasLeftRounded) - + diameter = RADIUS * 2 dc.DestroyClippingRegion()
_______________________________________________ Commits mailing list [email protected] http://lists.osafoundation.org/mailman/listinfo/commits
