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_BASEWIDGET_FWL_SPINBUTTONIMP_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_SPINBUTTON_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_SPINBUTTONIMP_H_ | 8 #define XFA_FWL_CORE_IFWL_SPINBUTTON_H_ |
9 | 9 |
10 #include "xfa/fwl/core/fwl_widgetimp.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" |
| 14 |
| 15 #define FWL_CLASS_SpinButton L"FWL_SPINBUTTON" |
| 16 #define FWL_STYLEEXE_SPB_Vert (1L << 0) |
13 | 17 |
14 class CFWL_MsgMouse; | 18 class CFWL_MsgMouse; |
15 class CFWL_SpinButtonImpDelegate; | 19 class CFWL_SpinButtonImpDelegate; |
16 class CFWL_WidgetImpProperties; | 20 class CFWL_WidgetImpProperties; |
17 | 21 |
18 class CFWL_SpinButtonImp : public CFWL_WidgetImp, public IFWL_Timer { | 22 FWL_EVENT_DEF(CFWL_EvtSpbClick, CFWL_EventType::Click, FX_BOOL m_bUp;) |
| 23 |
| 24 class IFWL_SpinButton : public IFWL_Widget, public IFWL_Timer { |
19 public: | 25 public: |
20 CFWL_SpinButtonImp(const CFWL_WidgetImpProperties& properties, | 26 static IFWL_SpinButton* Create(const CFWL_WidgetImpProperties& properties, |
21 IFWL_Widget* pOuter); | 27 IFWL_Widget* pOuter); |
22 ~CFWL_SpinButtonImp() override; | |
23 | 28 |
24 // CFWL_WidgetImp | 29 IFWL_SpinButton(const CFWL_WidgetImpProperties& properties, |
| 30 IFWL_Widget* pOuter); |
| 31 ~IFWL_SpinButton() override; |
| 32 |
| 33 // IFWL_Widget |
25 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | 34 FWL_Error GetClassName(CFX_WideString& wsClass) const override; |
26 FWL_Type GetClassID() const override; | 35 FWL_Type GetClassID() const override; |
27 FWL_Error Initialize() override; | 36 FWL_Error Initialize() override; |
28 FWL_Error Finalize() override; | 37 FWL_Error Finalize() override; |
29 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 38 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
30 FWL_Error Update() override; | 39 FWL_Error Update() override; |
31 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 40 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
32 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 41 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
33 const CFX_Matrix* pMatrix = nullptr) override; | 42 const CFX_Matrix* pMatrix = nullptr) override; |
34 | 43 |
(...skipping 18 matching lines...) Expand all Loading... |
53 CFX_RectF m_rtDnButton; | 62 CFX_RectF m_rtDnButton; |
54 uint32_t m_dwUpState; | 63 uint32_t m_dwUpState; |
55 uint32_t m_dwDnState; | 64 uint32_t m_dwDnState; |
56 int32_t m_iButtonIndex; | 65 int32_t m_iButtonIndex; |
57 FX_BOOL m_bLButtonDwn; | 66 FX_BOOL m_bLButtonDwn; |
58 IFWL_TimerInfo* m_pTimerInfo; | 67 IFWL_TimerInfo* m_pTimerInfo; |
59 }; | 68 }; |
60 | 69 |
61 class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate { | 70 class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate { |
62 public: | 71 public: |
63 CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp* pOwner); | 72 CFWL_SpinButtonImpDelegate(IFWL_SpinButton* pOwner); |
64 void OnProcessMessage(CFWL_Message* pMessage) override; | 73 void OnProcessMessage(CFWL_Message* pMessage) override; |
65 void OnProcessEvent(CFWL_Event* pEvent) override; | 74 void OnProcessEvent(CFWL_Event* pEvent) override; |
66 void OnDrawWidget(CFX_Graphics* pGraphics, | 75 void OnDrawWidget(CFX_Graphics* pGraphics, |
67 const CFX_Matrix* pMatrix = nullptr) override; | 76 const CFX_Matrix* pMatrix = nullptr) override; |
68 | 77 |
69 protected: | 78 protected: |
70 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 79 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
71 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 80 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
72 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 81 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
73 void OnMouseMove(CFWL_MsgMouse* pMsg); | 82 void OnMouseMove(CFWL_MsgMouse* pMsg); |
74 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 83 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
75 void OnKeyDown(CFWL_MsgKey* pMsg); | 84 void OnKeyDown(CFWL_MsgKey* pMsg); |
76 CFWL_SpinButtonImp* m_pOwner; | 85 IFWL_SpinButton* m_pOwner; |
77 }; | 86 }; |
78 | 87 |
79 #endif // XFA_FWL_BASEWIDGET_FWL_SPINBUTTONIMP_H_ | 88 #endif // XFA_FWL_CORE_IFWL_SPINBUTTON_H_ |
OLD | NEW |