summaryrefslogtreecommitdiff
path: root/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-21 13:12:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 13:12:06 -0700
commit5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf (patch)
treedf40bedc2582cab695e7bf4b2056bfddd4969908 /xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
parent0f6425fff33e4096b4e1fbfb954edae1349c0145 (diff)
downloadpdfium-5d9da0c1255a75dd9b7b2005f8b7d6ae4948feaf.tar.xz
Remove CFWL_Note.
This CL removes the CFWL_Note class. The two subclasses, CFWL_Event and CFWL_Message are distinct types and should not be related by the subclass. The code has been updated to pass the correct types as needed. The various FWL_EVTHASH and FWL_MSGHASH defines have all been removed and turned into an FWL_EventType and FWL_MessageType enum classes. BUG=pdfium:474 Review URL: https://codereview.chromium.org/1901183002
Diffstat (limited to 'xfa/fwl/basewidget/fwl_spinbuttonimp.cpp')
-rw-r--r--xfa/fwl/basewidget/fwl_spinbuttonimp.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
index e52529d3c6..6d60d81e81 100644
--- a/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
+++ b/xfa/fwl/basewidget/fwl_spinbuttonimp.cpp
@@ -201,24 +201,29 @@ void CFWL_SpinButtonImp::DrawDownButton(CFX_Graphics* pGraphics,
params.m_rtPart = m_rtDnButton;
pTheme->DrawBackground(&params);
}
+
CFWL_SpinButtonImpDelegate::CFWL_SpinButtonImpDelegate(
CFWL_SpinButtonImp* pOwner)
: m_pOwner(pOwner) {}
+
int32_t CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
if (!pMessage)
return 0;
+
int32_t iRet = 1;
- uint32_t dwMsgCode = pMessage->GetClassID();
+ CFWL_MessageType dwMsgCode = pMessage->GetClassID();
switch (dwMsgCode) {
- case FWL_MSGHASH_SetFocus:
- case FWL_MSGHASH_KillFocus: {
- OnFocusChanged(pMessage, dwMsgCode == FWL_MSGHASH_SetFocus);
+ case CFWL_MessageType::SetFocus: {
+ OnFocusChanged(pMessage, TRUE);
+ break;
+ }
+ case CFWL_MessageType::KillFocus: {
+ OnFocusChanged(pMessage, FALSE);
break;
}
- case FWL_MSGHASH_Mouse: {
+ case CFWL_MessageType::Mouse: {
CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
- uint32_t dwCmd = pMsg->m_dwCmd;
- switch (dwCmd) {
+ switch (pMsg->m_dwCmd) {
case FWL_MSGMOUSECMD_LButtonDown: {
OnLButtonDown(pMsg);
break;
@@ -235,15 +240,15 @@ int32_t CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
OnMouseLeave(pMsg);
break;
}
- default: {}
+ default:
+ break;
}
break;
}
- case FWL_MSGHASH_Key: {
+ case CFWL_MessageType::Key: {
CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
- if (pKey->m_dwCmd == FWL_MSGKEYCMD_KeyDown) {
+ if (pKey->m_dwCmd == FWL_MSGKEYCMD_KeyDown)
OnKeyDown(pKey);
- }
break;
}
default: {
@@ -254,6 +259,7 @@ int32_t CFWL_SpinButtonImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
CFWL_WidgetImpDelegate::OnProcessMessage(pMessage);
return iRet;
}
+
FWL_ERR CFWL_SpinButtonImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
return FWL_ERR_Succeeded;
}