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 "fpdfsdk/pdfwindow/PWL_ScrollBar.h" | 7 #include "fpdfsdk/pdfwindow/PWL_ScrollBar.h" |
8 | 8 |
9 #include "core/include/fxge/fx_ge.h" | 9 #include "core/include/fxge/fx_ge.h" |
10 #include "fpdfsdk/pdfwindow/PWL_Utils.h" | 10 #include "fpdfsdk/pdfwindow/PWL_Utils.h" |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 default: | 534 default: |
535 break; | 535 break; |
536 } | 536 } |
537 break; | 537 break; |
538 default: | 538 default: |
539 break; | 539 break; |
540 } | 540 } |
541 } | 541 } |
542 | 542 |
543 FX_BOOL CPWL_SBButton::OnLButtonDown(const CFX_FloatPoint& point, | 543 FX_BOOL CPWL_SBButton::OnLButtonDown(const CFX_FloatPoint& point, |
544 FX_DWORD nFlag) { | 544 uint32_t nFlag) { |
545 CPWL_Wnd::OnLButtonDown(point, nFlag); | 545 CPWL_Wnd::OnLButtonDown(point, nFlag); |
546 | 546 |
547 if (CPWL_Wnd* pParent = GetParentWindow()) | 547 if (CPWL_Wnd* pParent = GetParentWindow()) |
548 pParent->OnNotify(this, PNM_LBUTTONDOWN, 0, (intptr_t)&point); | 548 pParent->OnNotify(this, PNM_LBUTTONDOWN, 0, (intptr_t)&point); |
549 | 549 |
550 m_bMouseDown = TRUE; | 550 m_bMouseDown = TRUE; |
551 SetCapture(); | 551 SetCapture(); |
552 | 552 |
553 return TRUE; | 553 return TRUE; |
554 } | 554 } |
555 | 555 |
556 FX_BOOL CPWL_SBButton::OnLButtonUp(const CFX_FloatPoint& point, | 556 FX_BOOL CPWL_SBButton::OnLButtonUp(const CFX_FloatPoint& point, |
557 FX_DWORD nFlag) { | 557 uint32_t nFlag) { |
558 CPWL_Wnd::OnLButtonUp(point, nFlag); | 558 CPWL_Wnd::OnLButtonUp(point, nFlag); |
559 | 559 |
560 if (CPWL_Wnd* pParent = GetParentWindow()) | 560 if (CPWL_Wnd* pParent = GetParentWindow()) |
561 pParent->OnNotify(this, PNM_LBUTTONUP, 0, (intptr_t)&point); | 561 pParent->OnNotify(this, PNM_LBUTTONUP, 0, (intptr_t)&point); |
562 | 562 |
563 m_bMouseDown = FALSE; | 563 m_bMouseDown = FALSE; |
564 ReleaseCapture(); | 564 ReleaseCapture(); |
565 | 565 |
566 return TRUE; | 566 return TRUE; |
567 } | 567 } |
568 | 568 |
569 FX_BOOL CPWL_SBButton::OnMouseMove(const CFX_FloatPoint& point, | 569 FX_BOOL CPWL_SBButton::OnMouseMove(const CFX_FloatPoint& point, |
570 FX_DWORD nFlag) { | 570 uint32_t nFlag) { |
571 CPWL_Wnd::OnMouseMove(point, nFlag); | 571 CPWL_Wnd::OnMouseMove(point, nFlag); |
572 | 572 |
573 if (CPWL_Wnd* pParent = GetParentWindow()) { | 573 if (CPWL_Wnd* pParent = GetParentWindow()) { |
574 pParent->OnNotify(this, PNM_MOUSEMOVE, 0, (intptr_t)&point); | 574 pParent->OnNotify(this, PNM_MOUSEMOVE, 0, (intptr_t)&point); |
575 } | 575 } |
576 | 576 |
577 return TRUE; | 577 return TRUE; |
578 } | 578 } |
579 | 579 |
580 CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType) | 580 CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType) |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 | 695 |
696 CPWL_Utils::DrawStrokeLine( | 696 CPWL_Utils::DrawStrokeLine( |
697 pDevice, pUser2Device, | 697 pDevice, pUser2Device, |
698 CFX_FloatPoint(rectWnd.right - 2.0f, rectWnd.top - 2.0f), | 698 CFX_FloatPoint(rectWnd.right - 2.0f, rectWnd.top - 2.0f), |
699 CFX_FloatPoint(rectWnd.right - 2.0f, rectWnd.bottom + 2.0f), | 699 CFX_FloatPoint(rectWnd.right - 2.0f, rectWnd.bottom + 2.0f), |
700 ArgbEncode(GetTransparency(), 100, 100, 100), 1.0f); | 700 ArgbEncode(GetTransparency(), 100, 100, 100), 1.0f); |
701 } | 701 } |
702 } | 702 } |
703 | 703 |
704 FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CFX_FloatPoint& point, | 704 FX_BOOL CPWL_ScrollBar::OnLButtonDown(const CFX_FloatPoint& point, |
705 FX_DWORD nFlag) { | 705 uint32_t nFlag) { |
706 CPWL_Wnd::OnLButtonDown(point, nFlag); | 706 CPWL_Wnd::OnLButtonDown(point, nFlag); |
707 | 707 |
708 if (HasFlag(PWS_AUTOTRANSPARENT)) { | 708 if (HasFlag(PWS_AUTOTRANSPARENT)) { |
709 if (GetTransparency() != 255) { | 709 if (GetTransparency() != 255) { |
710 SetTransparency(255); | 710 SetTransparency(255); |
711 InvalidateRect(); | 711 InvalidateRect(); |
712 } | 712 } |
713 } | 713 } |
714 | 714 |
715 CFX_FloatRect rcMinArea, rcMaxArea; | 715 CFX_FloatRect rcMinArea, rcMaxArea; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 m_sData.AddBig(); | 751 m_sData.AddBig(); |
752 MovePosButton(TRUE); | 752 MovePosButton(TRUE); |
753 NotifyScrollWindow(); | 753 NotifyScrollWindow(); |
754 } | 754 } |
755 } | 755 } |
756 | 756 |
757 return TRUE; | 757 return TRUE; |
758 } | 758 } |
759 | 759 |
760 FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CFX_FloatPoint& point, | 760 FX_BOOL CPWL_ScrollBar::OnLButtonUp(const CFX_FloatPoint& point, |
761 FX_DWORD nFlag) { | 761 uint32_t nFlag) { |
762 CPWL_Wnd::OnLButtonUp(point, nFlag); | 762 CPWL_Wnd::OnLButtonUp(point, nFlag); |
763 | 763 |
764 if (HasFlag(PWS_AUTOTRANSPARENT)) { | 764 if (HasFlag(PWS_AUTOTRANSPARENT)) { |
765 if (GetTransparency() != PWL_SCROLLBAR_TRANSPARANCY) { | 765 if (GetTransparency() != PWL_SCROLLBAR_TRANSPARANCY) { |
766 SetTransparency(PWL_SCROLLBAR_TRANSPARANCY); | 766 SetTransparency(PWL_SCROLLBAR_TRANSPARANCY); |
767 InvalidateRect(); | 767 InvalidateRect(); |
768 } | 768 } |
769 } | 769 } |
770 | 770 |
771 EndTimer(); | 771 EndTimer(); |
772 m_bMouseDown = FALSE; | 772 m_bMouseDown = FALSE; |
773 | 773 |
774 return TRUE; | 774 return TRUE; |
775 } | 775 } |
776 | 776 |
777 void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, | 777 void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd, |
778 FX_DWORD msg, | 778 uint32_t msg, |
779 intptr_t wParam, | 779 intptr_t wParam, |
780 intptr_t lParam) { | 780 intptr_t lParam) { |
781 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); | 781 CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam); |
782 | 782 |
783 switch (msg) { | 783 switch (msg) { |
784 case PNM_LBUTTONDOWN: | 784 case PNM_LBUTTONDOWN: |
785 if (pWnd == m_pMinButton) { | 785 if (pWnd == m_pMinButton) { |
786 OnMinButtonLBDown(*(CFX_FloatPoint*)lParam); | 786 OnMinButtonLBDown(*(CFX_FloatPoint*)lParam); |
787 } | 787 } |
788 | 788 |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 if (m_bMinOrMax) | 1190 if (m_bMinOrMax) |
1191 m_sData.SubSmall(); | 1191 m_sData.SubSmall(); |
1192 else | 1192 else |
1193 m_sData.AddSmall(); | 1193 m_sData.AddSmall(); |
1194 | 1194 |
1195 if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0) { | 1195 if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0) { |
1196 MovePosButton(TRUE); | 1196 MovePosButton(TRUE); |
1197 NotifyScrollWindow(); | 1197 NotifyScrollWindow(); |
1198 } | 1198 } |
1199 } | 1199 } |
OLD | NEW |