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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 pGS->SetLineDash(0.0f, DashPattern, 2); | 103 pGS->SetLineDash(0.0f, DashPattern, 2); |
104 pGS->SetLineWidth(0, FALSE); | 104 pGS->SetLineWidth(0, FALSE); |
105 CFX_Path path; | 105 CFX_Path path; |
106 path.Create(); | 106 path.Create(); |
107 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); | 107 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); |
108 pGS->StrokePath(&path, pMatrix); | 108 pGS->StrokePath(&path, pMatrix); |
109 } | 109 } |
110 } | 110 } |
111 void CXFA_FFField::SetFWLThemeProvider() { | 111 void CXFA_FFField::SetFWLThemeProvider() { |
112 if (m_pNormalWidget) { | 112 if (m_pNormalWidget) { |
113 m_pNormalWidget->m_pIface->SetThemeProvider(GetApp()->GetFWLTheme()); | 113 m_pNormalWidget->GetWidget()->SetThemeProvider(GetApp()->GetFWLTheme()); |
114 } | 114 } |
115 } | 115 } |
116 FX_BOOL CXFA_FFField::IsLoaded() { | 116 FX_BOOL CXFA_FFField::IsLoaded() { |
117 return m_pNormalWidget && CXFA_FFWidget::IsLoaded(); | 117 return m_pNormalWidget && CXFA_FFWidget::IsLoaded(); |
118 } | 118 } |
119 FX_BOOL CXFA_FFField::LoadWidget() { | 119 FX_BOOL CXFA_FFField::LoadWidget() { |
120 SetFWLThemeProvider(); | 120 SetFWLThemeProvider(); |
121 m_pDataAcc->LoadCaption(); | 121 m_pDataAcc->LoadCaption(); |
122 PerformLayout(); | 122 PerformLayout(); |
123 return TRUE; | 123 return TRUE; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 342 } |
343 } | 343 } |
344 m_pNormalWidget->SetWidgetRect(rtUi); | 344 m_pNormalWidget->SetWidgetRect(rtUi); |
345 } | 345 } |
346 FX_BOOL CXFA_FFField::OnMouseEnter() { | 346 FX_BOOL CXFA_FFField::OnMouseEnter() { |
347 if (!m_pNormalWidget) { | 347 if (!m_pNormalWidget) { |
348 return FALSE; | 348 return FALSE; |
349 } | 349 } |
350 CFWL_MsgMouse ms; | 350 CFWL_MsgMouse ms; |
351 ms.m_dwCmd = FWL_MouseCommand::Enter; | 351 ms.m_dwCmd = FWL_MouseCommand::Enter; |
352 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 352 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
353 ms.m_pSrcTarget = nullptr; | 353 ms.m_pSrcTarget = nullptr; |
354 TranslateFWLMessage(&ms); | 354 TranslateFWLMessage(&ms); |
355 return TRUE; | 355 return TRUE; |
356 } | 356 } |
357 FX_BOOL CXFA_FFField::OnMouseExit() { | 357 FX_BOOL CXFA_FFField::OnMouseExit() { |
358 if (!m_pNormalWidget) { | 358 if (!m_pNormalWidget) { |
359 return FALSE; | 359 return FALSE; |
360 } | 360 } |
361 CFWL_MsgMouse ms; | 361 CFWL_MsgMouse ms; |
362 ms.m_dwCmd = FWL_MouseCommand::Leave; | 362 ms.m_dwCmd = FWL_MouseCommand::Leave; |
363 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 363 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
364 TranslateFWLMessage(&ms); | 364 TranslateFWLMessage(&ms); |
365 return TRUE; | 365 return TRUE; |
366 } | 366 } |
367 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { | 367 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { |
368 if (!m_pNormalWidget) { | 368 if (!m_pNormalWidget) { |
369 return; | 369 return; |
370 } | 370 } |
371 CFX_RectF rtWidget; | 371 CFX_RectF rtWidget; |
372 m_pNormalWidget->GetWidgetRect(rtWidget); | 372 m_pNormalWidget->GetWidgetRect(rtWidget); |
373 fx -= rtWidget.left; | 373 fx -= rtWidget.left; |
(...skipping 12 matching lines...) Expand all Loading... |
386 if (!PtInActiveRect(fx, fy)) { | 386 if (!PtInActiveRect(fx, fy)) { |
387 return FALSE; | 387 return FALSE; |
388 } | 388 } |
389 SetButtonDown(TRUE); | 389 SetButtonDown(TRUE); |
390 CFWL_MsgMouse ms; | 390 CFWL_MsgMouse ms; |
391 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown; | 391 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown; |
392 ms.m_dwFlags = dwFlags; | 392 ms.m_dwFlags = dwFlags; |
393 ms.m_fx = fx; | 393 ms.m_fx = fx; |
394 ms.m_fy = fy; | 394 ms.m_fy = fy; |
395 FWLToClient(ms.m_fx, ms.m_fy); | 395 FWLToClient(ms.m_fx, ms.m_fy); |
396 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 396 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
397 TranslateFWLMessage(&ms); | 397 TranslateFWLMessage(&ms); |
398 return TRUE; | 398 return TRUE; |
399 } | 399 } |
400 FX_BOOL CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 400 FX_BOOL CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
401 if (!m_pNormalWidget) { | 401 if (!m_pNormalWidget) { |
402 return FALSE; | 402 return FALSE; |
403 } | 403 } |
404 if (!IsButtonDown()) { | 404 if (!IsButtonDown()) { |
405 return FALSE; | 405 return FALSE; |
406 } | 406 } |
407 SetButtonDown(FALSE); | 407 SetButtonDown(FALSE); |
408 CFWL_MsgMouse ms; | 408 CFWL_MsgMouse ms; |
409 ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp; | 409 ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp; |
410 ms.m_dwFlags = dwFlags; | 410 ms.m_dwFlags = dwFlags; |
411 ms.m_fx = fx; | 411 ms.m_fx = fx; |
412 ms.m_fy = fy; | 412 ms.m_fy = fy; |
413 FWLToClient(ms.m_fx, ms.m_fy); | 413 FWLToClient(ms.m_fx, ms.m_fy); |
414 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 414 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
415 TranslateFWLMessage(&ms); | 415 TranslateFWLMessage(&ms); |
416 return TRUE; | 416 return TRUE; |
417 } | 417 } |
418 FX_BOOL CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, | 418 FX_BOOL CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, |
419 FX_FLOAT fx, | 419 FX_FLOAT fx, |
420 FX_FLOAT fy) { | 420 FX_FLOAT fy) { |
421 if (!m_pNormalWidget) { | 421 if (!m_pNormalWidget) { |
422 return FALSE; | 422 return FALSE; |
423 } | 423 } |
424 CFWL_MsgMouse ms; | 424 CFWL_MsgMouse ms; |
425 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk; | 425 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk; |
426 ms.m_dwFlags = dwFlags; | 426 ms.m_dwFlags = dwFlags; |
427 ms.m_fx = fx; | 427 ms.m_fx = fx; |
428 ms.m_fy = fy; | 428 ms.m_fy = fy; |
429 FWLToClient(ms.m_fx, ms.m_fy); | 429 FWLToClient(ms.m_fx, ms.m_fy); |
430 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 430 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
431 TranslateFWLMessage(&ms); | 431 TranslateFWLMessage(&ms); |
432 return TRUE; | 432 return TRUE; |
433 } | 433 } |
434 FX_BOOL CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 434 FX_BOOL CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
435 if (!m_pNormalWidget) { | 435 if (!m_pNormalWidget) { |
436 return FALSE; | 436 return FALSE; |
437 } | 437 } |
438 CFWL_MsgMouse ms; | 438 CFWL_MsgMouse ms; |
439 ms.m_dwCmd = FWL_MouseCommand::Move; | 439 ms.m_dwCmd = FWL_MouseCommand::Move; |
440 ms.m_dwFlags = dwFlags; | 440 ms.m_dwFlags = dwFlags; |
441 ms.m_fx = fx; | 441 ms.m_fx = fx; |
442 ms.m_fy = fy; | 442 ms.m_fy = fy; |
443 FWLToClient(ms.m_fx, ms.m_fy); | 443 FWLToClient(ms.m_fx, ms.m_fy); |
444 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 444 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
445 TranslateFWLMessage(&ms); | 445 TranslateFWLMessage(&ms); |
446 return TRUE; | 446 return TRUE; |
447 } | 447 } |
448 FX_BOOL CXFA_FFField::OnMouseWheel(uint32_t dwFlags, | 448 FX_BOOL CXFA_FFField::OnMouseWheel(uint32_t dwFlags, |
449 int16_t zDelta, | 449 int16_t zDelta, |
450 FX_FLOAT fx, | 450 FX_FLOAT fx, |
451 FX_FLOAT fy) { | 451 FX_FLOAT fy) { |
452 if (!m_pNormalWidget) { | 452 if (!m_pNormalWidget) { |
453 return FALSE; | 453 return FALSE; |
454 } | 454 } |
455 CFWL_MsgMouseWheel ms; | 455 CFWL_MsgMouseWheel ms; |
456 ms.m_dwFlags = dwFlags; | 456 ms.m_dwFlags = dwFlags; |
457 ms.m_fx = fx; | 457 ms.m_fx = fx; |
458 ms.m_fy = fy; | 458 ms.m_fy = fy; |
459 FWLToClient(ms.m_fx, ms.m_fy); | 459 FWLToClient(ms.m_fx, ms.m_fy); |
460 ms.m_fDeltaX = zDelta; | 460 ms.m_fDeltaX = zDelta; |
461 ms.m_fDeltaY = 0; | 461 ms.m_fDeltaY = 0; |
462 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 462 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
463 TranslateFWLMessage(&ms); | 463 TranslateFWLMessage(&ms); |
464 return TRUE; | 464 return TRUE; |
465 } | 465 } |
466 FX_BOOL CXFA_FFField::OnRButtonDown(uint32_t dwFlags, | 466 FX_BOOL CXFA_FFField::OnRButtonDown(uint32_t dwFlags, |
467 FX_FLOAT fx, | 467 FX_FLOAT fx, |
468 FX_FLOAT fy) { | 468 FX_FLOAT fy) { |
469 if (!m_pNormalWidget) { | 469 if (!m_pNormalWidget) { |
470 return FALSE; | 470 return FALSE; |
471 } | 471 } |
472 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || | 472 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || |
473 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 473 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
474 return FALSE; | 474 return FALSE; |
475 } | 475 } |
476 if (!PtInActiveRect(fx, fy)) { | 476 if (!PtInActiveRect(fx, fy)) { |
477 return FALSE; | 477 return FALSE; |
478 } | 478 } |
479 SetButtonDown(TRUE); | 479 SetButtonDown(TRUE); |
480 CFWL_MsgMouse ms; | 480 CFWL_MsgMouse ms; |
481 ms.m_dwCmd = FWL_MouseCommand::RightButtonDown; | 481 ms.m_dwCmd = FWL_MouseCommand::RightButtonDown; |
482 ms.m_dwFlags = dwFlags; | 482 ms.m_dwFlags = dwFlags; |
483 ms.m_fx = fx; | 483 ms.m_fx = fx; |
484 ms.m_fy = fy; | 484 ms.m_fy = fy; |
485 FWLToClient(ms.m_fx, ms.m_fy); | 485 FWLToClient(ms.m_fx, ms.m_fy); |
486 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 486 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
487 TranslateFWLMessage(&ms); | 487 TranslateFWLMessage(&ms); |
488 return TRUE; | 488 return TRUE; |
489 } | 489 } |
490 FX_BOOL CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { | 490 FX_BOOL CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { |
491 if (!m_pNormalWidget) { | 491 if (!m_pNormalWidget) { |
492 return FALSE; | 492 return FALSE; |
493 } | 493 } |
494 if (!IsButtonDown()) { | 494 if (!IsButtonDown()) { |
495 return FALSE; | 495 return FALSE; |
496 } | 496 } |
497 SetButtonDown(FALSE); | 497 SetButtonDown(FALSE); |
498 CFWL_MsgMouse ms; | 498 CFWL_MsgMouse ms; |
499 ms.m_dwCmd = FWL_MouseCommand::RightButtonUp; | 499 ms.m_dwCmd = FWL_MouseCommand::RightButtonUp; |
500 ms.m_dwFlags = dwFlags; | 500 ms.m_dwFlags = dwFlags; |
501 ms.m_fx = fx; | 501 ms.m_fx = fx; |
502 ms.m_fy = fy; | 502 ms.m_fy = fy; |
503 FWLToClient(ms.m_fx, ms.m_fy); | 503 FWLToClient(ms.m_fx, ms.m_fy); |
504 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 504 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
505 TranslateFWLMessage(&ms); | 505 TranslateFWLMessage(&ms); |
506 return TRUE; | 506 return TRUE; |
507 } | 507 } |
508 FX_BOOL CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, | 508 FX_BOOL CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, |
509 FX_FLOAT fx, | 509 FX_FLOAT fx, |
510 FX_FLOAT fy) { | 510 FX_FLOAT fy) { |
511 if (!m_pNormalWidget) { | 511 if (!m_pNormalWidget) { |
512 return FALSE; | 512 return FALSE; |
513 } | 513 } |
514 CFWL_MsgMouse ms; | 514 CFWL_MsgMouse ms; |
515 ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk; | 515 ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk; |
516 ms.m_dwFlags = dwFlags; | 516 ms.m_dwFlags = dwFlags; |
517 ms.m_fx = fx; | 517 ms.m_fx = fx; |
518 ms.m_fy = fy; | 518 ms.m_fy = fy; |
519 FWLToClient(ms.m_fx, ms.m_fy); | 519 FWLToClient(ms.m_fx, ms.m_fy); |
520 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 520 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
521 TranslateFWLMessage(&ms); | 521 TranslateFWLMessage(&ms); |
522 return TRUE; | 522 return TRUE; |
523 } | 523 } |
524 | 524 |
525 FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { | 525 FX_BOOL CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { |
526 CXFA_FFWidget::OnSetFocus(pOldWidget); | 526 CXFA_FFWidget::OnSetFocus(pOldWidget); |
527 if (!m_pNormalWidget) { | 527 if (!m_pNormalWidget) { |
528 return FALSE; | 528 return FALSE; |
529 } | 529 } |
530 CFWL_MsgSetFocus ms; | 530 CFWL_MsgSetFocus ms; |
531 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 531 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
532 ms.m_pSrcTarget = nullptr; | 532 ms.m_pSrcTarget = nullptr; |
533 TranslateFWLMessage(&ms); | 533 TranslateFWLMessage(&ms); |
534 m_dwStatus |= XFA_WidgetStatus_Focused; | 534 m_dwStatus |= XFA_WidgetStatus_Focused; |
535 AddInvalidateRect(); | 535 AddInvalidateRect(); |
536 return TRUE; | 536 return TRUE; |
537 } | 537 } |
538 FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { | 538 FX_BOOL CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { |
539 if (!m_pNormalWidget) { | 539 if (!m_pNormalWidget) { |
540 return CXFA_FFWidget::OnKillFocus(pNewWidget); | 540 return CXFA_FFWidget::OnKillFocus(pNewWidget); |
541 } | 541 } |
542 CFWL_MsgKillFocus ms; | 542 CFWL_MsgKillFocus ms; |
543 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 543 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
544 ms.m_pSrcTarget = nullptr; | 544 ms.m_pSrcTarget = nullptr; |
545 TranslateFWLMessage(&ms); | 545 TranslateFWLMessage(&ms); |
546 m_dwStatus &= ~XFA_WidgetStatus_Focused; | 546 m_dwStatus &= ~XFA_WidgetStatus_Focused; |
547 AddInvalidateRect(); | 547 AddInvalidateRect(); |
548 CXFA_FFWidget::OnKillFocus(pNewWidget); | 548 CXFA_FFWidget::OnKillFocus(pNewWidget); |
549 return TRUE; | 549 return TRUE; |
550 } | 550 } |
551 FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { | 551 FX_BOOL CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { |
552 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 552 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
553 return FALSE; | 553 return FALSE; |
554 } | 554 } |
555 CFWL_MsgKey ms; | 555 CFWL_MsgKey ms; |
556 ms.m_dwCmd = FWL_KeyCommand::KeyDown; | 556 ms.m_dwCmd = FWL_KeyCommand::KeyDown; |
557 ms.m_dwFlags = dwFlags; | 557 ms.m_dwFlags = dwFlags; |
558 ms.m_dwKeyCode = dwKeyCode; | 558 ms.m_dwKeyCode = dwKeyCode; |
559 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 559 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
560 ms.m_pSrcTarget = nullptr; | 560 ms.m_pSrcTarget = nullptr; |
561 TranslateFWLMessage(&ms); | 561 TranslateFWLMessage(&ms); |
562 return TRUE; | 562 return TRUE; |
563 } | 563 } |
564 FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { | 564 FX_BOOL CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { |
565 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 565 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
566 return FALSE; | 566 return FALSE; |
567 } | 567 } |
568 CFWL_MsgKey ms; | 568 CFWL_MsgKey ms; |
569 ms.m_dwCmd = FWL_KeyCommand::KeyUp; | 569 ms.m_dwCmd = FWL_KeyCommand::KeyUp; |
570 ms.m_dwFlags = dwFlags; | 570 ms.m_dwFlags = dwFlags; |
571 ms.m_dwKeyCode = dwKeyCode; | 571 ms.m_dwKeyCode = dwKeyCode; |
572 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 572 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
573 ms.m_pSrcTarget = nullptr; | 573 ms.m_pSrcTarget = nullptr; |
574 TranslateFWLMessage(&ms); | 574 TranslateFWLMessage(&ms); |
575 return TRUE; | 575 return TRUE; |
576 } | 576 } |
577 FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { | 577 FX_BOOL CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { |
578 if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { | 578 if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { |
579 return FALSE; | 579 return FALSE; |
580 } | 580 } |
581 if (dwChar == FWL_VKEY_Tab) { | 581 if (dwChar == FWL_VKEY_Tab) { |
582 return TRUE; | 582 return TRUE; |
583 } | 583 } |
584 if (!m_pNormalWidget) { | 584 if (!m_pNormalWidget) { |
585 return FALSE; | 585 return FALSE; |
586 } | 586 } |
587 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { | 587 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { |
588 return FALSE; | 588 return FALSE; |
589 } | 589 } |
590 CFWL_MsgKey ms; | 590 CFWL_MsgKey ms; |
591 ms.m_dwCmd = FWL_KeyCommand::Char; | 591 ms.m_dwCmd = FWL_KeyCommand::Char; |
592 ms.m_dwFlags = dwFlags; | 592 ms.m_dwFlags = dwFlags; |
593 ms.m_dwKeyCode = dwChar; | 593 ms.m_dwKeyCode = dwChar; |
594 ms.m_pDstTarget = m_pNormalWidget->m_pIface; | 594 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); |
595 ms.m_pSrcTarget = nullptr; | 595 ms.m_pSrcTarget = nullptr; |
596 TranslateFWLMessage(&ms); | 596 TranslateFWLMessage(&ms); |
597 return TRUE; | 597 return TRUE; |
598 } | 598 } |
599 FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { | 599 FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { |
600 if (m_pNormalWidget) { | 600 if (m_pNormalWidget) { |
601 FX_FLOAT ffx = fx, ffy = fy; | 601 FX_FLOAT ffx = fx, ffy = fy; |
602 FWLToClient(ffx, ffy); | 602 FWLToClient(ffx, ffy); |
603 if (m_pNormalWidget->HitTest(ffx, ffy) != FWL_WidgetHit::Unknown) | 603 if (m_pNormalWidget->HitTest(ffx, ffy) != FWL_WidgetHit::Unknown) |
604 return FWL_WidgetHit::Client; | 604 return FWL_WidgetHit::Client; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); | 818 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); |
819 break; | 819 break; |
820 } | 820 } |
821 default: | 821 default: |
822 break; | 822 break; |
823 } | 823 } |
824 } | 824 } |
825 | 825 |
826 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, | 826 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, |
827 const CFX_Matrix* pMatrix) {} | 827 const CFX_Matrix* pMatrix) {} |
OLD | NEW |