summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-07-05 14:13:16 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-05 19:42:30 +0000
commit7f6bec9b4c0cb2f53724ea83715d4fe22eed1d28 (patch)
treee8d7d1d15f708fcdffa69c7cbf3ccafa62828792 /fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
parenteea0467aeeb7d0a0f3dffeed4eb1a35d950fdbee (diff)
downloadpdfium-7f6bec9b4c0cb2f53724ea83715d4fe22eed1d28.tar.xz
Remove PNM_ mouse methods and OnNotify
This CL removes the remaining PNM_* messages and converts them to individual methods. Change-Id: I44791a35bc720f29f8f5d4d7c26a8c899b54132d Reviewed-on: https://pdfium-review.googlesource.com/7255 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp77
1 files changed, 27 insertions, 50 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp b/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
index 94ac2e6178..fdbe8fcb02 100644
--- a/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_scroll_bar.cpp
@@ -518,7 +518,7 @@ bool CPWL_SBButton::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnLButtonDown(point, nFlag);
if (CPWL_Wnd* pParent = GetParentWindow())
- pParent->OnNotify(this, PNM_LBUTTONDOWN, 0, (intptr_t)&point);
+ pParent->NotifyLButtonDown(this, point);
m_bMouseDown = true;
SetCapture();
@@ -530,7 +530,7 @@ bool CPWL_SBButton::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnLButtonUp(point, nFlag);
if (CPWL_Wnd* pParent = GetParentWindow())
- pParent->OnNotify(this, PNM_LBUTTONUP, 0, (intptr_t)&point);
+ pParent->NotifyLButtonUp(this, point);
m_bMouseDown = false;
ReleaseCapture();
@@ -541,9 +541,8 @@ bool CPWL_SBButton::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
bool CPWL_SBButton::OnMouseMove(const CFX_PointF& point, uint32_t nFlag) {
CPWL_Wnd::OnMouseMove(point, nFlag);
- if (CPWL_Wnd* pParent = GetParentWindow()) {
- pParent->OnNotify(this, PNM_MOUSEMOVE, 0, (intptr_t)&point);
- }
+ if (CPWL_Wnd* pParent = GetParentWindow())
+ pParent->NotifyMouseMove(this, point);
return true;
}
@@ -774,53 +773,31 @@ void CPWL_ScrollBar::SetScrollPosition(float pos) {
SetScrollPos(pos);
}
-void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd,
- uint32_t msg,
- intptr_t wParam,
- intptr_t lParam) {
- CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
-
- switch (msg) {
- case PNM_LBUTTONDOWN:
- if (pWnd == m_pMinButton) {
- OnMinButtonLBDown(*(CFX_PointF*)lParam);
- }
-
- if (pWnd == m_pMaxButton) {
- OnMaxButtonLBDown(*(CFX_PointF*)lParam);
- }
-
- if (pWnd == m_pPosButton) {
- OnPosButtonLBDown(*(CFX_PointF*)lParam);
- }
- break;
- case PNM_LBUTTONUP:
- if (pWnd == m_pMinButton) {
- OnMinButtonLBUp(*(CFX_PointF*)lParam);
- }
-
- if (pWnd == m_pMaxButton) {
- OnMaxButtonLBUp(*(CFX_PointF*)lParam);
- }
-
- if (pWnd == m_pPosButton) {
- OnPosButtonLBUp(*(CFX_PointF*)lParam);
- }
- break;
- case PNM_MOUSEMOVE:
- if (pWnd == m_pMinButton) {
- OnMinButtonMouseMove(*(CFX_PointF*)lParam);
- }
+void CPWL_ScrollBar::NotifyLButtonDown(CPWL_Wnd* child, const CFX_PointF& pos) {
+ if (child == m_pMinButton)
+ OnMinButtonLBDown(pos);
+ else if (child == m_pMaxButton)
+ OnMaxButtonLBDown(pos);
+ else if (child == m_pPosButton)
+ OnPosButtonLBDown(pos);
+}
- if (pWnd == m_pMaxButton) {
- OnMaxButtonMouseMove(*(CFX_PointF*)lParam);
- }
+void CPWL_ScrollBar::NotifyLButtonUp(CPWL_Wnd* child, const CFX_PointF& pos) {
+ if (child == m_pMinButton)
+ OnMinButtonLBUp(pos);
+ else if (child == m_pMaxButton)
+ OnMaxButtonLBUp(pos);
+ else if (child == m_pPosButton)
+ OnPosButtonLBUp(pos);
+}
- if (pWnd == m_pPosButton) {
- OnPosButtonMouseMove(*(CFX_PointF*)lParam);
- }
- break;
- }
+void CPWL_ScrollBar::NotifyMouseMove(CPWL_Wnd* child, const CFX_PointF& pos) {
+ if (child == m_pMinButton)
+ OnMinButtonMouseMove(pos);
+ else if (child == m_pMaxButton)
+ OnMaxButtonMouseMove(pos);
+ else if (child == m_pPosButton)
+ OnPosButtonMouseMove(pos);
}
void CPWL_ScrollBar::CreateButtons(const PWL_CREATEPARAM& cp) {