| Index: xfa/fwl/core/ifwl_checkbox.h
|
| diff --git a/xfa/fwl/basewidget/ifwl_checkbox.h b/xfa/fwl/core/ifwl_checkbox.h
|
| similarity index 58%
|
| rename from xfa/fwl/basewidget/ifwl_checkbox.h
|
| rename to xfa/fwl/core/ifwl_checkbox.h
|
| index ff5e3b86f797403fd3705d3dd93b052a1fa0d3d5..237a15b30e642ac908b9e8eea3cf33244751345a 100644
|
| --- a/xfa/fwl/basewidget/ifwl_checkbox.h
|
| +++ b/xfa/fwl/core/ifwl_checkbox.h
|
| @@ -4,8 +4,8 @@
|
|
|
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
|
|
| -#ifndef XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_
|
| -#define XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_
|
| +#ifndef XFA_FWL_CORE_IFWL_CHECKBOX_H_
|
| +#define XFA_FWL_CORE_IFWL_CHECKBOX_H_
|
|
|
| #include "xfa/fwl/core/cfwl_event.h"
|
| #include "xfa/fwl/core/cfwl_widgetimpproperties.h"
|
| @@ -44,6 +44,11 @@
|
| #define FWL_STATE_CKB_Neutral (2 << (FWL_WGTSTATE_MAX + 2))
|
| #define FWL_STATE_CKB_CheckMask (3L << (FWL_WGTSTATE_MAX + 2))
|
|
|
| +class CFWL_CheckBoxImpDelegate;
|
| +class CFWL_MsgMouse;
|
| +class CFWL_WidgetImpProperties;
|
| +class IFWL_Widget;
|
| +
|
| FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, CFWL_EventType::CheckStateChanged)
|
|
|
| class IFWL_CheckBoxDP : public IFWL_DataProvider {
|
| @@ -55,11 +60,58 @@ class IFWL_CheckBox : public IFWL_Widget {
|
| public:
|
| static IFWL_CheckBox* Create(const CFWL_WidgetImpProperties& properties,
|
| IFWL_Widget* pOuter);
|
| +
|
| + IFWL_CheckBox(const CFWL_WidgetImpProperties& properties,
|
| + IFWL_Widget* pOuter);
|
| + ~IFWL_CheckBox() override;
|
| +
|
| + // IFWL_Widget
|
| + FWL_Error GetClassName(CFX_WideString& wsClass) const override;
|
| + FWL_Type GetClassID() const override;
|
| + FWL_Error Initialize() override;
|
| + FWL_Error Finalize() override;
|
| + FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override;
|
| + FWL_Error Update() override;
|
| + FWL_Error DrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix = nullptr) override;
|
| int32_t GetCheckState();
|
| FWL_Error SetCheckState(int32_t iCheck);
|
|
|
| protected:
|
| - IFWL_CheckBox();
|
| + friend class CFWL_CheckBoxImpDelegate;
|
| +
|
| + void Layout();
|
| + uint32_t GetPartStates();
|
| + void UpdateTextOutStyles();
|
| + void NextStates();
|
| +
|
| + CFX_RectF m_rtClient;
|
| + CFX_RectF m_rtBox;
|
| + CFX_RectF m_rtCaption;
|
| + CFX_RectF m_rtFocus;
|
| + uint32_t m_dwTTOStyles;
|
| + int32_t m_iTTOAlign;
|
| + FX_BOOL m_bBtnDown;
|
| +};
|
| +
|
| +class CFWL_CheckBoxImpDelegate : public CFWL_WidgetImpDelegate {
|
| + public:
|
| + CFWL_CheckBoxImpDelegate(IFWL_CheckBox* pOwner);
|
| +
|
| + void OnProcessMessage(CFWL_Message* pMessage) override;
|
| + void OnDrawWidget(CFX_Graphics* pGraphics,
|
| + const CFX_Matrix* pMatrix = nullptr) override;
|
| +
|
| + protected:
|
| + void OnActivate(CFWL_Message* pMsg);
|
| + void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE);
|
| + void OnLButtonDown(CFWL_MsgMouse* pMsg);
|
| + void OnLButtonUp(CFWL_MsgMouse* pMsg);
|
| + void OnMouseMove(CFWL_MsgMouse* pMsg);
|
| + void OnMouseLeave(CFWL_MsgMouse* pMsg);
|
| + void OnKeyDown(CFWL_MsgKey* pMsg);
|
| +
|
| + IFWL_CheckBox* m_pOwner;
|
| };
|
|
|
| -#endif // XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_
|
| +#endif // XFA_FWL_CORE_IFWL_CHECKBOX_H_
|
|
|