| 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/fxfa/app/xfa_fffield.h" | 7 #include "xfa/fxfa/app/xfa_fffield.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/basewidget/ifwl_edit.h" | 9 #include "xfa/fwl/basewidget/ifwl_edit.h" |
| 10 #include "xfa/fwl/core/cfwl_message.h" | 10 #include "xfa/fwl/core/cfwl_message.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 CXFA_FFField::CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) | 24 CXFA_FFField::CXFA_FFField(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc) |
| 25 : CXFA_FFWidget(pPageView, pDataAcc), m_pNormalWidget(NULL) { | 25 : CXFA_FFWidget(pPageView, pDataAcc), m_pNormalWidget(NULL) { |
| 26 m_rtUI.Set(0, 0, 0, 0); | 26 m_rtUI.Set(0, 0, 0, 0); |
| 27 m_rtCaption.Set(0, 0, 0, 0); | 27 m_rtCaption.Set(0, 0, 0, 0); |
| 28 } | 28 } |
| 29 CXFA_FFField::~CXFA_FFField() { | 29 CXFA_FFField::~CXFA_FFField() { |
| 30 CXFA_FFField::UnloadWidget(); | 30 CXFA_FFField::UnloadWidget(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox, | 33 FX_BOOL CXFA_FFField::GetBBox(CFX_RectF& rtBox, |
| 34 FX_DWORD dwStatus, | 34 uint32_t dwStatus, |
| 35 FX_BOOL bDrawFocus) { | 35 FX_BOOL bDrawFocus) { |
| 36 if (!bDrawFocus) | 36 if (!bDrawFocus) |
| 37 return CXFA_FFWidget::GetBBox(rtBox, dwStatus); | 37 return CXFA_FFWidget::GetBBox(rtBox, dwStatus); |
| 38 | 38 |
| 39 XFA_ELEMENT type = (XFA_ELEMENT)m_pDataAcc->GetUIType(); | 39 XFA_ELEMENT type = (XFA_ELEMENT)m_pDataAcc->GetUIType(); |
| 40 if (type == XFA_ELEMENT_Button || type == XFA_ELEMENT_CheckButton || | 40 if (type == XFA_ELEMENT_Button || type == XFA_ELEMENT_CheckButton || |
| 41 type == XFA_ELEMENT_ImageEdit || type == XFA_ELEMENT_Signature || | 41 type == XFA_ELEMENT_ImageEdit || type == XFA_ELEMENT_Signature || |
| 42 type == XFA_ELEMENT_ChoiceList) { | 42 type == XFA_ELEMENT_ChoiceList) { |
| 43 rtBox = m_rtUI; | 43 rtBox = m_rtUI; |
| 44 CFX_Matrix mt; | 44 CFX_Matrix mt; |
| 45 GetRotateMatrix(mt); | 45 GetRotateMatrix(mt); |
| 46 mt.TransformRect(rtBox); | 46 mt.TransformRect(rtBox); |
| 47 return TRUE; | 47 return TRUE; |
| 48 } | 48 } |
| 49 return FALSE; | 49 return FALSE; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, | 52 void CXFA_FFField::RenderWidget(CFX_Graphics* pGS, |
| 53 CFX_Matrix* pMatrix, | 53 CFX_Matrix* pMatrix, |
| 54 FX_DWORD dwStatus, | 54 uint32_t dwStatus, |
| 55 int32_t iRotate) { | 55 int32_t iRotate) { |
| 56 if (!IsMatchVisibleStatus(dwStatus)) { | 56 if (!IsMatchVisibleStatus(dwStatus)) { |
| 57 return; | 57 return; |
| 58 } | 58 } |
| 59 CFX_Matrix mtRotate; | 59 CFX_Matrix mtRotate; |
| 60 GetRotateMatrix(mtRotate); | 60 GetRotateMatrix(mtRotate); |
| 61 if (pMatrix) { | 61 if (pMatrix) { |
| 62 mtRotate.Concat(*pMatrix); | 62 mtRotate.Concat(*pMatrix); |
| 63 } | 63 } |
| 64 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); | 64 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); |
| 65 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); | 65 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); |
| 66 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); | 66 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); |
| 67 RenderCaption(pGS, &mtRotate); | 67 RenderCaption(pGS, &mtRotate); |
| 68 DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); | 68 DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); |
| 69 CFX_RectF rtWidget; | 69 CFX_RectF rtWidget; |
| 70 m_pNormalWidget->GetWidgetRect(rtWidget); | 70 m_pNormalWidget->GetWidgetRect(rtWidget); |
| 71 CFX_Matrix mt; | 71 CFX_Matrix mt; |
| 72 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); | 72 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); |
| 73 mt.Concat(mtRotate); | 73 mt.Concat(mtRotate); |
| 74 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), | 74 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), |
| 75 pGS, &mt); | 75 pGS, &mt); |
| 76 } | 76 } |
| 77 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, | 77 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, |
| 78 CFX_Matrix* pMatrix, | 78 CFX_Matrix* pMatrix, |
| 79 FX_DWORD dwStatus, | 79 uint32_t dwStatus, |
| 80 FX_BOOL bEllipse) { | 80 FX_BOOL bEllipse) { |
| 81 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 81 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 82 return; | 82 return; |
| 83 } | 83 } |
| 84 if ((dwStatus & XFA_WIDGETSTATUS_Highlight) && | 84 if ((dwStatus & XFA_WIDGETSTATUS_Highlight) && |
| 85 m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) { | 85 m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) { |
| 86 CXFA_FFDoc* pDoc = GetDoc(); | 86 CXFA_FFDoc* pDoc = GetDoc(); |
| 87 CFX_Color crHighlight(pDoc->GetDocProvider()->GetHighlightColor(pDoc)); | 87 CFX_Color crHighlight(pDoc->GetDocProvider()->GetHighlightColor(pDoc)); |
| 88 pGS->SetFillColor(&crHighlight); | 88 pGS->SetFillColor(&crHighlight); |
| 89 CFX_Path path; | 89 CFX_Path path; |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 m_rtCaption.top += rtUIMargin.top + rtUIMargin.height; | 314 m_rtCaption.top += rtUIMargin.top + rtUIMargin.height; |
| 315 } else if (fHeight > rtWidget.height) { | 315 } else if (fHeight > rtWidget.height) { |
| 316 m_rtUI.height += fHeight - rtWidget.height; | 316 m_rtUI.height += fHeight - rtWidget.height; |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 void CXFA_FFField::UpdateFWL() { | 319 void CXFA_FFField::UpdateFWL() { |
| 320 if (m_pNormalWidget) { | 320 if (m_pNormalWidget) { |
| 321 m_pNormalWidget->Update(); | 321 m_pNormalWidget->Update(); |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 FX_DWORD CXFA_FFField::UpdateUIProperty() { | 324 uint32_t CXFA_FFField::UpdateUIProperty() { |
| 325 CXFA_Node* pUiNode = m_pDataAcc->GetUIChild(); | 325 CXFA_Node* pUiNode = m_pDataAcc->GetUIChild(); |
| 326 FX_DWORD dwStyle = 0; | 326 uint32_t dwStyle = 0; |
| 327 if (pUiNode && pUiNode->GetClassID() == XFA_ELEMENT_DefaultUi) { | 327 if (pUiNode && pUiNode->GetClassID() == XFA_ELEMENT_DefaultUi) { |
| 328 dwStyle = FWL_STYLEEXT_EDT_ReadOnly; | 328 dwStyle = FWL_STYLEEXT_EDT_ReadOnly; |
| 329 } | 329 } |
| 330 return dwStyle; | 330 return dwStyle; |
| 331 } | 331 } |
| 332 void CXFA_FFField::SetFWLRect() { | 332 void CXFA_FFField::SetFWLRect() { |
| 333 if (!m_pNormalWidget) { | 333 if (!m_pNormalWidget) { |
| 334 return; | 334 return; |
| 335 } | 335 } |
| 336 CFX_RectF rtUi = m_rtUI; | 336 CFX_RectF rtUi = m_rtUI; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 } | 369 } |
| 370 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { | 370 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { |
| 371 if (!m_pNormalWidget) { | 371 if (!m_pNormalWidget) { |
| 372 return; | 372 return; |
| 373 } | 373 } |
| 374 CFX_RectF rtWidget; | 374 CFX_RectF rtWidget; |
| 375 m_pNormalWidget->GetWidgetRect(rtWidget); | 375 m_pNormalWidget->GetWidgetRect(rtWidget); |
| 376 fx -= rtWidget.left; | 376 fx -= rtWidget.left; |
| 377 fy -= rtWidget.top; | 377 fy -= rtWidget.top; |
| 378 } | 378 } |
| 379 FX_BOOL CXFA_FFField::OnLButtonDown(FX_DWORD dwFlags, | 379 FX_BOOL CXFA_FFField::OnLButtonDown(uint32_t dwFlags, |
| 380 FX_FLOAT fx, | 380 FX_FLOAT fx, |
| 381 FX_FLOAT fy) { | 381 FX_FLOAT fy) { |
| 382 if (!m_pNormalWidget) { | 382 if (!m_pNormalWidget) { |
| 383 return FALSE; | 383 return FALSE; |
| 384 } | 384 } |
| 385 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || | 385 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || |
| 386 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 386 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 387 return FALSE; | 387 return FALSE; |
| 388 } | 388 } |
| 389 if (!PtInActiveRect(fx, fy)) { | 389 if (!PtInActiveRect(fx, fy)) { |
| 390 return FALSE; | 390 return FALSE; |
| 391 } | 391 } |
| 392 SetButtonDown(TRUE); | 392 SetButtonDown(TRUE); |
| 393 CFWL_MsgMouse ms; | 393 CFWL_MsgMouse ms; |
| 394 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonDown; | 394 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonDown; |
| 395 ms.m_dwFlags = dwFlags; | 395 ms.m_dwFlags = dwFlags; |
| 396 ms.m_fx = fx; | 396 ms.m_fx = fx; |
| 397 ms.m_fy = fy; | 397 ms.m_fy = fy; |
| 398 FWLToClient(ms.m_fx, ms.m_fy); | 398 FWLToClient(ms.m_fx, ms.m_fy); |
| 399 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 399 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 400 TranslateFWLMessage(&ms); | 400 TranslateFWLMessage(&ms); |
| 401 return TRUE; | 401 return TRUE; |
| 402 } | 402 } |
| 403 FX_BOOL CXFA_FFField::OnLButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 403 FX_BOOL CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
| 404 if (!m_pNormalWidget) { | 404 if (!m_pNormalWidget) { |
| 405 return FALSE; | 405 return FALSE; |
| 406 } | 406 } |
| 407 if (!IsButtonDown()) { | 407 if (!IsButtonDown()) { |
| 408 return FALSE; | 408 return FALSE; |
| 409 } | 409 } |
| 410 SetButtonDown(FALSE); | 410 SetButtonDown(FALSE); |
| 411 CFWL_MsgMouse ms; | 411 CFWL_MsgMouse ms; |
| 412 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonUp; | 412 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonUp; |
| 413 ms.m_dwFlags = dwFlags; | 413 ms.m_dwFlags = dwFlags; |
| 414 ms.m_fx = fx; | 414 ms.m_fx = fx; |
| 415 ms.m_fy = fy; | 415 ms.m_fy = fy; |
| 416 FWLToClient(ms.m_fx, ms.m_fy); | 416 FWLToClient(ms.m_fx, ms.m_fy); |
| 417 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 417 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 418 TranslateFWLMessage(&ms); | 418 TranslateFWLMessage(&ms); |
| 419 return TRUE; | 419 return TRUE; |
| 420 } | 420 } |
| 421 FX_BOOL CXFA_FFField::OnLButtonDblClk(FX_DWORD dwFlags, | 421 FX_BOOL CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, |
| 422 FX_FLOAT fx, | 422 FX_FLOAT fx, |
| 423 FX_FLOAT fy) { | 423 FX_FLOAT fy) { |
| 424 if (!m_pNormalWidget) { | 424 if (!m_pNormalWidget) { |
| 425 return FALSE; | 425 return FALSE; |
| 426 } | 426 } |
| 427 CFWL_MsgMouse ms; | 427 CFWL_MsgMouse ms; |
| 428 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonDblClk; | 428 ms.m_dwCmd = FWL_MSGMOUSECMD_LButtonDblClk; |
| 429 ms.m_dwFlags = dwFlags; | 429 ms.m_dwFlags = dwFlags; |
| 430 ms.m_fx = fx; | 430 ms.m_fx = fx; |
| 431 ms.m_fy = fy; | 431 ms.m_fy = fy; |
| 432 FWLToClient(ms.m_fx, ms.m_fy); | 432 FWLToClient(ms.m_fx, ms.m_fy); |
| 433 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 433 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 434 TranslateFWLMessage(&ms); | 434 TranslateFWLMessage(&ms); |
| 435 return TRUE; | 435 return TRUE; |
| 436 } | 436 } |
| 437 FX_BOOL CXFA_FFField::OnMouseMove(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 437 FX_BOOL CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
| 438 if (!m_pNormalWidget) { | 438 if (!m_pNormalWidget) { |
| 439 return FALSE; | 439 return FALSE; |
| 440 } | 440 } |
| 441 CFWL_MsgMouse ms; | 441 CFWL_MsgMouse ms; |
| 442 ms.m_dwCmd = FWL_MSGMOUSECMD_MouseMove; | 442 ms.m_dwCmd = FWL_MSGMOUSECMD_MouseMove; |
| 443 ms.m_dwFlags = dwFlags; | 443 ms.m_dwFlags = dwFlags; |
| 444 ms.m_fx = fx; | 444 ms.m_fx = fx; |
| 445 ms.m_fy = fy; | 445 ms.m_fy = fy; |
| 446 FWLToClient(ms.m_fx, ms.m_fy); | 446 FWLToClient(ms.m_fx, ms.m_fy); |
| 447 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 447 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 448 TranslateFWLMessage(&ms); | 448 TranslateFWLMessage(&ms); |
| 449 return TRUE; | 449 return TRUE; |
| 450 } | 450 } |
| 451 FX_BOOL CXFA_FFField::OnMouseWheel(FX_DWORD dwFlags, | 451 FX_BOOL CXFA_FFField::OnMouseWheel(uint32_t dwFlags, |
| 452 int16_t zDelta, | 452 int16_t zDelta, |
| 453 FX_FLOAT fx, | 453 FX_FLOAT fx, |
| 454 FX_FLOAT fy) { | 454 FX_FLOAT fy) { |
| 455 return FALSE; | 455 return FALSE; |
| 456 if (!m_pNormalWidget) { | 456 if (!m_pNormalWidget) { |
| 457 return FALSE; | 457 return FALSE; |
| 458 } | 458 } |
| 459 CFWL_MsgMouseWheel ms; | 459 CFWL_MsgMouseWheel ms; |
| 460 ms.m_dwFlags = dwFlags; | 460 ms.m_dwFlags = dwFlags; |
| 461 ms.m_fx = fx; | 461 ms.m_fx = fx; |
| 462 ms.m_fy = fy; | 462 ms.m_fy = fy; |
| 463 FWLToClient(ms.m_fx, ms.m_fy); | 463 FWLToClient(ms.m_fx, ms.m_fy); |
| 464 ms.m_fDeltaX = zDelta; | 464 ms.m_fDeltaX = zDelta; |
| 465 ms.m_fDeltaY = 0; | 465 ms.m_fDeltaY = 0; |
| 466 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 466 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 467 TranslateFWLMessage(&ms); | 467 TranslateFWLMessage(&ms); |
| 468 return TRUE; | 468 return TRUE; |
| 469 } | 469 } |
| 470 FX_BOOL CXFA_FFField::OnRButtonDown(FX_DWORD dwFlags, | 470 FX_BOOL CXFA_FFField::OnRButtonDown(uint32_t dwFlags, |
| 471 FX_FLOAT fx, | 471 FX_FLOAT fx, |
| 472 FX_FLOAT fy) { | 472 FX_FLOAT fy) { |
| 473 if (!m_pNormalWidget) { | 473 if (!m_pNormalWidget) { |
| 474 return FALSE; | 474 return FALSE; |
| 475 } | 475 } |
| 476 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || | 476 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || |
| 477 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 477 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 478 return FALSE; | 478 return FALSE; |
| 479 } | 479 } |
| 480 if (!PtInActiveRect(fx, fy)) { | 480 if (!PtInActiveRect(fx, fy)) { |
| 481 return FALSE; | 481 return FALSE; |
| 482 } | 482 } |
| 483 SetButtonDown(TRUE); | 483 SetButtonDown(TRUE); |
| 484 CFWL_MsgMouse ms; | 484 CFWL_MsgMouse ms; |
| 485 ms.m_dwCmd = FWL_MSGMOUSECMD_RButtonDown; | 485 ms.m_dwCmd = FWL_MSGMOUSECMD_RButtonDown; |
| 486 ms.m_dwFlags = dwFlags; | 486 ms.m_dwFlags = dwFlags; |
| 487 ms.m_fx = fx; | 487 ms.m_fx = fx; |
| 488 ms.m_fy = fy; | 488 ms.m_fy = fy; |
| 489 FWLToClient(ms.m_fx, ms.m_fy); | 489 FWLToClient(ms.m_fx, ms.m_fy); |
| 490 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 490 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 491 TranslateFWLMessage(&ms); | 491 TranslateFWLMessage(&ms); |
| 492 return TRUE; | 492 return TRUE; |
| 493 } | 493 } |
| 494 FX_BOOL CXFA_FFField::OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 494 FX_BOOL CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
| 495 if (!m_pNormalWidget) { | 495 if (!m_pNormalWidget) { |
| 496 return FALSE; | 496 return FALSE; |
| 497 } | 497 } |
| 498 if (!IsButtonDown()) { | 498 if (!IsButtonDown()) { |
| 499 return FALSE; | 499 return FALSE; |
| 500 } | 500 } |
| 501 SetButtonDown(FALSE); | 501 SetButtonDown(FALSE); |
| 502 CFWL_MsgMouse ms; | 502 CFWL_MsgMouse ms; |
| 503 ms.m_dwCmd = FWL_MSGMOUSECMD_RButtonUp; | 503 ms.m_dwCmd = FWL_MSGMOUSECMD_RButtonUp; |
| 504 ms.m_dwFlags = dwFlags; | 504 ms.m_dwFlags = dwFlags; |
| 505 ms.m_fx = fx; | 505 ms.m_fx = fx; |
| 506 ms.m_fy = fy; | 506 ms.m_fy = fy; |
| 507 FWLToClient(ms.m_fx, ms.m_fy); | 507 FWLToClient(ms.m_fx, ms.m_fy); |
| 508 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 508 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 509 TranslateFWLMessage(&ms); | 509 TranslateFWLMessage(&ms); |
| 510 return TRUE; | 510 return TRUE; |
| 511 } | 511 } |
| 512 FX_BOOL CXFA_FFField::OnRButtonDblClk(FX_DWORD dwFlags, | 512 FX_BOOL CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, |
| 513 FX_FLOAT fx, | 513 FX_FLOAT fx, |
| 514 FX_FLOAT fy) { | 514 FX_FLOAT fy) { |
| 515 if (!m_pNormalWidget) { | 515 if (!m_pNormalWidget) { |
| 516 return FALSE; | 516 return FALSE; |
| 517 } | 517 } |
| 518 CFWL_MsgMouse ms; | 518 CFWL_MsgMouse ms; |
| 519 ms.m_dwCmd = FWL_MSGMOUSECMD_RButtonDblClk; | 519 ms.m_dwCmd = FWL_MSGMOUSECMD_RButtonDblClk; |
| 520 ms.m_dwFlags = dwFlags; | 520 ms.m_dwFlags = dwFlags; |
| 521 ms.m_fx = fx; | 521 ms.m_fx = fx; |
| 522 ms.m_fy = fy; | 522 ms.m_fy = fy; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 545 } | 545 } |
| 546 CFWL_MsgKillFocus ms; | 546 CFWL_MsgKillFocus ms; |
| 547 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 547 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 548 ms.m_pSrcTarget = NULL; | 548 ms.m_pSrcTarget = NULL; |
| 549 TranslateFWLMessage(&ms); | 549 TranslateFWLMessage(&ms); |
| 550 m_dwStatus &= ~XFA_WIDGETSTATUS_Focused; | 550 m_dwStatus &= ~XFA_WIDGETSTATUS_Focused; |
| 551 AddInvalidateRect(); | 551 AddInvalidateRect(); |
| 552 CXFA_FFWidget::OnKillFocus(pNewWidget); | 552 CXFA_FFWidget::OnKillFocus(pNewWidget); |
| 553 return TRUE; | 553 return TRUE; |
| 554 } | 554 } |
| 555 FX_BOOL CXFA_FFField::OnKeyDown(FX_DWORD dwKeyCode, FX_DWORD dwFlags) { | 555 FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { |
| 556 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 556 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 557 return FALSE; | 557 return FALSE; |
| 558 } | 558 } |
| 559 CFWL_MsgKey ms; | 559 CFWL_MsgKey ms; |
| 560 ms.m_dwCmd = FWL_MSGKEYCMD_KeyDown; | 560 ms.m_dwCmd = FWL_MSGKEYCMD_KeyDown; |
| 561 ms.m_dwFlags = dwFlags; | 561 ms.m_dwFlags = dwFlags; |
| 562 ms.m_dwKeyCode = dwKeyCode; | 562 ms.m_dwKeyCode = dwKeyCode; |
| 563 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 563 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 564 ms.m_pSrcTarget = NULL; | 564 ms.m_pSrcTarget = NULL; |
| 565 TranslateFWLMessage(&ms); | 565 TranslateFWLMessage(&ms); |
| 566 return TRUE; | 566 return TRUE; |
| 567 } | 567 } |
| 568 FX_BOOL CXFA_FFField::OnKeyUp(FX_DWORD dwKeyCode, FX_DWORD dwFlags) { | 568 FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { |
| 569 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 569 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 570 return FALSE; | 570 return FALSE; |
| 571 } | 571 } |
| 572 CFWL_MsgKey ms; | 572 CFWL_MsgKey ms; |
| 573 ms.m_dwCmd = FWL_MSGKEYCMD_KeyUp; | 573 ms.m_dwCmd = FWL_MSGKEYCMD_KeyUp; |
| 574 ms.m_dwFlags = dwFlags; | 574 ms.m_dwFlags = dwFlags; |
| 575 ms.m_dwKeyCode = dwKeyCode; | 575 ms.m_dwKeyCode = dwKeyCode; |
| 576 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 576 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 577 ms.m_pSrcTarget = NULL; | 577 ms.m_pSrcTarget = NULL; |
| 578 TranslateFWLMessage(&ms); | 578 TranslateFWLMessage(&ms); |
| 579 return TRUE; | 579 return TRUE; |
| 580 } | 580 } |
| 581 FX_BOOL CXFA_FFField::OnChar(FX_DWORD dwChar, FX_DWORD dwFlags) { | 581 FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { |
| 582 if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 582 if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
| 583 return FALSE; | 583 return FALSE; |
| 584 } | 584 } |
| 585 if (dwChar == FWL_VKEY_Tab) { | 585 if (dwChar == FWL_VKEY_Tab) { |
| 586 return TRUE; | 586 return TRUE; |
| 587 } | 587 } |
| 588 if (!m_pNormalWidget) { | 588 if (!m_pNormalWidget) { |
| 589 return FALSE; | 589 return FALSE; |
| 590 } | 590 } |
| 591 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { | 591 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { |
| 592 return FALSE; | 592 return FALSE; |
| 593 } | 593 } |
| 594 CFWL_MsgKey ms; | 594 CFWL_MsgKey ms; |
| 595 ms.m_dwCmd = FWL_MSGKEYCMD_Char; | 595 ms.m_dwCmd = FWL_MSGKEYCMD_Char; |
| 596 ms.m_dwFlags = dwFlags; | 596 ms.m_dwFlags = dwFlags; |
| 597 ms.m_dwKeyCode = dwChar; | 597 ms.m_dwKeyCode = dwChar; |
| 598 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 598 ms.m_pDstTarget = m_pNormalWidget->m_pIface; |
| 599 ms.m_pSrcTarget = NULL; | 599 ms.m_pSrcTarget = NULL; |
| 600 TranslateFWLMessage(&ms); | 600 TranslateFWLMessage(&ms); |
| 601 return TRUE; | 601 return TRUE; |
| 602 } | 602 } |
| 603 FX_DWORD CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { | 603 uint32_t CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 604 if (m_pNormalWidget) { | 604 if (m_pNormalWidget) { |
| 605 FX_FLOAT ffx = fx, ffy = fy; | 605 FX_FLOAT ffx = fx, ffy = fy; |
| 606 FWLToClient(ffx, ffy); | 606 FWLToClient(ffx, ffy); |
| 607 FX_DWORD dwWidgetHit = m_pNormalWidget->HitTest(ffx, ffy); | 607 uint32_t dwWidgetHit = m_pNormalWidget->HitTest(ffx, ffy); |
| 608 if (dwWidgetHit != FWL_WGTHITTEST_Unknown) { | 608 if (dwWidgetHit != FWL_WGTHITTEST_Unknown) { |
| 609 return FWL_WGTHITTEST_Client; | 609 return FWL_WGTHITTEST_Client; |
| 610 } | 610 } |
| 611 } | 611 } |
| 612 CFX_RectF rtBox; | 612 CFX_RectF rtBox; |
| 613 GetRectWithoutRotate(rtBox); | 613 GetRectWithoutRotate(rtBox); |
| 614 if (!rtBox.Contains(fx, fy)) { | 614 if (!rtBox.Contains(fx, fy)) { |
| 615 return FWL_WGTHITTEST_Unknown; | 615 return FWL_WGTHITTEST_Unknown; |
| 616 } | 616 } |
| 617 if (m_rtCaption.Contains(fx, fy)) { | 617 if (m_rtCaption.Contains(fx, fy)) { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 FX_BOOL CXFA_FFField::IsDataChanged() { | 787 FX_BOOL CXFA_FFField::IsDataChanged() { |
| 788 return FALSE; | 788 return FALSE; |
| 789 } | 789 } |
| 790 void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) { | 790 void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) { |
| 791 GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage); | 791 GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage); |
| 792 } | 792 } |
| 793 int32_t CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) { | 793 int32_t CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) { |
| 794 return FWL_ERR_Succeeded; | 794 return FWL_ERR_Succeeded; |
| 795 } | 795 } |
| 796 FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { | 796 FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) { |
| 797 FX_DWORD dwEventID = pEvent->GetClassID(); | 797 uint32_t dwEventID = pEvent->GetClassID(); |
| 798 switch (dwEventID) { | 798 switch (dwEventID) { |
| 799 case FWL_EVTHASH_Mouse: { | 799 case FWL_EVTHASH_Mouse: { |
| 800 CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent; | 800 CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent; |
| 801 if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseEnter) { | 801 if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseEnter) { |
| 802 CXFA_EventParam eParam; | 802 CXFA_EventParam eParam; |
| 803 eParam.m_eType = XFA_EVENT_MouseEnter; | 803 eParam.m_eType = XFA_EVENT_MouseEnter; |
| 804 eParam.m_pTarget = m_pDataAcc; | 804 eParam.m_pTarget = m_pDataAcc; |
| 805 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter, &eParam); | 805 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_MouseEnter, &eParam); |
| 806 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseLeave) { | 806 } else if (event->m_dwCmd == FWL_MSGMOUSECMD_MouseLeave) { |
| 807 CXFA_EventParam eParam; | 807 CXFA_EventParam eParam; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 829 break; | 829 break; |
| 830 } | 830 } |
| 831 default: {} | 831 default: {} |
| 832 } | 832 } |
| 833 return FWL_ERR_Succeeded; | 833 return FWL_ERR_Succeeded; |
| 834 } | 834 } |
| 835 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 835 FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
| 836 const CFX_Matrix* pMatrix) { | 836 const CFX_Matrix* pMatrix) { |
| 837 return FWL_ERR_Succeeded; | 837 return FWL_ERR_Succeeded; |
| 838 } | 838 } |
| OLD | NEW |