| 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_pushbutton.h" | 7 #include "xfa/fwl/cfwl_pushbutton.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 else if (m_pProperties->m_dwStates & FWL_STATE_PSB_Pressed) | 100 else if (m_pProperties->m_dwStates & FWL_STATE_PSB_Pressed) |
| 101 dwStates |= CFWL_PartState_Pressed; | 101 dwStates |= CFWL_PartState_Pressed; |
| 102 else if (m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) | 102 else if (m_pProperties->m_dwStates & FWL_STATE_PSB_Hovered) |
| 103 dwStates |= CFWL_PartState_Hovered; | 103 dwStates |= CFWL_PartState_Hovered; |
| 104 return dwStates; | 104 return dwStates; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void CFWL_PushButton::UpdateTextOutStyles() { | 107 void CFWL_PushButton::UpdateTextOutStyles() { |
| 108 m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; | 108 m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; |
| 109 m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; | 109 m_dwTTOStyles = FDE_TTOSTYLE_SingleLine; |
| 110 if (m_pProperties->m_dwStyleExes & FWL_WGTSTYLE_RTLReading) | |
| 111 m_dwTTOStyles |= FDE_TTOSTYLE_RTL; | |
| 112 } | 110 } |
| 113 | 111 |
| 114 void CFWL_PushButton::OnProcessMessage(CFWL_Message* pMessage) { | 112 void CFWL_PushButton::OnProcessMessage(CFWL_Message* pMessage) { |
| 115 if (!pMessage) | 113 if (!pMessage) |
| 116 return; | 114 return; |
| 117 if (!IsEnabled()) | 115 if (!IsEnabled()) |
| 118 return; | 116 return; |
| 119 | 117 |
| 120 switch (pMessage->GetType()) { | 118 switch (pMessage->GetType()) { |
| 121 case CFWL_Message::Type::SetFocus: | 119 case CFWL_Message::Type::SetFocus: |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 if (pMsg->m_dwKeyCode != FWL_VKEY_Return) | 239 if (pMsg->m_dwKeyCode != FWL_VKEY_Return) |
| 242 return; | 240 return; |
| 243 | 241 |
| 244 CFWL_EventMouse wmMouse(this); | 242 CFWL_EventMouse wmMouse(this); |
| 245 wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp; | 243 wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp; |
| 246 DispatchEvent(&wmMouse); | 244 DispatchEvent(&wmMouse); |
| 247 | 245 |
| 248 CFWL_Event wmClick(CFWL_Event::Type::Click, this); | 246 CFWL_Event wmClick(CFWL_Event::Type::Click, this); |
| 249 DispatchEvent(&wmClick); | 247 DispatchEvent(&wmClick); |
| 250 } | 248 } |
| OLD | NEW |