From 3b3ce1a242f8445848d3f23d6c35ba01d7c645f4 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 2 Nov 2016 14:51:25 -0700 Subject: Merge delegates into IFWL_* classes. This Cl removes ownership of the delgates from IFWL_Widget and puts it in the hand of the creating classes. In doing so, merge the delegates back into the IFWL_* classes to simplify logic. Review-Url: https://codereview.chromium.org/2467993003 --- xfa/fwl/core/ifwl_datetimepicker.h | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) (limited to 'xfa/fwl/core/ifwl_datetimepicker.h') diff --git a/xfa/fwl/core/ifwl_datetimepicker.h b/xfa/fwl/core/ifwl_datetimepicker.h index 5b360d3603..04d2869c54 100644 --- a/xfa/fwl/core/ifwl_datetimepicker.h +++ b/xfa/fwl/core/ifwl_datetimepicker.h @@ -74,6 +74,9 @@ class IFWL_DateTimePicker : public IFWL_Widget { FWL_Error DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr) override; FWL_Error SetThemeProvider(IFWL_ThemeProvider* pTP) override; + void OnProcessMessage(CFWL_Message* pMessage) override; + void OnDrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix) override; FWL_Error GetCurSel(int32_t& iYear, int32_t& iMonth, int32_t& iDay); FWL_Error SetCurSel(int32_t iYear, int32_t iMonth, int32_t iDay); @@ -103,12 +106,13 @@ class IFWL_DateTimePicker : public IFWL_Widget { uint32_t dwStylesExRemoved); IFWL_DateTimeEdit* GetDataTimeEdit(); - protected: - friend class CFWL_DateTimeEditImpDelegate; - friend class IFWL_DateTimeCalendar; - friend class CFWL_DateTimeCalendarImpDelegate; - friend class CFWL_DateTimePickerImpDelegate; + FX_BOOL IsMonthCalendarShowed(); + void ShowMonthCalendar(FX_BOOL bActivate); + void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); + IFWL_FormProxy* GetFormProxy() const { return m_pForm.get(); } + + protected: class CFWL_MonthCalendarImpDP : public IFWL_MonthCalendarDP { public: CFWL_MonthCalendarImpDP(); @@ -134,11 +138,8 @@ class IFWL_DateTimePicker : public IFWL_Widget { int32_t iMonth, int32_t iDay, CFX_WideString& wsText); - void ShowMonthCalendar(FX_BOOL bActivate); - FX_BOOL IsMonthCalendarShowed(); void ReSetEditAlignment(); void InitProxyForm(); - void ProcessSelChanged(int32_t iYear, int32_t iMonth, int32_t iDay); CFX_RectF m_rtBtn; CFX_RectF m_rtClient; @@ -166,28 +167,13 @@ class IFWL_DateTimePicker : public IFWL_Widget { FWL_Error DisForm_GetBBox(CFX_RectF& rect); FWL_Error DisForm_DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = nullptr); -}; - -class CFWL_DateTimePickerImpDelegate : public CFWL_WidgetImpDelegate { - public: - CFWL_DateTimePickerImpDelegate(IFWL_DateTimePicker* pOwner); - - // CFWL_WidgetImpDelegate - void OnProcessMessage(CFWL_Message* pMessage) override; - void OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix = nullptr) override; - protected: - void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); + void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet); void OnLButtonDown(CFWL_MsgMouse* pMsg); void OnLButtonUp(CFWL_MsgMouse* pMsg); void OnMouseMove(CFWL_MsgMouse* pMsg); void OnMouseLeave(CFWL_MsgMouse* pMsg); - - IFWL_DateTimePicker* m_pOwner; - - private: - void DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); + void DisForm_OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet); }; #endif // XFA_FWL_CORE_IFWL_DATETIMEPICKER_H_ -- cgit v1.2.3