Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: xfa/fwl/core/cfwl_pushbutton.cpp

Issue 2530993002: Cleanup FWL Event and Message code. (Closed)
Patch Set: Cleanup Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fwl/core/cfwl_pushbutton.cpp
diff --git a/xfa/fwl/core/cfwl_pushbutton.cpp b/xfa/fwl/core/cfwl_pushbutton.cpp
index 15e98fc4a51de08eac869aaecc6cad29bc318a3f..5f0e2fb17c2e6982eceddc76352bbbf866181d15 100644
--- a/xfa/fwl/core/cfwl_pushbutton.cpp
+++ b/xfa/fwl/core/cfwl_pushbutton.cpp
@@ -11,7 +11,7 @@
#include "third_party/base/ptr_util.h"
#include "xfa/fde/tto/fde_textout.h"
-#include "xfa/fwl/core/cfwl_evtclick.h"
+#include "xfa/fwl/core/cfwl_event.h"
#include "xfa/fwl/core/cfwl_evtmouse.h"
#include "xfa/fwl/core/cfwl_msgkey.h"
#include "xfa/fwl/core/cfwl_msgmouse.h"
@@ -248,7 +248,7 @@ void CFWL_PushButton::OnLButtonUp(CFWL_MsgMouse* pMsg) {
m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed;
}
if (m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
- CFWL_EvtClick wmClick;
+ CFWL_Event wmClick(CFWL_EventType::Click);
wmClick.m_pSrcTarget = this;
DispatchEvent(&wmClick);
}
@@ -297,18 +297,14 @@ void CFWL_PushButton::OnMouseLeave(CFWL_MsgMouse* pMsg) {
}
void CFWL_PushButton::OnKeyDown(CFWL_MsgKey* pMsg) {
- if (pMsg->m_dwKeyCode == FWL_VKEY_Return) {
- CFWL_EvtMouse wmMouse;
- wmMouse.m_pSrcTarget = this;
- wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
- DispatchEvent(&wmMouse);
- CFWL_EvtClick wmClick;
- wmClick.m_pSrcTarget = this;
- DispatchEvent(&wmClick);
- return;
- }
- if (pMsg->m_dwKeyCode != FWL_VKEY_Tab)
+ if (pMsg->m_dwKeyCode != FWL_VKEY_Return)
return;
- DispatchKeyEvent(pMsg);
+ CFWL_EvtMouse wmMouse;
+ wmMouse.m_pSrcTarget = this;
+ wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
+ DispatchEvent(&wmMouse);
+ CFWL_Event wmClick(CFWL_EventType::Click);
+ wmClick.m_pSrcTarget = this;
+ DispatchEvent(&wmClick);
}

Powered by Google App Engine
This is Rietveld 408576698