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_BASEWIDGET_FWL_SPINBUTTONIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_SPINBUTTONIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_SPINBUTTONIMP_H_ |
9 | 9 |
10 #include "xfa/fwl/core/fwl_widgetimp.h" | 10 #include "xfa/fwl/core/fwl_widgetimp.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 FWL_Type GetClassID() const override; | 26 FWL_Type GetClassID() const override; |
27 FWL_Error Initialize() override; | 27 FWL_Error Initialize() override; |
28 FWL_Error Finalize() override; | 28 FWL_Error Finalize() override; |
29 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 29 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
30 FWL_Error Update() override; | 30 FWL_Error Update() override; |
31 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 31 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
32 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 32 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
33 const CFX_Matrix* pMatrix = nullptr) override; | 33 const CFX_Matrix* pMatrix = nullptr) override; |
34 | 34 |
35 // IFWL_Timer | 35 // IFWL_Timer |
36 int32_t Run(FWL_HTIMER hTimer) override; | 36 void Run(IFWL_TimerInfo* pTimerInfo) override; |
37 | 37 |
38 FWL_Error EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE); | 38 FWL_Error EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE); |
39 FX_BOOL IsButtonEnable(FX_BOOL bUp = TRUE); | 39 FX_BOOL IsButtonEnable(FX_BOOL bUp = TRUE); |
40 | 40 |
41 protected: | 41 protected: |
42 friend class CFWL_SpinButtonImpDelegate; | 42 friend class CFWL_SpinButtonImpDelegate; |
43 | 43 |
44 void DrawUpButton(CFX_Graphics* pGraphics, | 44 void DrawUpButton(CFX_Graphics* pGraphics, |
45 IFWL_ThemeProvider* pTheme, | 45 IFWL_ThemeProvider* pTheme, |
46 const CFX_Matrix* pMatrix); | 46 const CFX_Matrix* pMatrix); |
47 void DrawDownButton(CFX_Graphics* pGraphics, | 47 void DrawDownButton(CFX_Graphics* pGraphics, |
48 IFWL_ThemeProvider* pTheme, | 48 IFWL_ThemeProvider* pTheme, |
49 const CFX_Matrix* pMatrix); | 49 const CFX_Matrix* pMatrix); |
50 | 50 |
51 CFX_RectF m_rtClient; | 51 CFX_RectF m_rtClient; |
52 CFX_RectF m_rtUpButton; | 52 CFX_RectF m_rtUpButton; |
53 CFX_RectF m_rtDnButton; | 53 CFX_RectF m_rtDnButton; |
54 uint32_t m_dwUpState; | 54 uint32_t m_dwUpState; |
55 uint32_t m_dwDnState; | 55 uint32_t m_dwDnState; |
56 int32_t m_iButtonIndex; | 56 int32_t m_iButtonIndex; |
57 FX_BOOL m_bLButtonDwn; | 57 FX_BOOL m_bLButtonDwn; |
58 FWL_HTIMER m_hTimer; | 58 IFWL_TimerInfo* m_pTimerInfo; |
59 }; | 59 }; |
| 60 |
60 class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate { | 61 class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate { |
61 public: | 62 public: |
62 CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp* pOwner); | 63 CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp* pOwner); |
63 void OnProcessMessage(CFWL_Message* pMessage) override; | 64 void OnProcessMessage(CFWL_Message* pMessage) override; |
64 void OnProcessEvent(CFWL_Event* pEvent) override; | 65 void OnProcessEvent(CFWL_Event* pEvent) override; |
65 void OnDrawWidget(CFX_Graphics* pGraphics, | 66 void OnDrawWidget(CFX_Graphics* pGraphics, |
66 const CFX_Matrix* pMatrix = NULL) override; | 67 const CFX_Matrix* pMatrix = NULL) override; |
67 | 68 |
68 protected: | 69 protected: |
69 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 70 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
70 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 71 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
71 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 72 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
72 void OnMouseMove(CFWL_MsgMouse* pMsg); | 73 void OnMouseMove(CFWL_MsgMouse* pMsg); |
73 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 74 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
74 void OnKeyDown(CFWL_MsgKey* pMsg); | 75 void OnKeyDown(CFWL_MsgKey* pMsg); |
75 CFWL_SpinButtonImp* m_pOwner; | 76 CFWL_SpinButtonImp* m_pOwner; |
76 }; | 77 }; |
77 | 78 |
78 #endif // XFA_FWL_BASEWIDGET_FWL_SPINBUTTONIMP_H_ | 79 #endif // XFA_FWL_BASEWIDGET_FWL_SPINBUTTONIMP_H_ |
OLD | NEW |