| 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_checkbox.h" | 7 #include "xfa/fwl/cfwl_checkbox.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 else | 172 else |
| 173 dwStates |= CFWL_PartState_Normal; | 173 dwStates |= CFWL_PartState_Normal; |
| 174 if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) | 174 if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) |
| 175 dwStates |= CFWL_PartState_Focused; | 175 dwStates |= CFWL_PartState_Focused; |
| 176 return dwStates; | 176 return dwStates; |
| 177 } | 177 } |
| 178 | 178 |
| 179 void CFWL_CheckBox::UpdateTextOutStyles() { | 179 void CFWL_CheckBox::UpdateTextOutStyles() { |
| 180 m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; | 180 m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; |
| 181 m_dwTTOStyles = 0; | 181 m_dwTTOStyles = 0; |
| 182 if (m_pProperties->m_dwStyleExes & FWL_WGTSTYLE_RTLReading) | |
| 183 m_dwTTOStyles |= FDE_TTOSTYLE_RTL; | |
| 184 m_dwTTOStyles |= FDE_TTOSTYLE_SingleLine; | 182 m_dwTTOStyles |= FDE_TTOSTYLE_SingleLine; |
| 185 } | 183 } |
| 186 | 184 |
| 187 void CFWL_CheckBox::NextStates() { | 185 void CFWL_CheckBox::NextStates() { |
| 188 uint32_t dwFirststate = m_pProperties->m_dwStates; | 186 uint32_t dwFirststate = m_pProperties->m_dwStates; |
| 189 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) { | 187 if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_CKB_RadioButton) { |
| 190 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == | 188 if ((m_pProperties->m_dwStates & FWL_STATE_CKB_CheckMask) == |
| 191 FWL_STATE_CKB_Unchecked) { | 189 FWL_STATE_CKB_Unchecked) { |
| 192 CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr(); | 190 CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr(); |
| 193 if (!pWidgetMgr->IsFormDisabled()) { | 191 if (!pWidgetMgr->IsFormDisabled()) { |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 362 } |
| 365 | 363 |
| 366 void CFWL_CheckBox::OnKeyDown(CFWL_MessageKey* pMsg) { | 364 void CFWL_CheckBox::OnKeyDown(CFWL_MessageKey* pMsg) { |
| 367 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) | 365 if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) |
| 368 return; | 366 return; |
| 369 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || | 367 if (pMsg->m_dwKeyCode == FWL_VKEY_Return || |
| 370 pMsg->m_dwKeyCode == FWL_VKEY_Space) { | 368 pMsg->m_dwKeyCode == FWL_VKEY_Space) { |
| 371 NextStates(); | 369 NextStates(); |
| 372 } | 370 } |
| 373 } | 371 } |
| OLD | NEW |