diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-07 17:23:28 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-07 17:23:28 -0800 |
commit | 7fa190dbda7b3a5f46b8108aa7984b2fcc23d45c (patch) | |
tree | 334c92bc076724892ca6cfe96767f0e5ed841ca1 /xfa/fwl/core/cfwl_datetimepicker.cpp | |
parent | 919c0842b74d382e7ae60c85ff16642b646afbb9 (diff) | |
download | pdfium-7fa190dbda7b3a5f46b8108aa7984b2fcc23d45c.tar.xz |
Cleanup default FWL params part I
This Cl removes some of the default FWL parameters.
Review-Url: https://codereview.chromium.org/2533623002
Diffstat (limited to 'xfa/fwl/core/cfwl_datetimepicker.cpp')
-rw-r--r-- | xfa/fwl/core/cfwl_datetimepicker.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/xfa/fwl/core/cfwl_datetimepicker.cpp b/xfa/fwl/core/cfwl_datetimepicker.cpp index 28f174c374..29aaaf0a2e 100644 --- a/xfa/fwl/core/cfwl_datetimepicker.cpp +++ b/xfa/fwl/core/cfwl_datetimepicker.cpp @@ -129,7 +129,7 @@ FWL_WidgetHit CFWL_DateTimePicker::HitTest(FX_FLOAT fx, FX_FLOAT fy) { return FWL_WidgetHit::Client; if (IsMonthCalendarVisible()) { CFX_RectF rect; - m_pMonthCal->GetWidgetRect(rect); + m_pMonthCal->GetWidgetRect(rect, false); if (rect.Contains(fx, fy)) return FWL_WidgetHit::Client; } @@ -210,7 +210,7 @@ void CFWL_DateTimePicker::GetBBox(CFX_RectF& rect) const { rect = m_pProperties->m_rtWidget; if (IsMonthCalendarVisible()) { CFX_RectF rtMonth; - m_pMonthCal->GetWidgetRect(rtMonth); + m_pMonthCal->GetWidgetRect(rtMonth, false); rtMonth.Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top); rect.Union(rtMonth); @@ -268,7 +268,7 @@ void CFWL_DateTimePicker::ShowMonthCalendar(bool bActivate) { } CFX_RectF rtMonth; - m_pMonthCal->GetWidgetRect(rtMonth); + m_pMonthCal->GetWidgetRect(rtMonth, false); CFX_RectF rtAnchor; rtAnchor.Set(0, 0, m_pProperties->m_rtWidget.width, @@ -277,7 +277,10 @@ void CFWL_DateTimePicker::ShowMonthCalendar(bool bActivate) { m_pForm->SetWidgetRect(rtMonth); rtMonth.left = rtMonth.top = 0; - m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); + if (bActivate) + m_pMonthCal->RemoveStates(FWL_WGTSTATE_Invisible); + else + m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible); m_pMonthCal->SetWidgetRect(rtMonth); m_pMonthCal->Update(); m_pForm->DoModal(); @@ -395,7 +398,10 @@ void CFWL_DateTimePicker::DisForm_ShowMonthCalendar(bool bActivate) { m_pMonthCal->SetSelect(m_iYear, m_iMonth, m_iDay); m_pMonthCal->Update(); } - m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate); + if (bActivate) + m_pMonthCal->RemoveStates(FWL_WGTSTATE_Invisible); + else + m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible); if (bActivate) { CFWL_MsgSetFocus msg(m_pEdit.get(), m_pMonthCal.get()); @@ -405,7 +411,7 @@ void CFWL_DateTimePicker::DisForm_ShowMonthCalendar(bool bActivate) { CFX_RectF rtInvalidate, rtCal; rtInvalidate.Set(0, 0, m_pProperties->m_rtWidget.width, m_pProperties->m_rtWidget.height); - m_pMonthCal->GetWidgetRect(rtCal); + m_pMonthCal->GetWidgetRect(rtCal, false); rtInvalidate.Union(rtCal); rtInvalidate.Inflate(2, 2); Repaint(&rtInvalidate); @@ -423,7 +429,7 @@ FWL_WidgetHit CFWL_DateTimePicker::DisForm_HitTest(FX_FLOAT fx, if (rect.Contains(fx, fy)) return FWL_WidgetHit::Client; if (IsMonthCalendarVisible()) { - m_pMonthCal->GetWidgetRect(rect); + m_pMonthCal->GetWidgetRect(rect, false); if (rect.Contains(fx, fy)) return FWL_WidgetHit::Client; } @@ -482,7 +488,7 @@ void CFWL_DateTimePicker::DisForm_GetBBox(CFX_RectF& rect) const { return; CFX_RectF rtMonth; - m_pMonthCal->GetWidgetRect(rtMonth); + m_pMonthCal->GetWidgetRect(rtMonth, false); rtMonth.Offset(m_pProperties->m_rtWidget.left, m_pProperties->m_rtWidget.top); rect.Union(rtMonth); } @@ -493,7 +499,7 @@ void CFWL_DateTimePicker::DisForm_DrawWidget(CFX_Graphics* pGraphics, return; if (m_pEdit) { CFX_RectF rtEdit; - m_pEdit->GetWidgetRect(rtEdit); + m_pEdit->GetWidgetRect(rtEdit, false); CFX_Matrix mt; mt.Set(1, 0, 0, 1, rtEdit.left, rtEdit.top); @@ -505,7 +511,7 @@ void CFWL_DateTimePicker::DisForm_DrawWidget(CFX_Graphics* pGraphics, return; CFX_RectF rtMonth; - m_pMonthCal->GetWidgetRect(rtMonth); + m_pMonthCal->GetWidgetRect(rtMonth, false); CFX_Matrix mt; mt.Set(1, 0, 0, 1, rtMonth.left, rtMonth.top); if (pMatrix) |