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

Side by Side Diff: xfa/src/fwl/src/basewidget/fwl_spinbuttonimp.cpp

Issue 1453473002: FWL refcounts never incremented (part 2). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebased Created 5 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 "../../../foxitlib.h" 7 #include "../../../foxitlib.h"
8 #include "../core/include/fwl_targetimp.h" 8 #include "../core/include/fwl_targetimp.h"
9 #include "../core/include/fwl_noteimp.h" 9 #include "../core/include/fwl_noteimp.h"
10 #include "../core/include/fwl_widgetimp.h" 10 #include "../core/include/fwl_widgetimp.h"
11 #include "include/fwl_spinbuttonimp.h" 11 #include "include/fwl_spinbuttonimp.h"
12 #define FWL_SPN_MinWidth 18 12 #define FWL_SPN_MinWidth 18
13 #define FWL_SPN_MinHeight 32 13 #define FWL_SPN_MinHeight 32
14 #define FWL_SPIN_Elapse 200 14 #define FWL_SPIN_Elapse 200
15 IFWL_SpinButton::IFWL_SpinButton() { 15
16 // static
17 IFWL_SpinButton* IFWL_SpinButton::Create(
18 const CFWL_WidgetImpProperties& properties,
19 IFWL_Widget* pOuter) {
20 IFWL_SpinButton* pSpinButton = new IFWL_SpinButton;
21 CFWL_SpinButtonImp* pSpinButtonImpl =
22 new CFWL_SpinButtonImp(properties, nullptr);
23 pSpinButton->SetImpl(pSpinButtonImpl);
24 pSpinButtonImpl->SetInterface(pSpinButton);
25 return pSpinButton;
16 } 26 }
17 FWL_ERR IFWL_SpinButton::Initialize(const CFWL_WidgetImpProperties& properties, 27 IFWL_SpinButton::IFWL_SpinButton() {}
18 IFWL_Widget* pOuter) {
19 CFWL_SpinButtonImp* pSpinButtonImpl = new CFWL_SpinButtonImp(properties);
20 SetImpl(pSpinButtonImpl);
21 pSpinButtonImpl->SetInterface(this);
22 return pSpinButtonImpl->Initialize();
23 }
24 FWL_ERR IFWL_SpinButton::EnableButton(FX_BOOL bEnable, FX_BOOL bUp) { 28 FWL_ERR IFWL_SpinButton::EnableButton(FX_BOOL bEnable, FX_BOOL bUp) {
25 return static_cast<CFWL_SpinButtonImp*>(GetImpl()) 29 return static_cast<CFWL_SpinButtonImp*>(GetImpl())
26 ->EnableButton(bEnable, bUp); 30 ->EnableButton(bEnable, bUp);
27 } 31 }
28 FX_BOOL IFWL_SpinButton::IsButtonEnable(FX_BOOL bUp) { 32 FX_BOOL IFWL_SpinButton::IsButtonEnable(FX_BOOL bUp) {
29 return static_cast<CFWL_SpinButtonImp*>(GetImpl())->IsButtonEnable(bUp); 33 return static_cast<CFWL_SpinButtonImp*>(GetImpl())->IsButtonEnable(bUp);
30 } 34 }
31 CFWL_SpinButtonImp::CFWL_SpinButtonImp(IFWL_Widget* pOuter) 35
32 : CFWL_WidgetImp(pOuter),
33 m_dwUpState(FWL_PARTSTATE_SPB_Normal),
34 m_dwDnState(FWL_PARTSTATE_SPB_Normal),
35 m_iButtonIndex(0),
36 m_bLButtonDwn(FALSE),
37 m_hTimer(NULL) {
38 m_rtClient.Reset();
39 m_rtUpButton.Reset();
40 m_rtDnButton.Reset();
41 m_pProperties->m_dwStyleExes |= FWL_STYLEEXE_SPB_Vert;
42 }
43 CFWL_SpinButtonImp::CFWL_SpinButtonImp( 36 CFWL_SpinButtonImp::CFWL_SpinButtonImp(
44 const CFWL_WidgetImpProperties& properties, 37 const CFWL_WidgetImpProperties& properties,
45 IFWL_Widget* pOuter) 38 IFWL_Widget* pOuter)
46 : CFWL_WidgetImp(properties, pOuter), 39 : CFWL_WidgetImp(properties, pOuter),
47 m_dwUpState(FWL_PARTSTATE_SPB_Normal), 40 m_dwUpState(FWL_PARTSTATE_SPB_Normal),
48 m_dwDnState(FWL_PARTSTATE_SPB_Normal), 41 m_dwDnState(FWL_PARTSTATE_SPB_Normal),
49 m_iButtonIndex(0), 42 m_iButtonIndex(0),
50 m_bLButtonDwn(FALSE), 43 m_bLButtonDwn(FALSE),
51 m_hTimer(NULL) { 44 m_hTimer(NULL) {
52 m_rtClient.Reset(); 45 m_rtClient.Reset();
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (!bUpEnable && !bDownEnable) { 416 if (!bUpEnable && !bDownEnable) {
424 return; 417 return;
425 } 418 }
426 CFWL_EvtSpbClick wmPosChanged; 419 CFWL_EvtSpbClick wmPosChanged;
427 wmPosChanged.m_pSrcTarget = m_pOwner->m_pInterface; 420 wmPosChanged.m_pSrcTarget = m_pOwner->m_pInterface;
428 wmPosChanged.m_bUp = bUpEnable; 421 wmPosChanged.m_bUp = bUpEnable;
429 m_pOwner->DispatchEvent(&wmPosChanged); 422 m_pOwner->DispatchEvent(&wmPosChanged);
430 m_pOwner->Repaint(bUpEnable ? &m_pOwner->m_rtUpButton 423 m_pOwner->Repaint(bUpEnable ? &m_pOwner->m_rtUpButton
431 : &m_pOwner->m_rtDnButton); 424 : &m_pOwner->m_rtDnButton);
432 } 425 }
OLDNEW
« no previous file with comments | « xfa/src/fwl/src/basewidget/fwl_scrollbarimp.cpp ('k') | xfa/src/fwl/src/basewidget/fwl_tooltipctrlimp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698