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/core/cfwl_form.h" | 7 #include "xfa/fwl/core/cfwl_form.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 FWL_Type CFWL_Form::GetClassID() const { | 73 FWL_Type CFWL_Form::GetClassID() const { |
74 return FWL_Type::Form; | 74 return FWL_Type::Form; |
75 } | 75 } |
76 | 76 |
77 bool CFWL_Form::IsInstance(const CFX_WideStringC& wsClass) const { | 77 bool CFWL_Form::IsInstance(const CFX_WideStringC& wsClass) const { |
78 if (wsClass == CFX_WideStringC(FWL_CLASS_Form)) | 78 if (wsClass == CFX_WideStringC(FWL_CLASS_Form)) |
79 return true; | 79 return true; |
80 return CFWL_Widget::IsInstance(wsClass); | 80 return CFWL_Widget::IsInstance(wsClass); |
81 } | 81 } |
82 | 82 |
83 void CFWL_Form::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { | |
84 if (!bAutoSize) { | |
85 rect = m_pProperties->m_rtWidget; | |
86 return; | |
87 } | |
88 | |
89 rect.Reset(); | |
90 FX_FLOAT fCXBorder = GetBorderSize(true); | |
91 FX_FLOAT fCYBorder = GetBorderSize(false); | |
92 FX_FLOAT fEdge = GetEdgeWidth(); | |
93 rect.height += fCYBorder + fEdge + fEdge; | |
94 rect.width += fCXBorder + fCXBorder + fEdge + fEdge; | |
95 } | |
96 | |
97 void CFWL_Form::GetClientRect(CFX_RectF& rect) { | 83 void CFWL_Form::GetClientRect(CFX_RectF& rect) { |
98 rect = m_pProperties->m_rtWidget; | 84 rect = m_pProperties->m_rtWidget; |
99 rect.Offset(-rect.left, -rect.top); | 85 rect.Offset(-rect.left, -rect.top); |
100 } | 86 } |
101 | 87 |
102 void CFWL_Form::Update() { | 88 void CFWL_Form::Update() { |
103 if (m_iLock > 0) | 89 if (m_iLock > 0) |
104 return; | 90 return; |
105 if (!m_pProperties->m_pThemeProvider) | 91 if (!m_pProperties->m_pThemeProvider) |
106 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 92 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { | 615 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { |
630 if (m_bMaximized) | 616 if (m_bMaximized) |
631 SetWidgetRect(m_rtRestore); | 617 SetWidgetRect(m_rtRestore); |
632 else | 618 else |
633 SetWorkAreaRect(); | 619 SetWorkAreaRect(); |
634 | 620 |
635 Update(); | 621 Update(); |
636 m_bMaximized = !m_bMaximized; | 622 m_bMaximized = !m_bMaximized; |
637 } | 623 } |
638 } | 624 } |
OLD | NEW |