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/cfwl_form.h" | 7 #include "xfa/fwl/cfwl_form.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 : FWL_WidgetHit::Client; | 76 : FWL_WidgetHit::Client; |
77 } | 77 } |
78 | 78 |
79 void CFWL_Form::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { | 79 void CFWL_Form::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) { |
80 if (!pGraphics) | 80 if (!pGraphics) |
81 return; | 81 return; |
82 if (!m_pProperties->m_pThemeProvider) | 82 if (!m_pProperties->m_pThemeProvider) |
83 return; | 83 return; |
84 | 84 |
85 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; | 85 IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider; |
86 bool bInactive = !IsActive(); | |
87 int32_t iState = bInactive ? CFWL_PartState_Inactive : CFWL_PartState_Normal; | |
88 DrawBackground(pGraphics, pTheme); | 86 DrawBackground(pGraphics, pTheme); |
89 | 87 |
90 #ifdef FWL_UseMacSystemBorder | 88 #ifdef FWL_UseMacSystemBorder |
91 return; | 89 return; |
92 #endif | 90 #endif |
93 CFWL_ThemeBackground param; | 91 CFWL_ThemeBackground param; |
94 param.m_pWidget = this; | 92 param.m_pWidget = this; |
95 param.m_dwStates = iState; | 93 param.m_dwStates = CFWL_PartState_Normal; |
96 param.m_pGraphics = pGraphics; | 94 param.m_pGraphics = pGraphics; |
97 param.m_rtPart = m_rtRelative; | 95 param.m_rtPart = m_rtRelative; |
98 if (pMatrix) | 96 if (pMatrix) |
99 param.m_matrix.Concat(*pMatrix); | 97 param.m_matrix.Concat(*pMatrix); |
100 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) { | 98 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) { |
101 param.m_iPart = CFWL_Part::Border; | 99 param.m_iPart = CFWL_Part::Border; |
102 pTheme->DrawBackground(¶m); | 100 pTheme->DrawBackground(¶m); |
103 } | 101 } |
104 if ((m_pProperties->m_dwStyleExes & FWL_WGTSTYLE_EdgeMask) != | 102 if ((m_pProperties->m_dwStyleExes & FWL_WGTSTYLE_EdgeMask) != |
105 FWL_WGTSTYLE_EdgeNone) { | 103 FWL_WGTSTYLE_EdgeNone) { |
106 param.m_iPart = CFWL_Part::Edge; | 104 param.m_iPart = CFWL_Part::Edge; |
107 param.m_rtPart = GetEdgeRect(); | 105 param.m_rtPart = GetEdgeRect(); |
108 param.m_dwStates = iState; | 106 param.m_dwStates = CFWL_PartState_Normal; |
109 pTheme->DrawBackground(¶m); | 107 pTheme->DrawBackground(¶m); |
110 } | 108 } |
111 } | 109 } |
112 | 110 |
113 CFWL_Widget* CFWL_Form::DoModal() { | 111 CFWL_Widget* CFWL_Form::DoModal() { |
114 const CFWL_App* pApp = GetOwnerApp(); | 112 const CFWL_App* pApp = GetOwnerApp(); |
115 if (!pApp) | 113 if (!pApp) |
116 return nullptr; | 114 return nullptr; |
117 | 115 |
118 CFWL_NoteDriver* pDriver = pApp->GetNoteDriver(); | 116 CFWL_NoteDriver* pDriver = pApp->GetNoteDriver(); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 DrawWidget(pGraphics, pMatrix); | 252 DrawWidget(pGraphics, pMatrix); |
255 } | 253 } |
256 | 254 |
257 void CFWL_Form::OnLButtonDown(CFWL_MessageMouse* pMsg) { | 255 void CFWL_Form::OnLButtonDown(CFWL_MessageMouse* pMsg) { |
258 SetGrab(true); | 256 SetGrab(true); |
259 } | 257 } |
260 | 258 |
261 void CFWL_Form::OnLButtonUp(CFWL_MessageMouse* pMsg) { | 259 void CFWL_Form::OnLButtonUp(CFWL_MessageMouse* pMsg) { |
262 SetGrab(false); | 260 SetGrab(false); |
263 } | 261 } |
OLD | NEW |