summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/cpwl_combo_box.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_combo_box.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_combo_box.cpp')
-rw-r--r--fpdfsdk/pdfwindow/cpwl_combo_box.cpp44
1 files changed, 15 insertions, 29 deletions
diff --git a/fpdfsdk/pdfwindow/cpwl_combo_box.cpp b/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
index 3223db1b5f..11a674b41b 100644
--- a/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_combo_box.cpp
@@ -33,7 +33,7 @@ bool CPWL_CBListBox::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) {
if (!ClientHitTest(point))
return true;
if (CPWL_Wnd* pParent = GetParentWindow())
- pParent->OnNotify(this, PNM_LBUTTONUP, 0, PWL_MAKEDWORD(point.x, point.y));
+ pParent->NotifyLButtonUp(this, point);
bool bExit = false;
OnNotifySelChanged(false, bExit, nFlag);
@@ -165,10 +165,8 @@ bool CPWL_CBButton::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) {
SetCapture();
- if (CPWL_Wnd* pParent = GetParentWindow()) {
- pParent->OnNotify(this, PNM_LBUTTONDOWN, 0,
- PWL_MAKEDWORD(point.x, point.y));
- }
+ if (CPWL_Wnd* pParent = GetParentWindow())
+ pParent->NotifyLButtonDown(this, point);
return true;
}
@@ -548,31 +546,19 @@ bool CPWL_ComboBox::OnChar(uint16_t nChar, uint32_t nFlag) {
return m_pList->OnCharWithExit(nChar, bExit, nFlag) ? bExit : false;
}
-void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd,
- uint32_t msg,
- intptr_t wParam,
- intptr_t lParam) {
- switch (msg) {
- case PNM_LBUTTONDOWN:
- if (pWnd == m_pButton) {
- SetPopup(!m_bPopup);
- return;
- }
- break;
- case PNM_LBUTTONUP:
- if (m_pEdit && m_pList) {
- if (pWnd == m_pList) {
- SetSelectText();
- SelectAll();
- m_pEdit->SetFocus();
- SetPopup(false);
- return;
- }
- }
- break;
- }
+void CPWL_ComboBox::NotifyLButtonDown(CPWL_Wnd* child, const CFX_PointF& pos) {
+ if (child == m_pButton)
+ SetPopup(!m_bPopup);
+}
- CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
+void CPWL_ComboBox::NotifyLButtonUp(CPWL_Wnd* child, const CFX_PointF& pos) {
+ if (!m_pEdit || !m_pList || child != m_pList)
+ return;
+
+ SetSelectText();
+ SelectAll();
+ m_pEdit->SetFocus();
+ SetPopup(false);
}
bool CPWL_ComboBox::IsPopup() const {