| 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 #ifndef XFA_FWL_CORE_IFWL_SPINBUTTON_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_SPINBUTTON_H_ |
| 8 #define XFA_FWL_CORE_IFWL_SPINBUTTON_H_ | 8 #define XFA_FWL_CORE_IFWL_SPINBUTTON_H_ |
| 9 | 9 |
| 10 #include "xfa/fwl/core/cfwl_event.h" | 10 #include "xfa/fwl/core/cfwl_event.h" |
| 11 #include "xfa/fwl/core/ifwl_timer.h" | 11 #include "xfa/fwl/core/ifwl_timer.h" |
| 12 #include "xfa/fwl/core/ifwl_widget.h" | 12 #include "xfa/fwl/core/ifwl_widget.h" |
| 13 #include "xfa/fxfa/cxfa_eventparam.h" | 13 #include "xfa/fxfa/cxfa_eventparam.h" |
| 14 | 14 |
| 15 #define FWL_CLASS_SpinButton L"FWL_SPINBUTTON" | |
| 16 #define FWL_STYLEEXE_SPB_Vert (1L << 0) | 15 #define FWL_STYLEEXE_SPB_Vert (1L << 0) |
| 17 | 16 |
| 18 class CFWL_MsgMouse; | 17 class CFWL_MsgMouse; |
| 19 class CFWL_SpinButtonImpDelegate; | 18 class CFWL_SpinButtonImpDelegate; |
| 20 class CFWL_WidgetImpProperties; | 19 class CFWL_WidgetImpProperties; |
| 21 | 20 |
| 22 FWL_EVENT_DEF(CFWL_EvtSpbClick, CFWL_EventType::Click, FX_BOOL m_bUp;) | 21 FWL_EVENT_DEF(CFWL_EvtSpbClick, CFWL_EventType::Click, FX_BOOL m_bUp;) |
| 23 | 22 |
| 24 class IFWL_SpinButton : public IFWL_Widget, public IFWL_Timer { | 23 class IFWL_SpinButton : public IFWL_Widget, public IFWL_Timer { |
| 25 public: | 24 public: |
| 26 explicit IFWL_SpinButton(const CFWL_WidgetImpProperties& properties); | 25 explicit IFWL_SpinButton(const CFWL_WidgetImpProperties& properties); |
| 27 ~IFWL_SpinButton() override; | 26 ~IFWL_SpinButton() override; |
| 28 | 27 |
| 29 // IFWL_Widget | 28 // IFWL_Widget |
| 30 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | |
| 31 FWL_Type GetClassID() const override; | 29 FWL_Type GetClassID() const override; |
| 32 FWL_Error Initialize() override; | 30 FWL_Error Initialize() override; |
| 33 FWL_Error Finalize() override; | 31 void Finalize() override; |
| 34 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 32 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
| 35 FWL_Error Update() override; | 33 FWL_Error Update() override; |
| 36 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 34 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
| 37 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 35 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
| 38 const CFX_Matrix* pMatrix = nullptr) override; | 36 const CFX_Matrix* pMatrix = nullptr) override; |
| 39 | 37 |
| 40 // IFWL_Timer | 38 // IFWL_Timer |
| 41 void Run(IFWL_TimerInfo* pTimerInfo) override; | 39 void Run(IFWL_TimerInfo* pTimerInfo) override; |
| 42 | 40 |
| 43 FWL_Error EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE); | 41 FWL_Error EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 73 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
| 76 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 74 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 77 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 75 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 78 void OnMouseMove(CFWL_MsgMouse* pMsg); | 76 void OnMouseMove(CFWL_MsgMouse* pMsg); |
| 79 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 77 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
| 80 void OnKeyDown(CFWL_MsgKey* pMsg); | 78 void OnKeyDown(CFWL_MsgKey* pMsg); |
| 81 IFWL_SpinButton* m_pOwner; | 79 IFWL_SpinButton* m_pOwner; |
| 82 }; | 80 }; |
| 83 | 81 |
| 84 #endif // XFA_FWL_CORE_IFWL_SPINBUTTON_H_ | 82 #endif // XFA_FWL_CORE_IFWL_SPINBUTTON_H_ |
| OLD | NEW |