Changeset 97 for Mulberry/branches/v4.1d1/MacOS/Sources/Application/Calendar/Calendar_View/Calendar_Window/CCalendarEventBase.cp
- Timestamp:
- 07/09/07 22:13:35 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/branches/v4.1d1/MacOS/Sources/Application/Calendar/Calendar_View/Calendar_Window/CCalendarEventBase.cp
r74 r97 31 31 #include "CCalendarStoreManager.h" 32 32 #include "CICalendarUtils.h" 33 #include "CICalendarVFreeBusy.h" 33 34 #include "CITIPProcessor.h" 34 35 … … 43 44 LPane(inPaneInfo) 44 45 { 46 mVFreeBusy = NULL; 45 47 mTable = NULL; 46 48 mAllDay = true; … … 132 134 } 133 135 136 void CCalendarEventBase::SetDetails(iCal::CICalendarVFreeBusy* freebusy, const iCal::CICalendarPeriod& period, CCalendarTableBase* table, const char* title, bool all_day, bool start_col, bool end_col, bool horiz) 137 { 138 mVFreeBusy = freebusy; 139 mPeriod = period; 140 mTable = table; 141 142 mTitle = MyCFString(title, kCFStringEncodingUTF8); 143 mAllDay = all_day; 144 mStartsInCol = start_col; 145 mEndsInCol = end_col; 146 mHoriz = horiz; 147 mIsCancelled = false; 148 mHasAlarm = false; 149 mAttendeeState = iCal::CITIPProcessor::GetAttendeeState(*mVFreeBusy); 150 151 // Setup a help tag 152 SetupTagText(); 153 154 // Determine colour 155 iCal::CICalendar* cal = iCal::CICalendar::GetICalendar(mVFreeBusy->GetCalendar()); 156 if (cal) 157 { 158 mColour = calstore::CCalendarStoreManager::sCalendarStoreManager->GetCalendarColour(cal); 159 } 160 } 161 134 162 // Click 135 163 void CCalendarEventBase::ClickSelf(const SMouseDownEvent &inMouseDown) … … 175 203 // Draw title 176 204 rect.origin.x += 3.0; 177 rect.size.width -= 3.0;205 rect.size.width -= (mHoriz && mAllDay || IsFreeBusy()) ? 6.0 : 3.0; 178 206 Rect box; 179 207 CGUtils::HIToQDRect(rect, box); … … 184 212 box.bottom = box.top + 16; 185 213 } 186 ::CGContextSetGrayFillColor(inContext, mIsSelected ? 1.0 : 0.0, 1.0);214 ::CGContextSetGrayFillColor(inContext, mIsSelected && !IsFreeBusy() ? 1.0 : 0.0, 1.0); 187 215 MyCFString trunc(mTitle, kCFStringEncodingUTF8); 188 216 if (mHoriz) 189 217 ::TruncateThemeText(trunc, kThemeSmallSystemFont, kThemeStateActive, rect.size.width, truncEnd, NULL); 190 ::DrawThemeTextBox(trunc, kThemeSmallSystemFont, kThemeStateActive, !mHoriz, &box, mHoriz && mAllDay? teJustCenter : teJustLeft, inContext);218 ::DrawThemeTextBox(trunc, kThemeSmallSystemFont, kThemeStateActive, !mHoriz, &box, (mHoriz && mAllDay || IsFreeBusy()) ? teJustCenter : teJustLeft, inContext); 191 219 192 220 // Strike out text if status is cancelled … … 300 328 float green = CGUtils::GetCGGreen(mColour); 301 329 float blue = CGUtils::GetCGBlue(mColour); 330 float line_factor = IsFreeBusy() ? 1.0 : 0.6; 302 331 if (mIsSelected) 303 332 { 304 333 CGUtils::UnflattenColours(red, green, blue); 305 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 306 ::CGContextSetRGBStrokeColor(inContext, red * 0.6, green * 0.6, blue * 0.6, 1.0); 307 } 308 else 309 { 310 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 311 ::CGContextSetRGBStrokeColor(inContext, red * 0.6, green * 0.6, blue * 0.6, 1.0); 334 if (IsFreeBusy()) 335 ::CGContextSetGrayFillColor(inContext, 1.0, 1.0); 336 else 337 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 338 ::CGContextSetRGBStrokeColor(inContext, red * line_factor, green * line_factor, blue * line_factor, 1.0); 339 } 340 else 341 { 342 if (IsFreeBusy()) 343 ::CGContextSetGrayFillColor(inContext, 1.0, 1.0); 344 else 345 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 346 ::CGContextSetRGBStrokeColor(inContext, red * line_factor, green * line_factor, blue * line_factor, 1.0); 312 347 } 313 348 … … 397 432 rect = ::CGRectInset(rect, 1.0, 1.0); 398 433 434 if (IsFreeBusy()) 435 rect = ::CGRectInset(rect, 3.0, 3.0); 436 399 437 float h_radius = rect.size.height >= 16 ? cRoundRadius : rect.size.height / 2.0; 400 438 float w_radius = rect.size.width >= 16 ? cRoundRadius : rect.size.width / 2.0; … … 462 500 float green = CGUtils::GetCGGreen(mColour); 463 501 float blue = CGUtils::GetCGBlue(mColour); 502 float line_factor = IsFreeBusy() ? 1.0 : 0.6; 464 503 if (mIsSelected) 465 504 { 466 505 CGUtils::UnflattenColours(red, green, blue); 467 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 468 ::CGContextSetRGBStrokeColor(inContext, red * 0.6, green * 0.6, blue * 0.6, 1.0); 469 } 470 else 471 { 472 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 473 ::CGContextSetRGBStrokeColor(inContext, red * 0.6, green * 0.6, blue * 0.6, 1.0); 474 } 506 if (IsFreeBusy()) 507 ::CGContextSetGrayFillColor(inContext, 1.0, 1.0); 508 else 509 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 510 ::CGContextSetRGBStrokeColor(inContext, red * line_factor, green * line_factor, blue * line_factor, 1.0); 511 } 512 else 513 { 514 if (IsFreeBusy()) 515 ::CGContextSetGrayFillColor(inContext, 1.0, 1.0); 516 else 517 ::CGContextSetRGBFillColor(inContext, red, green, blue, 1.0); 518 ::CGContextSetRGBStrokeColor(inContext, red * line_factor, green * line_factor, blue * line_factor, 1.0); 519 } 520 521 if (IsFreeBusy()) 522 ::CGContextSetLineWidth(inContext, 5.0); 475 523 476 524 ::CGContextAddPath(inContext, path); 477 525 ::CGContextDrawPath(inContext, kCGPathFillStroke); 526 527 if (IsFreeBusy()) 528 ::CGContextSetLineWidth(inContext, 1.0); 478 529 479 530 // Check for now marker