Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(507)

Side by Side Diff: xfa/fwl/theme/cfwl_monthcalendartp.cpp

Issue 2435603003: Cleanup unused methods and return values in FWL code. (Closed)
Patch Set: Fix typo Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/theme/cfwl_monthcalendartp.h ('k') | xfa/fwl/theme/cfwl_pictureboxtp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/theme/cfwl_monthcalendartp.h" 7 #include "xfa/fwl/theme/cfwl_monthcalendartp.h"
8 8
9 #include "xfa/fde/tto/fde_textout.h" 9 #include "xfa/fde/tto/fde_textout.h"
10 #include "xfa/fwl/core/cfwl_themebackground.h" 10 #include "xfa/fwl/core/cfwl_themebackground.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return pWidget && pWidget->GetClassID() == FWL_Type::MonthCalendar; 59 return pWidget && pWidget->GetClassID() == FWL_Type::MonthCalendar;
60 } 60 }
61 61
62 uint32_t CFWL_MonthCalendarTP::SetThemeID(IFWL_Widget* pWidget, 62 uint32_t CFWL_MonthCalendarTP::SetThemeID(IFWL_Widget* pWidget,
63 uint32_t dwThemeID) { 63 uint32_t dwThemeID) {
64 if (m_pThemeData) 64 if (m_pThemeData)
65 SetThemeData(FWL_GetThemeColor(dwThemeID)); 65 SetThemeData(FWL_GetThemeColor(dwThemeID));
66 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID); 66 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID);
67 } 67 }
68 68
69 FX_BOOL CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) { 69 void CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) {
70 if (!pParams) 70 if (!pParams)
71 return FALSE; 71 return;
72
72 switch (pParams->m_iPart) { 73 switch (pParams->m_iPart) {
73 case CFWL_Part::Border: { 74 case CFWL_Part::Border: {
74 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix); 75 DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);
75 break; 76 break;
76 } 77 }
77 case CFWL_Part::Edge: { 78 case CFWL_Part::Edge: {
78 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(), 79 DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(),
79 &pParams->m_rtPart, &pParams->m_matrix); 80 &pParams->m_rtPart, &pParams->m_matrix);
80 break; 81 break;
81 } 82 }
(...skipping 30 matching lines...) Expand all
112 break; 113 break;
113 } 114 }
114 case CFWL_Part::DateInCircle: { 115 case CFWL_Part::DateInCircle: {
115 DrawDatesInCircle(pParams, &pParams->m_matrix); 116 DrawDatesInCircle(pParams, &pParams->m_matrix);
116 break; 117 break;
117 } 118 }
118 case CFWL_Part::WeekNumSep: { 119 case CFWL_Part::WeekNumSep: {
119 DrawWeekNumSep(pParams, &pParams->m_matrix); 120 DrawWeekNumSep(pParams, &pParams->m_matrix);
120 break; 121 break;
121 } 122 }
122 default: {} 123 default:
124 break;
123 } 125 }
124 return TRUE;
125 } 126 }
126 FX_BOOL CFWL_MonthCalendarTP::DrawText(CFWL_ThemeText* pParams) { 127
128 void CFWL_MonthCalendarTP::DrawText(CFWL_ThemeText* pParams) {
127 if (!m_pTextOut) 129 if (!m_pTextOut)
128 return FALSE; 130 return;
131
129 if ((pParams->m_iPart == CFWL_Part::DatesIn) && 132 if ((pParams->m_iPart == CFWL_Part::DatesIn) &&
130 !(pParams->m_dwStates & FWL_ITEMSTATE_MCD_Flag) && 133 !(pParams->m_dwStates & FWL_ITEMSTATE_MCD_Flag) &&
131 (pParams->m_dwStates & 134 (pParams->m_dwStates &
132 (CFWL_PartState_Hovered | CFWL_PartState_Selected))) { 135 (CFWL_PartState_Hovered | CFWL_PartState_Selected))) {
133 m_pTextOut->SetTextColor(0xFFFFFFFF); 136 m_pTextOut->SetTextColor(0xFFFFFFFF);
134 } else if (pParams->m_iPart == CFWL_Part::Caption) { 137 } else if (pParams->m_iPart == CFWL_Part::Caption) {
135 m_pTextOut->SetTextColor(m_pThemeData->clrCaption); 138 m_pTextOut->SetTextColor(m_pThemeData->clrCaption);
136 } else { 139 } else {
137 m_pTextOut->SetTextColor(0xFF000000); 140 m_pTextOut->SetTextColor(0xFF000000);
138 } 141 }
139 return CFWL_WidgetTP::DrawText(pParams); 142 CFWL_WidgetTP::DrawText(pParams);
140 } 143 }
144
141 void* CFWL_MonthCalendarTP::GetCapacity(CFWL_ThemePart* pThemePart, 145 void* CFWL_MonthCalendarTP::GetCapacity(CFWL_ThemePart* pThemePart,
142 CFWL_WidgetCapacity dwCapacity) { 146 CFWL_WidgetCapacity dwCapacity) {
143 FX_BOOL bDefPro = FALSE; 147 FX_BOOL bDefPro = FALSE;
144 FX_BOOL bDwordVal = FALSE; 148 FX_BOOL bDwordVal = FALSE;
145 switch (dwCapacity) { 149 switch (dwCapacity) {
146 case CFWL_WidgetCapacity::HeaderWidth: { 150 case CFWL_WidgetCapacity::HeaderWidth: {
147 m_fValue = kHeaderWidth; 151 m_fValue = kHeaderWidth;
148 break; 152 break;
149 } 153 }
150 case CFWL_WidgetCapacity::HeaderHeight: { 154 case CFWL_WidgetCapacity::HeaderHeight: {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 return &wsResource; 333 return &wsResource;
330 } 334 }
331 case CFWL_WidgetCapacity::December: { 335 case CFWL_WidgetCapacity::December: {
332 wsResource = L"December"; 336 wsResource = L"December";
333 return &wsResource; 337 return &wsResource;
334 } 338 }
335 case CFWL_WidgetCapacity::Today: { 339 case CFWL_WidgetCapacity::Today: {
336 wsResource = L"Today"; 340 wsResource = L"Today";
337 return &wsResource; 341 return &wsResource;
338 } 342 }
339 default: { bDefPro = TRUE; } 343 default:
344 bDefPro = TRUE;
345 break;
340 } 346 }
341 if (!bDefPro) { 347 if (!bDefPro) {
342 if (bDwordVal) { 348 if (bDwordVal)
343 return &m_dwValue; 349 return &m_dwValue;
344 }
345 return &m_fValue; 350 return &m_fValue;
346 } 351 }
347 return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity); 352 return CFWL_WidgetTP::GetCapacity(pThemePart, dwCapacity);
348 } 353 }
349 FWL_Error CFWL_MonthCalendarTP::Initialize() { 354
355 void CFWL_MonthCalendarTP::Initialize() {
350 InitTTO(); 356 InitTTO();
351 return CFWL_WidgetTP::Initialize(); 357 CFWL_WidgetTP::Initialize();
352 } 358 }
353 FWL_Error CFWL_MonthCalendarTP::Finalize() { 359
360 void CFWL_MonthCalendarTP::Finalize() {
354 FinalizeTTO(); 361 FinalizeTTO();
355 return CFWL_WidgetTP::Finalize(); 362 CFWL_WidgetTP::Finalize();
356 } 363 }
357 FX_BOOL CFWL_MonthCalendarTP::DrawTotalBK(CFWL_ThemeBackground* pParams, 364
358 CFX_Matrix* pMatrix) { 365 void CFWL_MonthCalendarTP::DrawTotalBK(CFWL_ThemeBackground* pParams,
366 CFX_Matrix* pMatrix) {
359 CFX_Path path; 367 CFX_Path path;
360 path.Create(); 368 path.Create();
361 CFX_RectF rtTotal(pParams->m_rtPart); 369 CFX_RectF rtTotal(pParams->m_rtPart);
362 path.AddRectangle(rtTotal.left, rtTotal.top, rtTotal.width, rtTotal.height); 370 path.AddRectangle(rtTotal.left, rtTotal.top, rtTotal.width, rtTotal.height);
363 pParams->m_pGraphics->SaveGraphState(); 371 pParams->m_pGraphics->SaveGraphState();
364 CFX_Color clrBK(m_pThemeData->clrBK); 372 CFX_Color clrBK(m_pThemeData->clrBK);
365 pParams->m_pGraphics->SetFillColor(&clrBK); 373 pParams->m_pGraphics->SetFillColor(&clrBK);
366 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 374 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
367 pParams->m_pGraphics->RestoreGraphState(); 375 pParams->m_pGraphics->RestoreGraphState();
368 return TRUE;
369 } 376 }
370 FX_BOOL CFWL_MonthCalendarTP::DrawHeadBk(CFWL_ThemeBackground* pParams, 377
371 CFX_Matrix* pMatrix) { 378 void CFWL_MonthCalendarTP::DrawHeadBk(CFWL_ThemeBackground* pParams,
379 CFX_Matrix* pMatrix) {
372 CFX_Path path; 380 CFX_Path path;
373 path.Create(); 381 path.Create();
374 CFX_RectF rtHead = pParams->m_rtPart; 382 CFX_RectF rtHead = pParams->m_rtPart;
375 path.AddRectangle(rtHead.left, rtHead.top, rtHead.width, rtHead.height); 383 path.AddRectangle(rtHead.left, rtHead.top, rtHead.width, rtHead.height);
376 pParams->m_pGraphics->SaveGraphState(); 384 pParams->m_pGraphics->SaveGraphState();
377 CFX_Color clrHeadBK(m_pThemeData->clrBK); 385 CFX_Color clrHeadBK(m_pThemeData->clrBK);
378 pParams->m_pGraphics->SetFillColor(&clrHeadBK); 386 pParams->m_pGraphics->SetFillColor(&clrHeadBK);
379 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 387 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
380 pParams->m_pGraphics->RestoreGraphState(); 388 pParams->m_pGraphics->RestoreGraphState();
381 return TRUE;
382 } 389 }
383 FX_BOOL CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams, 390
384 CFX_Matrix* pMatrix) { 391 void CFWL_MonthCalendarTP::DrawLButton(CFWL_ThemeBackground* pParams,
392 CFX_Matrix* pMatrix) {
385 CFX_Path path; 393 CFX_Path path;
386 path.Create(); 394 path.Create();
387 CFX_RectF rtLBtn; 395 CFX_RectF rtLBtn;
388 rtLBtn = pParams->m_rtPart; 396 rtLBtn = pParams->m_rtPart;
389 path.AddRectangle(rtLBtn.left, rtLBtn.top, rtLBtn.width, rtLBtn.height); 397 path.AddRectangle(rtLBtn.left, rtLBtn.top, rtLBtn.width, rtLBtn.height);
390 pParams->m_pGraphics->SaveGraphState(); 398 pParams->m_pGraphics->SaveGraphState();
391 CFX_Color clrLBtnEdge(ArgbEncode(0xff, 205, 219, 243)); 399 CFX_Color clrLBtnEdge(ArgbEncode(0xff, 205, 219, 243));
392 pParams->m_pGraphics->SetStrokeColor(&clrLBtnEdge); 400 pParams->m_pGraphics->SetStrokeColor(&clrLBtnEdge);
393 pParams->m_pGraphics->StrokePath(&path, pMatrix); 401 pParams->m_pGraphics->StrokePath(&path, pMatrix);
394 if (pParams->m_dwStates & CFWL_PartState_Pressed) { 402 if (pParams->m_dwStates & CFWL_PartState_Pressed) {
395 CFX_Color clrLBtnFill(ArgbEncode(0xff, 174, 198, 242)); 403 CFX_Color clrLBtnFill(ArgbEncode(0xff, 174, 198, 242));
396 pParams->m_pGraphics->SetFillColor(&clrLBtnFill); 404 pParams->m_pGraphics->SetFillColor(&clrLBtnFill);
397 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 405 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
398 } else { 406 } else {
399 CFX_Color clrLBtnFill(ArgbEncode(0xff, 227, 235, 249)); 407 CFX_Color clrLBtnFill(ArgbEncode(0xff, 227, 235, 249));
400 pParams->m_pGraphics->SetFillColor(&clrLBtnFill); 408 pParams->m_pGraphics->SetFillColor(&clrLBtnFill);
401 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 409 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
402 } 410 }
403 path.Clear(); 411 path.Clear();
404 path.MoveTo(rtLBtn.left + rtLBtn.Width() / 3 * 2, 412 path.MoveTo(rtLBtn.left + rtLBtn.Width() / 3 * 2,
405 rtLBtn.top + rtLBtn.height / 4); 413 rtLBtn.top + rtLBtn.height / 4);
406 path.LineTo(rtLBtn.left + rtLBtn.Width() / 3, rtLBtn.top + rtLBtn.height / 2); 414 path.LineTo(rtLBtn.left + rtLBtn.Width() / 3, rtLBtn.top + rtLBtn.height / 2);
407 path.LineTo(rtLBtn.left + rtLBtn.Width() / 3 * 2, 415 path.LineTo(rtLBtn.left + rtLBtn.Width() / 3 * 2,
408 rtLBtn.bottom() - rtLBtn.height / 4); 416 rtLBtn.bottom() - rtLBtn.height / 4);
409 CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205)); 417 CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205));
410 pParams->m_pGraphics->SetStrokeColor(&clrFlag); 418 pParams->m_pGraphics->SetStrokeColor(&clrFlag);
411 pParams->m_pGraphics->StrokePath(&path, pMatrix); 419 pParams->m_pGraphics->StrokePath(&path, pMatrix);
412 pParams->m_pGraphics->RestoreGraphState(); 420 pParams->m_pGraphics->RestoreGraphState();
413 return TRUE;
414 } 421 }
415 FX_BOOL CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams, 422
416 CFX_Matrix* pMatrix) { 423 void CFWL_MonthCalendarTP::DrawRButton(CFWL_ThemeBackground* pParams,
424 CFX_Matrix* pMatrix) {
417 CFX_Path path; 425 CFX_Path path;
418 path.Create(); 426 path.Create();
419 CFX_RectF rtRBtn; 427 CFX_RectF rtRBtn;
420 rtRBtn = pParams->m_rtPart; 428 rtRBtn = pParams->m_rtPart;
421 path.AddRectangle(rtRBtn.left, rtRBtn.top, rtRBtn.width, rtRBtn.height); 429 path.AddRectangle(rtRBtn.left, rtRBtn.top, rtRBtn.width, rtRBtn.height);
422 pParams->m_pGraphics->SaveGraphState(); 430 pParams->m_pGraphics->SaveGraphState();
423 CFX_Color clrRBtnEdge(ArgbEncode(0xff, 205, 219, 243)); 431 CFX_Color clrRBtnEdge(ArgbEncode(0xff, 205, 219, 243));
424 pParams->m_pGraphics->SetStrokeColor(&clrRBtnEdge); 432 pParams->m_pGraphics->SetStrokeColor(&clrRBtnEdge);
425 pParams->m_pGraphics->StrokePath(&path, pMatrix); 433 pParams->m_pGraphics->StrokePath(&path, pMatrix);
426 if (pParams->m_dwStates & CFWL_PartState_Pressed) { 434 if (pParams->m_dwStates & CFWL_PartState_Pressed) {
427 CFX_Color clrRBtnFill(ArgbEncode(0xff, 174, 198, 242)); 435 CFX_Color clrRBtnFill(ArgbEncode(0xff, 174, 198, 242));
428 pParams->m_pGraphics->SetFillColor(&clrRBtnFill); 436 pParams->m_pGraphics->SetFillColor(&clrRBtnFill);
429 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 437 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
430 } else { 438 } else {
431 CFX_Color clrRBtnFill(ArgbEncode(0xff, 227, 235, 249)); 439 CFX_Color clrRBtnFill(ArgbEncode(0xff, 227, 235, 249));
432 pParams->m_pGraphics->SetFillColor(&clrRBtnFill); 440 pParams->m_pGraphics->SetFillColor(&clrRBtnFill);
433 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 441 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
434 } 442 }
435 path.Clear(); 443 path.Clear();
436 path.MoveTo(rtRBtn.left + rtRBtn.Width() / 3, rtRBtn.top + rtRBtn.height / 4); 444 path.MoveTo(rtRBtn.left + rtRBtn.Width() / 3, rtRBtn.top + rtRBtn.height / 4);
437 path.LineTo(rtRBtn.left + rtRBtn.Width() / 3 * 2, 445 path.LineTo(rtRBtn.left + rtRBtn.Width() / 3 * 2,
438 rtRBtn.top + rtRBtn.height / 2); 446 rtRBtn.top + rtRBtn.height / 2);
439 path.LineTo(rtRBtn.left + rtRBtn.Width() / 3, 447 path.LineTo(rtRBtn.left + rtRBtn.Width() / 3,
440 rtRBtn.bottom() - rtRBtn.height / 4); 448 rtRBtn.bottom() - rtRBtn.height / 4);
441 CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205)); 449 CFX_Color clrFlag(ArgbEncode(0xff, 50, 104, 205));
442 pParams->m_pGraphics->SetStrokeColor(&clrFlag); 450 pParams->m_pGraphics->SetStrokeColor(&clrFlag);
443 pParams->m_pGraphics->StrokePath(&path, pMatrix); 451 pParams->m_pGraphics->StrokePath(&path, pMatrix);
444 pParams->m_pGraphics->RestoreGraphState(); 452 pParams->m_pGraphics->RestoreGraphState();
445 return TRUE;
446 } 453 }
447 FX_BOOL CFWL_MonthCalendarTP::DrawHSeperator(CFWL_ThemeBackground* pParams, 454
448 CFX_Matrix* pMatrix) { 455 void CFWL_MonthCalendarTP::DrawHSeperator(CFWL_ThemeBackground* pParams,
456 CFX_Matrix* pMatrix) {
449 CFX_Path path; 457 CFX_Path path;
450 path.Create(); 458 path.Create();
451 CFX_RectF rtHSep; 459 CFX_RectF rtHSep;
452 rtHSep = pParams->m_rtPart; 460 rtHSep = pParams->m_rtPart;
453 path.MoveTo(rtHSep.left, rtHSep.top + rtHSep.height / 2); 461 path.MoveTo(rtHSep.left, rtHSep.top + rtHSep.height / 2);
454 path.LineTo(rtHSep.right(), rtHSep.top + rtHSep.height / 2); 462 path.LineTo(rtHSep.right(), rtHSep.top + rtHSep.height / 2);
455 pParams->m_pGraphics->SaveGraphState(); 463 pParams->m_pGraphics->SaveGraphState();
456 CFX_Color clrHSep(m_pThemeData->clrSeperator); 464 CFX_Color clrHSep(m_pThemeData->clrSeperator);
457 pParams->m_pGraphics->SetStrokeColor(&clrHSep); 465 pParams->m_pGraphics->SetStrokeColor(&clrHSep);
458 pParams->m_pGraphics->StrokePath(&path, pMatrix); 466 pParams->m_pGraphics->StrokePath(&path, pMatrix);
459 pParams->m_pGraphics->RestoreGraphState(); 467 pParams->m_pGraphics->RestoreGraphState();
460 return TRUE;
461 } 468 }
462 469
463 FX_BOOL CFWL_MonthCalendarTP::DrawWeekNumSep(CFWL_ThemeBackground* pParams, 470 void CFWL_MonthCalendarTP::DrawWeekNumSep(CFWL_ThemeBackground* pParams,
464 CFX_Matrix* pMatrix) { 471 CFX_Matrix* pMatrix) {
465 CFX_Path path; 472 CFX_Path path;
466 path.Create(); 473 path.Create();
467 CFX_RectF rtWeekSep; 474 CFX_RectF rtWeekSep;
468 rtWeekSep = pParams->m_rtPart; 475 rtWeekSep = pParams->m_rtPart;
469 path.MoveTo(rtWeekSep.left, rtWeekSep.top); 476 path.MoveTo(rtWeekSep.left, rtWeekSep.top);
470 path.LineTo(rtWeekSep.left, rtWeekSep.bottom()); 477 path.LineTo(rtWeekSep.left, rtWeekSep.bottom());
471 pParams->m_pGraphics->SaveGraphState(); 478 pParams->m_pGraphics->SaveGraphState();
472 CFX_Color clrHSep(m_pThemeData->clrSeperator); 479 CFX_Color clrHSep(m_pThemeData->clrSeperator);
473 pParams->m_pGraphics->SetStrokeColor(&clrHSep); 480 pParams->m_pGraphics->SetStrokeColor(&clrHSep);
474 pParams->m_pGraphics->StrokePath(&path, pMatrix); 481 pParams->m_pGraphics->StrokePath(&path, pMatrix);
475 pParams->m_pGraphics->RestoreGraphState(); 482 pParams->m_pGraphics->RestoreGraphState();
476 return TRUE;
477 } 483 }
478 484
479 FX_BOOL CFWL_MonthCalendarTP::DrawDatesInBK(CFWL_ThemeBackground* pParams, 485 void CFWL_MonthCalendarTP::DrawDatesInBK(CFWL_ThemeBackground* pParams,
480 CFX_Matrix* pMatrix) { 486 CFX_Matrix* pMatrix) {
481 pParams->m_pGraphics->SaveGraphState(); 487 pParams->m_pGraphics->SaveGraphState();
482 if (pParams->m_dwStates & CFWL_PartState_Selected) { 488 if (pParams->m_dwStates & CFWL_PartState_Selected) {
483 CFX_Path path; 489 CFX_Path path;
484 path.Create(); 490 path.Create();
485 CFX_RectF rtSelDay; 491 CFX_RectF rtSelDay;
486 rtSelDay = pParams->m_rtPart; 492 rtSelDay = pParams->m_rtPart;
487 path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, 493 path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width,
488 rtSelDay.height); 494 rtSelDay.height);
489 CFX_Color clrSelDayBK(m_pThemeData->clrDatesSelectedBK); 495 CFX_Color clrSelDayBK(m_pThemeData->clrDatesSelectedBK);
490 pParams->m_pGraphics->SetFillColor(&clrSelDayBK); 496 pParams->m_pGraphics->SetFillColor(&clrSelDayBK);
491 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 497 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
492 } else if (pParams->m_dwStates & CFWL_PartState_Hovered) { 498 } else if (pParams->m_dwStates & CFWL_PartState_Hovered) {
493 CFX_Path path; 499 CFX_Path path;
494 path.Create(); 500 path.Create();
495 CFX_RectF rtSelDay; 501 CFX_RectF rtSelDay;
496 rtSelDay = pParams->m_rtPart; 502 rtSelDay = pParams->m_rtPart;
497 path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, 503 path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width,
498 rtSelDay.height); 504 rtSelDay.height);
499 CFX_Color clrSelDayBK(m_pThemeData->clrDatesHoverBK); 505 CFX_Color clrSelDayBK(m_pThemeData->clrDatesHoverBK);
500 pParams->m_pGraphics->SetFillColor(&clrSelDayBK); 506 pParams->m_pGraphics->SetFillColor(&clrSelDayBK);
501 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); 507 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
502 } 508 }
503 pParams->m_pGraphics->RestoreGraphState(); 509 pParams->m_pGraphics->RestoreGraphState();
504 return FALSE;
505 } 510 }
506 511
507 FX_BOOL CFWL_MonthCalendarTP::DrawDatesInCircle(CFWL_ThemeBackground* pParams, 512 void CFWL_MonthCalendarTP::DrawDatesInCircle(CFWL_ThemeBackground* pParams,
508 CFX_Matrix* pMatrix) { 513 CFX_Matrix* pMatrix) {
509 CFX_Path path; 514 CFX_Path path;
510 path.Create(); 515 path.Create();
511 CFX_RectF rtSelDay; 516 CFX_RectF rtSelDay;
512 rtSelDay = pParams->m_rtPart; 517 rtSelDay = pParams->m_rtPart;
513 path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width, 518 path.AddRectangle(rtSelDay.left, rtSelDay.top, rtSelDay.width,
514 rtSelDay.height); 519 rtSelDay.height);
515 pParams->m_pGraphics->SaveGraphState(); 520 pParams->m_pGraphics->SaveGraphState();
516 CFX_Color clrSelDayBK(m_pThemeData->clrDatesCircle); 521 CFX_Color clrSelDayBK(m_pThemeData->clrDatesCircle);
517 pParams->m_pGraphics->SetStrokeColor(&clrSelDayBK); 522 pParams->m_pGraphics->SetStrokeColor(&clrSelDayBK);
518 pParams->m_pGraphics->StrokePath(&path, pMatrix); 523 pParams->m_pGraphics->StrokePath(&path, pMatrix);
519 pParams->m_pGraphics->RestoreGraphState(); 524 pParams->m_pGraphics->RestoreGraphState();
520 return TRUE;
521 } 525 }
522 526
523 FX_BOOL CFWL_MonthCalendarTP::DrawTodayCircle(CFWL_ThemeBackground* pParams, 527 void CFWL_MonthCalendarTP::DrawTodayCircle(CFWL_ThemeBackground* pParams,
524 CFX_Matrix* pMatrix) { 528 CFX_Matrix* pMatrix) {
525 CFX_Path path; 529 CFX_Path path;
526 path.Create(); 530 path.Create();
527 CFX_RectF rtTodayCircle; 531 CFX_RectF rtTodayCircle;
528 rtTodayCircle = pParams->m_rtPart; 532 rtTodayCircle = pParams->m_rtPart;
529 path.AddRectangle(rtTodayCircle.left, rtTodayCircle.top, rtTodayCircle.width, 533 path.AddRectangle(rtTodayCircle.left, rtTodayCircle.top, rtTodayCircle.width,
530 rtTodayCircle.height); 534 rtTodayCircle.height);
531 pParams->m_pGraphics->SaveGraphState(); 535 pParams->m_pGraphics->SaveGraphState();
532 CFX_Color clrTodayCircle(m_pThemeData->clrDatesCircle); 536 CFX_Color clrTodayCircle(m_pThemeData->clrDatesCircle);
533 pParams->m_pGraphics->SetStrokeColor(&clrTodayCircle); 537 pParams->m_pGraphics->SetStrokeColor(&clrTodayCircle);
534 pParams->m_pGraphics->StrokePath(&path, pMatrix); 538 pParams->m_pGraphics->StrokePath(&path, pMatrix);
535 pParams->m_pGraphics->RestoreGraphState(); 539 pParams->m_pGraphics->RestoreGraphState();
536 return TRUE;
537 } 540 }
538 541
539 FWLTHEME_STATE CFWL_MonthCalendarTP::GetState(uint32_t dwFWLStates) { 542 FWLTHEME_STATE CFWL_MonthCalendarTP::GetState(uint32_t dwFWLStates) {
540 if (dwFWLStates & CFWL_PartState_Hovered) 543 if (dwFWLStates & CFWL_PartState_Hovered)
541 return FWLTHEME_STATE_Hover; 544 return FWLTHEME_STATE_Hover;
542 if (dwFWLStates & CFWL_PartState_Pressed) 545 if (dwFWLStates & CFWL_PartState_Pressed)
543 return FWLTHEME_STATE_Pressed; 546 return FWLTHEME_STATE_Pressed;
544 return FWLTHEME_STATE_Normal; 547 return FWLTHEME_STATE_Normal;
545 } 548 }
546 549
547 void CFWL_MonthCalendarTP::SetThemeData(uint32_t dwThemeID) { 550 void CFWL_MonthCalendarTP::SetThemeData(uint32_t dwThemeID) {
548 if (dwThemeID == 0) { 551 if (dwThemeID == 0) {
549 m_pThemeData->clrCaption = ArgbEncode(0xff, 0, 153, 255); 552 m_pThemeData->clrCaption = ArgbEncode(0xff, 0, 153, 255);
550 m_pThemeData->clrSeperator = ArgbEncode(0xff, 141, 161, 239); 553 m_pThemeData->clrSeperator = ArgbEncode(0xff, 141, 161, 239);
551 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 193, 211, 251); 554 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 193, 211, 251);
552 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 173, 188, 239); 555 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 173, 188, 239);
553 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 103, 144, 209); 556 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 103, 144, 209);
554 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); 557 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0);
555 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); 558 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255);
556 } else { 559 } else {
557 m_pThemeData->clrCaption = ArgbEncode(0xff, 128, 128, 0); 560 m_pThemeData->clrCaption = ArgbEncode(0xff, 128, 128, 0);
558 m_pThemeData->clrSeperator = ArgbEncode(0xff, 128, 128, 64); 561 m_pThemeData->clrSeperator = ArgbEncode(0xff, 128, 128, 64);
559 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 217, 220, 191); 562 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 217, 220, 191);
560 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 204, 208, 183); 563 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 204, 208, 183);
561 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 128, 128, 0); 564 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 128, 128, 0);
562 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); 565 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0);
563 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); 566 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255);
564 } 567 }
565 } 568 }
OLDNEW
« no previous file with comments | « xfa/fwl/theme/cfwl_monthcalendartp.h ('k') | xfa/fwl/theme/cfwl_pictureboxtp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698