| 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) { | 83 CFX_RectF CFWL_Form::GetWidgetRect(bool bAutoSize) { |
| 84 if (!bAutoSize) { | 84 if (!bAutoSize) |
| 85 rect = m_pProperties->m_rtWidget; | 85 return m_pProperties->m_rtWidget; |
| 86 return; | |
| 87 } | |
| 88 | 86 |
| 89 rect.Reset(); | |
| 90 FX_FLOAT fCXBorder = GetBorderSize(true); | 87 FX_FLOAT fCXBorder = GetBorderSize(true); |
| 91 FX_FLOAT fCYBorder = GetBorderSize(false); | 88 FX_FLOAT fCYBorder = GetBorderSize(false); |
| 92 FX_FLOAT fEdge = GetEdgeWidth(); | 89 FX_FLOAT fEdge = GetEdgeWidth(); |
| 93 rect.height += fCYBorder + fEdge + fEdge; | 90 CFX_RectF rect; |
| 94 rect.width += fCXBorder + fCXBorder + fEdge + fEdge; | 91 rect.Set(0, 0, fCXBorder + fCXBorder + fEdge + fEdge, |
| 92 fCYBorder + fEdge + fEdge); |
| 93 return rect; |
| 95 } | 94 } |
| 96 | 95 |
| 97 void CFWL_Form::GetClientRect(CFX_RectF& rect) { | 96 void CFWL_Form::GetClientRect(CFX_RectF& rect) { |
| 98 rect = m_pProperties->m_rtWidget; | 97 rect = m_pProperties->m_rtWidget; |
| 99 rect.Offset(-rect.left, -rect.top); | 98 rect.Offset(-rect.left, -rect.top); |
| 100 } | 99 } |
| 101 | 100 |
| 102 void CFWL_Form::Update() { | 101 void CFWL_Form::Update() { |
| 103 if (m_iLock > 0) | 102 if (m_iLock > 0) |
| 104 return; | 103 return; |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { | 628 HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { |
| 630 if (m_bMaximized) | 629 if (m_bMaximized) |
| 631 SetWidgetRect(m_rtRestore); | 630 SetWidgetRect(m_rtRestore); |
| 632 else | 631 else |
| 633 SetWorkAreaRect(); | 632 SetWorkAreaRect(); |
| 634 | 633 |
| 635 Update(); | 634 Update(); |
| 636 m_bMaximized = !m_bMaximized; | 635 m_bMaximized = !m_bMaximized; |
| 637 } | 636 } |
| 638 } | 637 } |
| OLD | NEW |