| 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/basewidget/fwl_pushbuttonimp.h" | 7 #include "xfa/fwl/basewidget/fwl_pushbuttonimp.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/basewidget/ifwl_pushbutton.h" | 10 #include "xfa/fwl/basewidget/ifwl_pushbutton.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 OnFocusChanged(pMessage, TRUE); | 415 OnFocusChanged(pMessage, TRUE); |
| 416 break; | 416 break; |
| 417 } | 417 } |
| 418 case CFWL_MessageType::KillFocus: { | 418 case CFWL_MessageType::KillFocus: { |
| 419 OnFocusChanged(pMessage, FALSE); | 419 OnFocusChanged(pMessage, FALSE); |
| 420 break; | 420 break; |
| 421 } | 421 } |
| 422 case CFWL_MessageType::Mouse: { | 422 case CFWL_MessageType::Mouse: { |
| 423 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); | 423 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); |
| 424 switch (pMsg->m_dwCmd) { | 424 switch (pMsg->m_dwCmd) { |
| 425 case FWL_MSGMOUSECMD_LButtonDown: { | 425 case FWL_MouseCommand::LeftButtonDown: { |
| 426 OnLButtonDown(pMsg); | 426 OnLButtonDown(pMsg); |
| 427 break; | 427 break; |
| 428 } | 428 } |
| 429 case FWL_MSGMOUSECMD_LButtonUp: { | 429 case FWL_MouseCommand::LeftButtonUp: { |
| 430 OnLButtonUp(pMsg); | 430 OnLButtonUp(pMsg); |
| 431 break; | 431 break; |
| 432 } | 432 } |
| 433 case FWL_MSGMOUSECMD_MouseMove: { | 433 case FWL_MouseCommand::Move: { |
| 434 OnMouseMove(pMsg); | 434 OnMouseMove(pMsg); |
| 435 break; | 435 break; |
| 436 } | 436 } |
| 437 case FWL_MSGMOUSECMD_MouseLeave: { | 437 case FWL_MouseCommand::Leave: { |
| 438 OnMouseLeave(pMsg); | 438 OnMouseLeave(pMsg); |
| 439 break; | 439 break; |
| 440 } | 440 } |
| 441 default: | 441 default: |
| 442 break; | 442 break; |
| 443 } | 443 } |
| 444 break; | 444 break; |
| 445 } | 445 } |
| 446 case CFWL_MessageType::Key: { | 446 case CFWL_MessageType::Key: { |
| 447 CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage); | 447 CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage); |
| 448 if (pKey->m_dwCmd == FWL_MSGKEYCMD_KeyDown) | 448 if (pKey->m_dwCmd == FWL_KeyCommand::KeyDown) |
| 449 OnKeyDown(pKey); | 449 OnKeyDown(pKey); |
| 450 break; | 450 break; |
| 451 } | 451 } |
| 452 default: { | 452 default: { |
| 453 iRet = 0; | 453 iRet = 0; |
| 454 break; | 454 break; |
| 455 } | 455 } |
| 456 } | 456 } |
| 457 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 457 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
| 458 return iRet; | 458 return iRet; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 void CFWL_PushButtonImpDelegate::OnMouseLeave(CFWL_MsgMouse* pMsg) { | 537 void CFWL_PushButtonImpDelegate::OnMouseLeave(CFWL_MsgMouse* pMsg) { |
| 538 m_pOwner->m_bBtnDown = FALSE; | 538 m_pOwner->m_bBtnDown = FALSE; |
| 539 m_pOwner->m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered; | 539 m_pOwner->m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Hovered; |
| 540 m_pOwner->m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed; | 540 m_pOwner->m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed; |
| 541 m_pOwner->Repaint(&m_pOwner->m_rtClient); | 541 m_pOwner->Repaint(&m_pOwner->m_rtClient); |
| 542 } | 542 } |
| 543 void CFWL_PushButtonImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { | 543 void CFWL_PushButtonImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) { |
| 544 if (pMsg->m_dwKeyCode == FWL_VKEY_Return) { | 544 if (pMsg->m_dwKeyCode == FWL_VKEY_Return) { |
| 545 CFWL_EvtMouse wmMouse; | 545 CFWL_EvtMouse wmMouse; |
| 546 wmMouse.m_pSrcTarget = m_pOwner->m_pInterface; | 546 wmMouse.m_pSrcTarget = m_pOwner->m_pInterface; |
| 547 wmMouse.m_dwCmd = FWL_MSGMOUSECMD_LButtonUp; | 547 wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp; |
| 548 m_pOwner->DispatchEvent(&wmMouse); | 548 m_pOwner->DispatchEvent(&wmMouse); |
| 549 CFWL_EvtClick wmClick; | 549 CFWL_EvtClick wmClick; |
| 550 wmClick.m_pSrcTarget = m_pOwner->m_pInterface; | 550 wmClick.m_pSrcTarget = m_pOwner->m_pInterface; |
| 551 m_pOwner->DispatchEvent(&wmClick); | 551 m_pOwner->DispatchEvent(&wmClick); |
| 552 return; | 552 return; |
| 553 } | 553 } |
| 554 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { | 554 if (pMsg->m_dwKeyCode != FWL_VKEY_Tab) { |
| 555 return; | 555 return; |
| 556 } | 556 } |
| 557 m_pOwner->DispatchKeyEvent(pMsg); | 557 m_pOwner->DispatchKeyEvent(pMsg); |
| 558 } | 558 } |
| OLD | NEW |