OLD | NEW |
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/basewidget/ifwl_monthcalendar.h" | 10 #include "xfa/fwl/basewidget/ifwl_monthcalendar.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const int kSeparatorDOffset = -4; | 46 const int kSeparatorDOffset = -4; |
47 const int kSeparatorX = 3; | 47 const int kSeparatorX = 3; |
48 const int kSeparatorY = kHeaderHeight + kDatesCellHeight + kSeparatorDOffset; | 48 const int kSeparatorY = kHeaderHeight + kDatesCellHeight + kSeparatorDOffset; |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() { | 52 CFWL_MonthCalendarTP::CFWL_MonthCalendarTP() { |
53 m_pThemeData = new MCThemeData; | 53 m_pThemeData = new MCThemeData; |
54 SetThemeData(0); | 54 SetThemeData(0); |
55 } | 55 } |
| 56 |
56 CFWL_MonthCalendarTP::~CFWL_MonthCalendarTP() { | 57 CFWL_MonthCalendarTP::~CFWL_MonthCalendarTP() { |
57 delete m_pThemeData; | 58 delete m_pThemeData; |
58 } | 59 } |
59 FX_BOOL CFWL_MonthCalendarTP::IsValidWidget(IFWL_Widget* pWidget) { | 60 |
60 if (!pWidget) | 61 bool CFWL_MonthCalendarTP::IsValidWidget(IFWL_Widget* pWidget) { |
61 return FALSE; | 62 return pWidget && pWidget->GetClassID() == FWL_Type::MonthCalendar; |
62 return pWidget->GetClassID() == FWL_CLASSHASH_MonthCalendar; | |
63 } | 63 } |
64 uint32_t CFWL_MonthCalendarTP::SetThemeID(IFWL_Widget* pWidget, | 64 uint32_t CFWL_MonthCalendarTP::SetThemeID(IFWL_Widget* pWidget, |
65 uint32_t dwThemeID, | 65 uint32_t dwThemeID, |
66 FX_BOOL bChildren) { | 66 FX_BOOL bChildren) { |
67 if (m_pThemeData) { | 67 if (m_pThemeData) { |
68 SetThemeData(FWL_GetThemeColor(dwThemeID)); | 68 SetThemeData(FWL_GetThemeColor(dwThemeID)); |
69 } | 69 } |
70 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); | 70 return CFWL_WidgetTP::SetThemeID(pWidget, dwThemeID, bChildren); |
71 } | 71 } |
72 FX_BOOL CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) { | 72 FX_BOOL CFWL_MonthCalendarTP::DrawBackground(CFWL_ThemeBackground* pParams) { |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 } else { | 559 } else { |
560 m_pThemeData->clrCaption = ArgbEncode(0xff, 128, 128, 0); | 560 m_pThemeData->clrCaption = ArgbEncode(0xff, 128, 128, 0); |
561 m_pThemeData->clrSeperator = ArgbEncode(0xff, 128, 128, 64); | 561 m_pThemeData->clrSeperator = ArgbEncode(0xff, 128, 128, 64); |
562 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 217, 220, 191); | 562 m_pThemeData->clrDatesHoverBK = ArgbEncode(0xff, 217, 220, 191); |
563 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 204, 208, 183); | 563 m_pThemeData->clrDatesSelectedBK = ArgbEncode(0xff, 204, 208, 183); |
564 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 128, 128, 0); | 564 m_pThemeData->clrDatesCircle = ArgbEncode(0xff, 128, 128, 0); |
565 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); | 565 m_pThemeData->clrToday = ArgbEncode(0xff, 0, 0, 0); |
566 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); | 566 m_pThemeData->clrBK = ArgbEncode(0xff, 255, 255, 255); |
567 } | 567 } |
568 } | 568 } |
OLD | NEW |