diff options
author | dsinclair <dsinclair@chromium.org> | 2016-05-04 13:51:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-04 13:51:51 -0700 |
commit | 8f4bf9a8ac211e150f7fa4d8ed061f264cb3aa9e (patch) | |
tree | 9ac5bb23a12623ea77ecb13e74a665733efedc8c /xfa/fwl/basewidget/fwl_spinbuttonimp.cpp | |
parent | 7d89e728a450c681c53d40d7f67ee2eef0400705 (diff) | |
download | pdfium-8f4bf9a8ac211e150f7fa4d8ed061f264cb3aa9e.tar.xz |
More define cleanup.
This CL converts defines into constants, enums, enum classes or removes them
as needed.
Review-Url: https://codereview.chromium.org/1938163002
Diffstat (limited to 'xfa/fwl/basewidget/fwl_spinbuttonimp.cpp')
-rw-r--r-- | xfa/fwl/basewidget/fwl_spinbuttonimp.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp index 5692087762..9a70d7187d 100644 --- a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp +++ b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp @@ -16,9 +16,13 @@ #include "xfa/fwl/core/ifwl_themeprovider.h" #include "xfa/fwl/core/ifwl_timer.h" -#define FWL_SPN_MinWidth 18 -#define FWL_SPN_MinHeight 32 -#define FWL_SPIN_Elapse 200 +namespace { + +const int kMinWidth = 18; +const int kMinHeight = 32; +const int kElapseTime = 200; + +} // namespace // static IFWL_SpinButton* IFWL_SpinButton::Create( @@ -75,7 +79,7 @@ FWL_ERR CFWL_SpinButtonImp::Finalize() { } FWL_ERR CFWL_SpinButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { if (bAutoSize) { - rect.Set(0, 0, FWL_SPN_MinWidth, FWL_SPN_MinHeight); + rect.Set(0, 0, kMinWidth, kMinHeight); CFWL_WidgetImp::GetWidgetRect(rect, TRUE); } else { rect = m_pProperties->m_rtWidget; @@ -218,19 +222,19 @@ int32_t CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { case CFWL_MessageType::Mouse: { CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); switch (pMsg->m_dwCmd) { - case FWL_MSGMOUSECMD_LButtonDown: { + case FWL_MouseCommand::LeftButtonDown: { OnLButtonDown(pMsg); break; } - case FWL_MSGMOUSECMD_LButtonUp: { + case FWL_MouseCommand::LeftButtonUp: { OnLButtonUp(pMsg); break; } - case FWL_MSGMOUSECMD_MouseMove: { + case FWL_MouseCommand::Move: { OnMouseMove(pMsg); break; } - case FWL_MSGMOUSECMD_MouseLeave: { + case FWL_MouseCommand::Leave: { OnMouseLeave(pMsg); break; } @@ -241,7 +245,7 @@ int32_t CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { } case CFWL_MessageType::Key: { CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage); - if (pKey->m_dwCmd == FWL_MSGKEYCMD_KeyDown) + if (pKey->m_dwCmd == FWL_KeyCommand::KeyDown) OnKeyDown(pKey); break; } @@ -297,7 +301,7 @@ void CFWL_SpinButtonImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { m_pOwner->DispatchEvent(&wmPosChanged); m_pOwner->Repaint(bUpPress ? &m_pOwner->m_rtUpButton : &m_pOwner->m_rtDnButton); - m_pOwner->m_hTimer = FWL_StartTimer(m_pOwner, FWL_SPIN_Elapse); + m_pOwner->m_hTimer = FWL_StartTimer(m_pOwner, kElapseTime); } void CFWL_SpinButtonImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { if (m_pOwner->m_pProperties->m_dwStates & CFWL_PartState_Disabled) { |