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

Side by Side Diff: xfa/fwl/core/cfwl_scrollbar.cpp

Issue 2530993002: Cleanup FWL Event and Message code. (Closed)
Patch Set: 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/fwl/core/cfwl_scrollbar.h" 7 #include "xfa/fwl/core/cfwl_scrollbar.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 368 }
369 if (m_iMouseWheel) { 369 if (m_iMouseWheel) {
370 FWL_SCBCODE dwCode = m_iMouseWheel < 0 ? FWL_SCBCODE::StepForward 370 FWL_SCBCODE dwCode = m_iMouseWheel < 0 ? FWL_SCBCODE::StepForward
371 : FWL_SCBCODE::StepBackward; 371 : FWL_SCBCODE::StepBackward;
372 DoScroll(dwCode, m_fTrackPos); 372 DoScroll(dwCode, m_fTrackPos);
373 } 373 }
374 return true; 374 return true;
375 } 375 }
376 376
377 bool CFWL_ScrollBar::OnScroll(FWL_SCBCODE dwCode, FX_FLOAT fPos) { 377 bool CFWL_ScrollBar::OnScroll(FWL_SCBCODE dwCode, FX_FLOAT fPos) {
378 bool bRet = true;
379 CFWL_EvtScroll ev; 378 CFWL_EvtScroll ev;
380 ev.m_iScrollCode = dwCode; 379 ev.m_iScrollCode = dwCode;
381 ev.m_pSrcTarget = this; 380 ev.m_pSrcTarget = this;
382 ev.m_fPos = fPos; 381 ev.m_fPos = fPos;
383 ev.m_pRet = &bRet;
384 DispatchEvent(&ev); 382 DispatchEvent(&ev);
385 return bRet; 383 return true;
386 } 384 }
387 385
388 void CFWL_ScrollBar::OnProcessMessage(CFWL_Message* pMessage) { 386 void CFWL_ScrollBar::OnProcessMessage(CFWL_Message* pMessage) {
389 if (!pMessage) 387 if (!pMessage)
390 return; 388 return;
391 389
392 CFWL_MessageType dwMsgCode = pMessage->GetClassID(); 390 CFWL_MessageType dwMsgCode = pMessage->GetClassID();
393 if (dwMsgCode == CFWL_MessageType::Mouse) { 391 if (dwMsgCode == CFWL_MessageType::Mouse) {
394 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); 392 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
395 switch (pMsg->m_dwCmd) { 393 switch (pMsg->m_dwCmd) {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 552
555 void CFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) { 553 void CFWL_ScrollBar::Timer::Run(CFWL_TimerInfo* pTimerInfo) {
556 CFWL_ScrollBar* pButton = static_cast<CFWL_ScrollBar*>(m_pWidget); 554 CFWL_ScrollBar* pButton = static_cast<CFWL_ScrollBar*>(m_pWidget);
557 555
558 if (pButton->m_pTimerInfo) 556 if (pButton->m_pTimerInfo)
559 pButton->m_pTimerInfo->StopTimer(); 557 pButton->m_pTimerInfo->StopTimer();
560 558
561 if (!pButton->SendEvent()) 559 if (!pButton->SendEvent())
562 pButton->m_pTimerInfo = StartTimer(0, true); 560 pButton->m_pTimerInfo = StartTimer(0, true);
563 } 561 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698