| 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_checkbox.h" | 7 #include "xfa/fwl/core/cfwl_checkbox.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return; | 63 return; |
| 64 | 64 |
| 65 CFX_SizeF sz = CalcTextSize( | 65 CFX_SizeF sz = CalcTextSize( |
| 66 L"Check box", m_pProperties->m_pThemeProvider, | 66 L"Check box", m_pProperties->m_pThemeProvider, |
| 67 !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine)); | 67 !!(m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_MultiLine)); |
| 68 rect.Set(0, 0, sz.x, sz.y); | 68 rect.Set(0, 0, sz.x, sz.y); |
| 69 rect.Inflate(kCaptionMargin, kCaptionMargin); | 69 rect.Inflate(kCaptionMargin, kCaptionMargin); |
| 70 | 70 |
| 71 rect.width += m_fBoxHeight; | 71 rect.width += m_fBoxHeight; |
| 72 rect.height = std::max(rect.height, m_fBoxHeight); | 72 rect.height = std::max(rect.height, m_fBoxHeight); |
| 73 CFWL_Widget::GetWidgetRect(rect, true); | 73 InflateWidgetRect(rect); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void CFWL_CheckBox::Update() { | 76 void CFWL_CheckBox::Update() { |
| 77 if (IsLocked()) | 77 if (IsLocked()) |
| 78 return; | 78 return; |
| 79 if (!m_pProperties->m_pThemeProvider) | 79 if (!m_pProperties->m_pThemeProvider) |
| 80 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 80 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
| 81 | 81 |
| 82 UpdateTextOutStyles(); | 82 UpdateTextOutStyles(); |
| 83 Layout(); | 83 Layout(); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 } | 473 } |
| 474 | 474 |
| 475 void CFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) { | 475 void CFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) { |
| 476 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) | 476 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) |
| 477 return; | 477 return; |
| 478 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 478 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
| 479 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 479 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
| 480 NextStates(); | 480 NextStates(); |
| 481 } | 481 } |
| 482 } | 482 } |
| OLD | NEW |