summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_datetimeedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/core/ifwl_datetimeedit.cpp')
-rw-r--r--xfa/fwl/core/ifwl_datetimeedit.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/xfa/fwl/core/ifwl_datetimeedit.cpp b/xfa/fwl/core/ifwl_datetimeedit.cpp
index 1c0baae32d..906ba94e57 100644
--- a/xfa/fwl/core/ifwl_datetimeedit.cpp
+++ b/xfa/fwl/core/ifwl_datetimeedit.cpp
@@ -13,16 +13,10 @@
IFWL_DateTimeEdit::IFWL_DateTimeEdit(const IFWL_App* app,
const CFWL_WidgetImpProperties& properties,
IFWL_Widget* pOuter)
- : IFWL_Edit(app, properties, pOuter) {
- SetDelegate(pdfium::MakeUnique<CFWL_DateTimeEditImpDelegate>(this));
-}
-
-CFWL_DateTimeEditImpDelegate::CFWL_DateTimeEditImpDelegate(
- IFWL_DateTimeEdit* pOwner)
- : CFWL_EditImpDelegate(pOwner), m_pOwner(pOwner) {}
+ : IFWL_Edit(app, properties, pOuter) {}
-void CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
- if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
+void IFWL_DateTimeEdit::OnProcessMessage(CFWL_Message* pMessage) {
+ if (m_pWidgetMgr->IsFormDisabled()) {
DisForm_OnProcessMessage(pMessage);
return;
}
@@ -30,24 +24,23 @@ void CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
CFWL_MessageType dwHashCode = pMessage->GetClassID();
if (dwHashCode == CFWL_MessageType::SetFocus ||
dwHashCode == CFWL_MessageType::KillFocus) {
- IFWL_Widget* pOuter = m_pOwner->GetOuter();
- pOuter->GetCurrentDelegate()->OnProcessMessage(pMessage);
+ IFWL_Widget* pOuter = GetOuter();
+ pOuter->GetDelegate()->OnProcessMessage(pMessage);
}
}
-void CFWL_DateTimeEditImpDelegate::DisForm_OnProcessMessage(
- CFWL_Message* pMessage) {
+void IFWL_DateTimeEdit::DisForm_OnProcessMessage(CFWL_Message* pMessage) {
CFWL_MessageType dwHashCode = pMessage->GetClassID();
- if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
+ if (m_pWidgetMgr->IsFormDisabled()) {
if (dwHashCode == CFWL_MessageType::Mouse) {
CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage);
if (pMouse->m_dwCmd == FWL_MouseCommand::LeftButtonDown ||
pMouse->m_dwCmd == FWL_MouseCommand::RightButtonDown) {
- if ((m_pOwner->m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) {
- m_pOwner->m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
- }
+ if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)
+ m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
+
IFWL_DateTimePicker* pDateTime =
- static_cast<IFWL_DateTimePicker*>(m_pOwner->m_pOuter);
+ static_cast<IFWL_DateTimePicker*>(m_pOuter);
if (pDateTime->IsMonthCalendarShowed()) {
CFX_RectF rtInvalidate;
pDateTime->GetWidgetRect(rtInvalidate);
@@ -58,5 +51,5 @@ void CFWL_DateTimeEditImpDelegate::DisForm_OnProcessMessage(
}
}
}
- CFWL_EditImpDelegate::OnProcessMessage(pMessage);
+ IFWL_Edit::OnProcessMessage(pMessage);
}