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_edittp.h" | 7 #include "xfa/fwl/theme/cfwl_edittp.h" |
8 | 8 |
9 #include "xfa/fwl/basewidget/ifwl_edit.h" | 9 #include "xfa/fwl/basewidget/ifwl_edit.h" |
10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 CFX_Graphics* pGraphics = pParams->m_pGraphics; | 36 CFX_Graphics* pGraphics = pParams->m_pGraphics; |
37 pGraphics->SaveGraphState(); | 37 pGraphics->SaveGraphState(); |
38 CFX_Color crSelected(FWL_GetThemeColor(m_dwThemeID) == 0 | 38 CFX_Color crSelected(FWL_GetThemeColor(m_dwThemeID) == 0 |
39 ? FWLTHEME_COLOR_BKSelected | 39 ? FWLTHEME_COLOR_BKSelected |
40 : FWLTHEME_COLOR_Green_BKSelected); | 40 : FWLTHEME_COLOR_Green_BKSelected); |
41 pGraphics->SetFillColor(&crSelected); | 41 pGraphics->SetFillColor(&crSelected); |
42 pGraphics->FillPath(pParams->m_pPath, FXFILL_WINDING, | 42 pGraphics->FillPath(pParams->m_pPath, FXFILL_WINDING, |
43 &pParams->m_matrix); | 43 &pParams->m_matrix); |
44 pGraphics->RestoreGraphState(); | 44 pGraphics->RestoreGraphState(); |
45 } else { | 45 } else { |
46 FX_BOOL bStatic = | |
47 pParams->m_dwData == FWL_PARTDATA_EDT_StaticBackground; | |
48 CFX_Path path; | 46 CFX_Path path; |
49 path.Create(); | 47 path.Create(); |
50 path.AddRectangle(pParams->m_rtPart.left, pParams->m_rtPart.top, | 48 path.AddRectangle(pParams->m_rtPart.left, pParams->m_rtPart.top, |
51 pParams->m_rtPart.width, pParams->m_rtPart.height); | 49 pParams->m_rtPart.width, pParams->m_rtPart.height); |
52 CFX_Color cr(FWLTHEME_COLOR_Background); | 50 CFX_Color cr(FWLTHEME_COLOR_Background); |
53 if (!bStatic) { | 51 if (!pParams->m_bStaticBackground) { |
54 if (pParams->m_dwStates & CFWL_PartState_Disabled) | 52 if (pParams->m_dwStates & CFWL_PartState_Disabled) |
55 cr.Set(FWLTHEME_COLOR_EDGERB1); | 53 cr.Set(FWLTHEME_COLOR_EDGERB1); |
56 else if (pParams->m_dwStates & CFWL_PartState_ReadOnly) | 54 else if (pParams->m_dwStates & CFWL_PartState_ReadOnly) |
57 cr.Set(ArgbEncode(255, 236, 233, 216)); | 55 cr.Set(ArgbEncode(255, 236, 233, 216)); |
58 else | 56 else |
59 cr.Set(0xFFFFFFFF); | 57 cr.Set(0xFFFFFFFF); |
60 } | 58 } |
61 pParams->m_pGraphics->SaveGraphState(); | 59 pParams->m_pGraphics->SaveGraphState(); |
62 pParams->m_pGraphics->SetFillColor(&cr); | 60 pParams->m_pGraphics->SetFillColor(&cr); |
63 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, | 61 pParams->m_pGraphics->FillPath(&path, FXFILL_WINDING, |
(...skipping 16 matching lines...) Expand all Loading... |
80 return TRUE; | 78 return TRUE; |
81 } | 79 } |
82 FWL_ERR CFWL_EditTP::Initialize() { | 80 FWL_ERR CFWL_EditTP::Initialize() { |
83 InitTTO(); | 81 InitTTO(); |
84 return CFWL_WidgetTP::Initialize(); | 82 return CFWL_WidgetTP::Initialize(); |
85 } | 83 } |
86 FWL_ERR CFWL_EditTP::Finalize() { | 84 FWL_ERR CFWL_EditTP::Finalize() { |
87 FinalizeTTO(); | 85 FinalizeTTO(); |
88 return CFWL_WidgetTP::Finalize(); | 86 return CFWL_WidgetTP::Finalize(); |
89 } | 87 } |
OLD | NEW |