Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: xfa/fxfa/app/xfa_fffield.cpp

Issue 2524173002: Merge IFWL and CFWL classes. (Closed)
Patch Set: make chrome build happy Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/core/cfwl_edit.h" 9 #include "xfa/fwl/core/cfwl_edit.h"
10 #include "xfa/fwl/core/cfwl_evtmouse.h" 10 #include "xfa/fwl/core/cfwl_evtmouse.h"
11 #include "xfa/fwl/core/cfwl_msgkey.h" 11 #include "xfa/fwl/core/cfwl_msgkey.h"
12 #include "xfa/fwl/core/cfwl_msgkillfocus.h" 12 #include "xfa/fwl/core/cfwl_msgkillfocus.h"
13 #include "xfa/fwl/core/cfwl_msgmouse.h" 13 #include "xfa/fwl/core/cfwl_msgmouse.h"
14 #include "xfa/fwl/core/cfwl_msgmousewheel.h" 14 #include "xfa/fwl/core/cfwl_msgmousewheel.h"
15 #include "xfa/fwl/core/cfwl_msgsetfocus.h" 15 #include "xfa/fwl/core/cfwl_msgsetfocus.h"
16 #include "xfa/fwl/core/cfwl_picturebox.h" 16 #include "xfa/fwl/core/cfwl_picturebox.h"
17 #include "xfa/fwl/core/cfwl_widgetmgr.h" 17 #include "xfa/fwl/core/cfwl_widgetmgr.h"
18 #include "xfa/fwl/core/ifwl_edit.h"
19 #include "xfa/fxfa/app/xfa_fwltheme.h" 18 #include "xfa/fxfa/app/xfa_fwltheme.h"
20 #include "xfa/fxfa/app/xfa_textlayout.h" 19 #include "xfa/fxfa/app/xfa_textlayout.h"
21 #include "xfa/fxfa/xfa_ffapp.h" 20 #include "xfa/fxfa/xfa_ffapp.h"
22 #include "xfa/fxfa/xfa_ffdoc.h" 21 #include "xfa/fxfa/xfa_ffdoc.h"
23 #include "xfa/fxfa/xfa_ffdocview.h" 22 #include "xfa/fxfa/xfa_ffdocview.h"
24 #include "xfa/fxfa/xfa_ffpageview.h" 23 #include "xfa/fxfa/xfa_ffpageview.h"
25 #include "xfa/fxfa/xfa_ffwidget.h" 24 #include "xfa/fxfa/xfa_ffwidget.h"
26 #include "xfa/fxgraphics/cfx_color.h" 25 #include "xfa/fxgraphics/cfx_color.h"
27 #include "xfa/fxgraphics/cfx_path.h" 26 #include "xfa/fxgraphics/cfx_path.h"
28 27
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus); 67 CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus);
69 CXFA_Border borderUI = m_pDataAcc->GetUIBorder(); 68 CXFA_Border borderUI = m_pDataAcc->GetUIBorder();
70 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate); 69 DrawBorder(pGS, borderUI, m_rtUI, &mtRotate);
71 RenderCaption(pGS, &mtRotate); 70 RenderCaption(pGS, &mtRotate);
72 DrawHighlight(pGS, &mtRotate, dwStatus, false); 71 DrawHighlight(pGS, &mtRotate, dwStatus, false);
73 CFX_RectF rtWidget; 72 CFX_RectF rtWidget;
74 m_pNormalWidget->GetWidgetRect(rtWidget); 73 m_pNormalWidget->GetWidgetRect(rtWidget);
75 CFX_Matrix mt; 74 CFX_Matrix mt;
76 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top); 75 mt.Set(1, 0, 0, 1, rtWidget.left, rtWidget.top);
77 mt.Concat(mtRotate); 76 mt.Concat(mtRotate);
78 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(), 77 GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget, pGS, &mt);
79 pGS, &mt);
80 } 78 }
81 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS, 79 void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS,
82 CFX_Matrix* pMatrix, 80 CFX_Matrix* pMatrix,
83 uint32_t dwStatus, 81 uint32_t dwStatus,
84 bool bEllipse) { 82 bool bEllipse) {
85 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { 83 if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
86 return; 84 return;
87 } 85 }
88 if ((dwStatus & XFA_WidgetStatus_Highlight) && 86 if ((dwStatus & XFA_WidgetStatus_Highlight) &&
89 m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) { 87 m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) {
(...skipping 17 matching lines...) Expand all
107 FX_FLOAT DashPattern[2] = {1, 1}; 105 FX_FLOAT DashPattern[2] = {1, 1};
108 pGS->SetLineDash(0.0f, DashPattern, 2); 106 pGS->SetLineDash(0.0f, DashPattern, 2);
109 pGS->SetLineWidth(0, false); 107 pGS->SetLineWidth(0, false);
110 CFX_Path path; 108 CFX_Path path;
111 path.Create(); 109 path.Create();
112 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height); 110 path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height);
113 pGS->StrokePath(&path, pMatrix); 111 pGS->StrokePath(&path, pMatrix);
114 } 112 }
115 } 113 }
116 void CXFA_FFField::SetFWLThemeProvider() { 114 void CXFA_FFField::SetFWLThemeProvider() {
117 if (m_pNormalWidget) { 115 if (m_pNormalWidget)
118 m_pNormalWidget->GetWidget()->SetThemeProvider(GetApp()->GetFWLTheme()); 116 m_pNormalWidget->SetThemeProvider(GetApp()->GetFWLTheme());
119 }
120 } 117 }
121 bool CXFA_FFField::IsLoaded() { 118 bool CXFA_FFField::IsLoaded() {
122 return m_pNormalWidget && CXFA_FFWidget::IsLoaded(); 119 return m_pNormalWidget && CXFA_FFWidget::IsLoaded();
123 } 120 }
124 bool CXFA_FFField::LoadWidget() { 121 bool CXFA_FFField::LoadWidget() {
125 SetFWLThemeProvider(); 122 SetFWLThemeProvider();
126 m_pDataAcc->LoadCaption(); 123 m_pDataAcc->LoadCaption();
127 PerformLayout(); 124 PerformLayout();
128 return true; 125 return true;
129 } 126 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 344 }
348 } 345 }
349 m_pNormalWidget->SetWidgetRect(rtUi); 346 m_pNormalWidget->SetWidgetRect(rtUi);
350 } 347 }
351 bool CXFA_FFField::OnMouseEnter() { 348 bool CXFA_FFField::OnMouseEnter() {
352 if (!m_pNormalWidget) { 349 if (!m_pNormalWidget) {
353 return false; 350 return false;
354 } 351 }
355 CFWL_MsgMouse ms; 352 CFWL_MsgMouse ms;
356 ms.m_dwCmd = FWL_MouseCommand::Enter; 353 ms.m_dwCmd = FWL_MouseCommand::Enter;
357 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 354 ms.m_pDstTarget = m_pNormalWidget;
358 ms.m_pSrcTarget = nullptr; 355 ms.m_pSrcTarget = nullptr;
359 TranslateFWLMessage(&ms); 356 TranslateFWLMessage(&ms);
360 return true; 357 return true;
361 } 358 }
362 bool CXFA_FFField::OnMouseExit() { 359 bool CXFA_FFField::OnMouseExit() {
363 if (!m_pNormalWidget) { 360 if (!m_pNormalWidget) {
364 return false; 361 return false;
365 } 362 }
366 CFWL_MsgMouse ms; 363 CFWL_MsgMouse ms;
367 ms.m_dwCmd = FWL_MouseCommand::Leave; 364 ms.m_dwCmd = FWL_MouseCommand::Leave;
368 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 365 ms.m_pDstTarget = m_pNormalWidget;
369 TranslateFWLMessage(&ms); 366 TranslateFWLMessage(&ms);
370 return true; 367 return true;
371 } 368 }
372 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) { 369 void CXFA_FFField::FWLToClient(FX_FLOAT& fx, FX_FLOAT& fy) {
373 if (!m_pNormalWidget) { 370 if (!m_pNormalWidget) {
374 return; 371 return;
375 } 372 }
376 CFX_RectF rtWidget; 373 CFX_RectF rtWidget;
377 m_pNormalWidget->GetWidgetRect(rtWidget); 374 m_pNormalWidget->GetWidgetRect(rtWidget);
378 fx -= rtWidget.left; 375 fx -= rtWidget.left;
(...skipping 10 matching lines...) Expand all
389 if (!PtInActiveRect(fx, fy)) { 386 if (!PtInActiveRect(fx, fy)) {
390 return false; 387 return false;
391 } 388 }
392 SetButtonDown(true); 389 SetButtonDown(true);
393 CFWL_MsgMouse ms; 390 CFWL_MsgMouse ms;
394 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown; 391 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
395 ms.m_dwFlags = dwFlags; 392 ms.m_dwFlags = dwFlags;
396 ms.m_fx = fx; 393 ms.m_fx = fx;
397 ms.m_fy = fy; 394 ms.m_fy = fy;
398 FWLToClient(ms.m_fx, ms.m_fy); 395 FWLToClient(ms.m_fx, ms.m_fy);
399 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 396 ms.m_pDstTarget = m_pNormalWidget;
400 TranslateFWLMessage(&ms); 397 TranslateFWLMessage(&ms);
401 return true; 398 return true;
402 } 399 }
403 bool CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { 400 bool CXFA_FFField::OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
404 if (!m_pNormalWidget) { 401 if (!m_pNormalWidget) {
405 return false; 402 return false;
406 } 403 }
407 if (!IsButtonDown()) { 404 if (!IsButtonDown()) {
408 return false; 405 return false;
409 } 406 }
410 SetButtonDown(false); 407 SetButtonDown(false);
411 CFWL_MsgMouse ms; 408 CFWL_MsgMouse ms;
412 ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp; 409 ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
413 ms.m_dwFlags = dwFlags; 410 ms.m_dwFlags = dwFlags;
414 ms.m_fx = fx; 411 ms.m_fx = fx;
415 ms.m_fy = fy; 412 ms.m_fy = fy;
416 FWLToClient(ms.m_fx, ms.m_fy); 413 FWLToClient(ms.m_fx, ms.m_fy);
417 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 414 ms.m_pDstTarget = m_pNormalWidget;
418 TranslateFWLMessage(&ms); 415 TranslateFWLMessage(&ms);
419 return true; 416 return true;
420 } 417 }
421 bool CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { 418 bool CXFA_FFField::OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
422 if (!m_pNormalWidget) { 419 if (!m_pNormalWidget) {
423 return false; 420 return false;
424 } 421 }
425 CFWL_MsgMouse ms; 422 CFWL_MsgMouse ms;
426 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk; 423 ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk;
427 ms.m_dwFlags = dwFlags; 424 ms.m_dwFlags = dwFlags;
428 ms.m_fx = fx; 425 ms.m_fx = fx;
429 ms.m_fy = fy; 426 ms.m_fy = fy;
430 FWLToClient(ms.m_fx, ms.m_fy); 427 FWLToClient(ms.m_fx, ms.m_fy);
431 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 428 ms.m_pDstTarget = m_pNormalWidget;
432 TranslateFWLMessage(&ms); 429 TranslateFWLMessage(&ms);
433 return true; 430 return true;
434 } 431 }
435 bool CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { 432 bool CXFA_FFField::OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
436 if (!m_pNormalWidget) { 433 if (!m_pNormalWidget) {
437 return false; 434 return false;
438 } 435 }
439 CFWL_MsgMouse ms; 436 CFWL_MsgMouse ms;
440 ms.m_dwCmd = FWL_MouseCommand::Move; 437 ms.m_dwCmd = FWL_MouseCommand::Move;
441 ms.m_dwFlags = dwFlags; 438 ms.m_dwFlags = dwFlags;
442 ms.m_fx = fx; 439 ms.m_fx = fx;
443 ms.m_fy = fy; 440 ms.m_fy = fy;
444 FWLToClient(ms.m_fx, ms.m_fy); 441 FWLToClient(ms.m_fx, ms.m_fy);
445 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 442 ms.m_pDstTarget = m_pNormalWidget;
446 TranslateFWLMessage(&ms); 443 TranslateFWLMessage(&ms);
447 return true; 444 return true;
448 } 445 }
449 bool CXFA_FFField::OnMouseWheel(uint32_t dwFlags, 446 bool CXFA_FFField::OnMouseWheel(uint32_t dwFlags,
450 int16_t zDelta, 447 int16_t zDelta,
451 FX_FLOAT fx, 448 FX_FLOAT fx,
452 FX_FLOAT fy) { 449 FX_FLOAT fy) {
453 if (!m_pNormalWidget) { 450 if (!m_pNormalWidget) {
454 return false; 451 return false;
455 } 452 }
456 CFWL_MsgMouseWheel ms; 453 CFWL_MsgMouseWheel ms;
457 ms.m_dwFlags = dwFlags; 454 ms.m_dwFlags = dwFlags;
458 ms.m_fx = fx; 455 ms.m_fx = fx;
459 ms.m_fy = fy; 456 ms.m_fy = fy;
460 FWLToClient(ms.m_fx, ms.m_fy); 457 FWLToClient(ms.m_fx, ms.m_fy);
461 ms.m_fDeltaX = zDelta; 458 ms.m_fDeltaX = zDelta;
462 ms.m_fDeltaY = 0; 459 ms.m_fDeltaY = 0;
463 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 460 ms.m_pDstTarget = m_pNormalWidget;
464 TranslateFWLMessage(&ms); 461 TranslateFWLMessage(&ms);
465 return true; 462 return true;
466 } 463 }
467 bool CXFA_FFField::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { 464 bool CXFA_FFField::OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
468 if (!m_pNormalWidget) { 465 if (!m_pNormalWidget) {
469 return false; 466 return false;
470 } 467 }
471 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open || 468 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open ||
472 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { 469 !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
473 return false; 470 return false;
474 } 471 }
475 if (!PtInActiveRect(fx, fy)) { 472 if (!PtInActiveRect(fx, fy)) {
476 return false; 473 return false;
477 } 474 }
478 SetButtonDown(true); 475 SetButtonDown(true);
479 CFWL_MsgMouse ms; 476 CFWL_MsgMouse ms;
480 ms.m_dwCmd = FWL_MouseCommand::RightButtonDown; 477 ms.m_dwCmd = FWL_MouseCommand::RightButtonDown;
481 ms.m_dwFlags = dwFlags; 478 ms.m_dwFlags = dwFlags;
482 ms.m_fx = fx; 479 ms.m_fx = fx;
483 ms.m_fy = fy; 480 ms.m_fy = fy;
484 FWLToClient(ms.m_fx, ms.m_fy); 481 FWLToClient(ms.m_fx, ms.m_fy);
485 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 482 ms.m_pDstTarget = m_pNormalWidget;
486 TranslateFWLMessage(&ms); 483 TranslateFWLMessage(&ms);
487 return true; 484 return true;
488 } 485 }
489 bool CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { 486 bool CXFA_FFField::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
490 if (!m_pNormalWidget) { 487 if (!m_pNormalWidget) {
491 return false; 488 return false;
492 } 489 }
493 if (!IsButtonDown()) { 490 if (!IsButtonDown()) {
494 return false; 491 return false;
495 } 492 }
496 SetButtonDown(false); 493 SetButtonDown(false);
497 CFWL_MsgMouse ms; 494 CFWL_MsgMouse ms;
498 ms.m_dwCmd = FWL_MouseCommand::RightButtonUp; 495 ms.m_dwCmd = FWL_MouseCommand::RightButtonUp;
499 ms.m_dwFlags = dwFlags; 496 ms.m_dwFlags = dwFlags;
500 ms.m_fx = fx; 497 ms.m_fx = fx;
501 ms.m_fy = fy; 498 ms.m_fy = fy;
502 FWLToClient(ms.m_fx, ms.m_fy); 499 FWLToClient(ms.m_fx, ms.m_fy);
503 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 500 ms.m_pDstTarget = m_pNormalWidget;
504 TranslateFWLMessage(&ms); 501 TranslateFWLMessage(&ms);
505 return true; 502 return true;
506 } 503 }
507 bool CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) { 504 bool CXFA_FFField::OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
508 if (!m_pNormalWidget) { 505 if (!m_pNormalWidget) {
509 return false; 506 return false;
510 } 507 }
511 CFWL_MsgMouse ms; 508 CFWL_MsgMouse ms;
512 ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk; 509 ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk;
513 ms.m_dwFlags = dwFlags; 510 ms.m_dwFlags = dwFlags;
514 ms.m_fx = fx; 511 ms.m_fx = fx;
515 ms.m_fy = fy; 512 ms.m_fy = fy;
516 FWLToClient(ms.m_fx, ms.m_fy); 513 FWLToClient(ms.m_fx, ms.m_fy);
517 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 514 ms.m_pDstTarget = m_pNormalWidget;
518 TranslateFWLMessage(&ms); 515 TranslateFWLMessage(&ms);
519 return true; 516 return true;
520 } 517 }
521 518
522 bool CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) { 519 bool CXFA_FFField::OnSetFocus(CXFA_FFWidget* pOldWidget) {
523 CXFA_FFWidget::OnSetFocus(pOldWidget); 520 CXFA_FFWidget::OnSetFocus(pOldWidget);
524 if (!m_pNormalWidget) { 521 if (!m_pNormalWidget) {
525 return false; 522 return false;
526 } 523 }
527 CFWL_MsgSetFocus ms; 524 CFWL_MsgSetFocus ms;
528 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 525 ms.m_pDstTarget = m_pNormalWidget;
529 ms.m_pSrcTarget = nullptr; 526 ms.m_pSrcTarget = nullptr;
530 TranslateFWLMessage(&ms); 527 TranslateFWLMessage(&ms);
531 m_dwStatus |= XFA_WidgetStatus_Focused; 528 m_dwStatus |= XFA_WidgetStatus_Focused;
532 AddInvalidateRect(); 529 AddInvalidateRect();
533 return true; 530 return true;
534 } 531 }
535 bool CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) { 532 bool CXFA_FFField::OnKillFocus(CXFA_FFWidget* pNewWidget) {
536 if (!m_pNormalWidget) { 533 if (!m_pNormalWidget) {
537 return CXFA_FFWidget::OnKillFocus(pNewWidget); 534 return CXFA_FFWidget::OnKillFocus(pNewWidget);
538 } 535 }
539 CFWL_MsgKillFocus ms; 536 CFWL_MsgKillFocus ms;
540 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 537 ms.m_pDstTarget = m_pNormalWidget;
541 ms.m_pSrcTarget = nullptr; 538 ms.m_pSrcTarget = nullptr;
542 TranslateFWLMessage(&ms); 539 TranslateFWLMessage(&ms);
543 m_dwStatus &= ~XFA_WidgetStatus_Focused; 540 m_dwStatus &= ~XFA_WidgetStatus_Focused;
544 AddInvalidateRect(); 541 AddInvalidateRect();
545 CXFA_FFWidget::OnKillFocus(pNewWidget); 542 CXFA_FFWidget::OnKillFocus(pNewWidget);
546 return true; 543 return true;
547 } 544 }
548 bool CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) { 545 bool CXFA_FFField::OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags) {
549 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { 546 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
550 return false; 547 return false;
551 } 548 }
552 CFWL_MsgKey ms; 549 CFWL_MsgKey ms;
553 ms.m_dwCmd = FWL_KeyCommand::KeyDown; 550 ms.m_dwCmd = FWL_KeyCommand::KeyDown;
554 ms.m_dwFlags = dwFlags; 551 ms.m_dwFlags = dwFlags;
555 ms.m_dwKeyCode = dwKeyCode; 552 ms.m_dwKeyCode = dwKeyCode;
556 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 553 ms.m_pDstTarget = m_pNormalWidget;
557 ms.m_pSrcTarget = nullptr; 554 ms.m_pSrcTarget = nullptr;
558 TranslateFWLMessage(&ms); 555 TranslateFWLMessage(&ms);
559 return true; 556 return true;
560 } 557 }
561 bool CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) { 558 bool CXFA_FFField::OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags) {
562 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { 559 if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
563 return false; 560 return false;
564 } 561 }
565 CFWL_MsgKey ms; 562 CFWL_MsgKey ms;
566 ms.m_dwCmd = FWL_KeyCommand::KeyUp; 563 ms.m_dwCmd = FWL_KeyCommand::KeyUp;
567 ms.m_dwFlags = dwFlags; 564 ms.m_dwFlags = dwFlags;
568 ms.m_dwKeyCode = dwKeyCode; 565 ms.m_dwKeyCode = dwKeyCode;
569 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 566 ms.m_pDstTarget = m_pNormalWidget;
570 ms.m_pSrcTarget = nullptr; 567 ms.m_pSrcTarget = nullptr;
571 TranslateFWLMessage(&ms); 568 TranslateFWLMessage(&ms);
572 return true; 569 return true;
573 } 570 }
574 bool CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) { 571 bool CXFA_FFField::OnChar(uint32_t dwChar, uint32_t dwFlags) {
575 if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { 572 if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
576 return false; 573 return false;
577 } 574 }
578 if (dwChar == FWL_VKEY_Tab) { 575 if (dwChar == FWL_VKEY_Tab) {
579 return true; 576 return true;
580 } 577 }
581 if (!m_pNormalWidget) { 578 if (!m_pNormalWidget) {
582 return false; 579 return false;
583 } 580 }
584 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { 581 if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
585 return false; 582 return false;
586 } 583 }
587 CFWL_MsgKey ms; 584 CFWL_MsgKey ms;
588 ms.m_dwCmd = FWL_KeyCommand::Char; 585 ms.m_dwCmd = FWL_KeyCommand::Char;
589 ms.m_dwFlags = dwFlags; 586 ms.m_dwFlags = dwFlags;
590 ms.m_dwKeyCode = dwChar; 587 ms.m_dwKeyCode = dwChar;
591 ms.m_pDstTarget = m_pNormalWidget->GetWidget(); 588 ms.m_pDstTarget = m_pNormalWidget;
592 ms.m_pSrcTarget = nullptr; 589 ms.m_pSrcTarget = nullptr;
593 TranslateFWLMessage(&ms); 590 TranslateFWLMessage(&ms);
594 return true; 591 return true;
595 } 592 }
596 FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { 593 FWL_WidgetHit CXFA_FFField::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) {
597 if (m_pNormalWidget) { 594 if (m_pNormalWidget) {
598 FX_FLOAT ffx = fx, ffy = fy; 595 FX_FLOAT ffx = fx, ffy = fy;
599 FWLToClient(ffx, ffy); 596 FWLToClient(ffx, ffy);
600 if (m_pNormalWidget->HitTest(ffx, ffy) != FWL_WidgetHit::Unknown) 597 if (m_pNormalWidget->HitTest(ffx, ffy) != FWL_WidgetHit::Unknown)
601 return FWL_WidgetHit::Client; 598 return FWL_WidgetHit::Client;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam); 812 m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Click, &eParam);
816 break; 813 break;
817 } 814 }
818 default: 815 default:
819 break; 816 break;
820 } 817 }
821 } 818 }
822 819
823 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics, 820 void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics,
824 const CFX_Matrix* pMatrix) {} 821 const CFX_Matrix* pMatrix) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698