Cleanup FWL Event and Message code.

This CL removes any CFWL_Evt classes for which nothing was listening to the
events. For events with no parameters the override class was removed and
the event type passed into CFWL_Event which is used instead. Any event or
message parameters which are un-read have been removed.

Review-Url: https://codereview.chromium.org/2530993002
diff --git a/BUILD.gn b/BUILD.gn
index a91feeb..c6d9036 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1223,40 +1223,16 @@
       "xfa/fwl/core/cfwl_event.h",
       "xfa/fwl/core/cfwl_eventtarget.cpp",
       "xfa/fwl/core/cfwl_eventtarget.h",
-      "xfa/fwl/core/cfwl_evtcheckstatechanged.cpp",
-      "xfa/fwl/core/cfwl_evtcheckstatechanged.h",
       "xfa/fwl/core/cfwl_evtcheckword.cpp",
       "xfa/fwl/core/cfwl_evtcheckword.h",
-      "xfa/fwl/core/cfwl_evtclick.cpp",
-      "xfa/fwl/core/cfwl_evtclick.h",
-      "xfa/fwl/core/cfwl_evtclose.cpp",
-      "xfa/fwl/core/cfwl_evtclose.h",
-      "xfa/fwl/core/cfwl_evteditchanged.cpp",
-      "xfa/fwl/core/cfwl_evteditchanged.h",
-      "xfa/fwl/core/cfwl_evtkey.cpp",
-      "xfa/fwl/core/cfwl_evtkey.h",
-      "xfa/fwl/core/cfwl_evtkillfocus.cpp",
-      "xfa/fwl/core/cfwl_evtkillfocus.h",
       "xfa/fwl/core/cfwl_evtmouse.cpp",
       "xfa/fwl/core/cfwl_evtmouse.h",
-      "xfa/fwl/core/cfwl_evtmousewheel.cpp",
-      "xfa/fwl/core/cfwl_evtmousewheel.h",
-      "xfa/fwl/core/cfwl_evtpostdropdown.cpp",
-      "xfa/fwl/core/cfwl_evtpostdropdown.h",
-      "xfa/fwl/core/cfwl_evtpredropdown.cpp",
-      "xfa/fwl/core/cfwl_evtpredropdown.h",
       "xfa/fwl/core/cfwl_evtscroll.cpp",
       "xfa/fwl/core/cfwl_evtscroll.h",
       "xfa/fwl/core/cfwl_evtselectchanged.cpp",
       "xfa/fwl/core/cfwl_evtselectchanged.h",
-      "xfa/fwl/core/cfwl_evtsetfocus.cpp",
-      "xfa/fwl/core/cfwl_evtsetfocus.h",
-      "xfa/fwl/core/cfwl_evtsizechanged.cpp",
-      "xfa/fwl/core/cfwl_evtsizechanged.h",
       "xfa/fwl/core/cfwl_evttextchanged.cpp",
       "xfa/fwl/core/cfwl_evttextchanged.h",
-      "xfa/fwl/core/cfwl_evttextfull.cpp",
-      "xfa/fwl/core/cfwl_evttextfull.h",
       "xfa/fwl/core/cfwl_evtvalidate.cpp",
       "xfa/fwl/core/cfwl_evtvalidate.h",
       "xfa/fwl/core/cfwl_form.cpp",
diff --git a/xfa/fwl/core/cfwl_barcode.cpp b/xfa/fwl/core/cfwl_barcode.cpp
index 6ddcdf3..8f5b081 100644
--- a/xfa/fwl/core/cfwl_barcode.cpp
+++ b/xfa/fwl/core/cfwl_barcode.cpp
@@ -88,7 +88,7 @@
 }
 
 void CFWL_Barcode::OnProcessEvent(CFWL_Event* pEvent) {
-  if (pEvent->GetClassID() == CFWL_EventType::TextChanged) {
+  if (pEvent->GetType() == CFWL_Event::Type::TextChanged) {
     m_pBarcodeEngine.reset();
     m_dwStatus = XFA_BCS_NeedUpdate;
   }
diff --git a/xfa/fwl/core/cfwl_checkbox.cpp b/xfa/fwl/core/cfwl_checkbox.cpp
index cdd8211..dc042d5 100644
--- a/xfa/fwl/core/cfwl_checkbox.cpp
+++ b/xfa/fwl/core/cfwl_checkbox.cpp
@@ -13,7 +13,7 @@
 #include "third_party/base/ptr_util.h"
 #include "xfa/fde/tto/fde_textout.h"
 #include "xfa/fwl/core/cfwl_app.h"
-#include "xfa/fwl/core/cfwl_evtcheckstatechanged.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_msgkey.h"
 #include "xfa/fwl/core/cfwl_msgmouse.h"
 #include "xfa/fwl/core/cfwl_notedriver.h"
@@ -339,8 +339,7 @@
   if (dwFirststate == m_pProperties->m_dwStates)
     return;
 
-  CFWL_EvtCheckStateChanged wmCheckBoxState;
-  wmCheckBoxState.m_pSrcTarget = this;
+  CFWL_Event wmCheckBoxState(CFWL_Event::Type::CheckStateChanged, this);
   DispatchEvent(&wmCheckBoxState);
 }
 
@@ -348,14 +347,14 @@
   if (!pMessage)
     return;
 
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::SetFocus:
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus:
       OnFocusChanged(true);
       break;
-    case CFWL_MessageType::KillFocus:
+    case CFWL_Message::Type::KillFocus:
       OnFocusChanged(false);
       break;
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -375,7 +374,7 @@
       }
       break;
     }
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
       if (pKey->m_dwCmd == FWL_KeyCommand::KeyDown)
         OnKeyDown(pKey);
@@ -474,10 +473,8 @@
 }
 
 void CFWL_CheckBox::OnKeyDown(CFWL_MsgKey* pMsg) {
-  if (pMsg->m_dwKeyCode == FWL_VKEY_Tab) {
-    DispatchKeyEvent(pMsg);
+  if (pMsg->m_dwKeyCode == FWL_VKEY_Tab)
     return;
-  }
   if (pMsg->m_dwKeyCode == FWL_VKEY_Return ||
       pMsg->m_dwKeyCode == FWL_VKEY_Space) {
     NextStates();
diff --git a/xfa/fwl/core/cfwl_combobox.cpp b/xfa/fwl/core/cfwl_combobox.cpp
index 5996af9..c8486c3 100644
--- a/xfa/fwl/core/cfwl_combobox.cpp
+++ b/xfa/fwl/core/cfwl_combobox.cpp
@@ -14,9 +14,7 @@
 #include "xfa/fde/cfde_txtedtengine.h"
 #include "xfa/fde/tto/fde_textout.h"
 #include "xfa/fwl/core/cfwl_app.h"
-#include "xfa/fwl/core/cfwl_evteditchanged.h"
-#include "xfa/fwl/core/cfwl_evtpostdropdown.h"
-#include "xfa/fwl/core/cfwl_evtpredropdown.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_evtselectchanged.h"
 #include "xfa/fwl/core/cfwl_evttextchanged.h"
 #include "xfa/fwl/core/cfwl_formproxy.h"
@@ -399,8 +397,7 @@
   m_pListBox->SetWidgetRect(m_rtList);
   m_pListBox->Update();
 
-  CFWL_EvtPreDropDown ev;
-  ev.m_pSrcTarget = this;
+  CFWL_Event ev(CFWL_Event::Type::PreDropDown, this);
   DispatchEvent(&ev);
 
   m_fItemHeight = m_pListBox->GetItemHeight();
@@ -553,9 +550,8 @@
     m_pEdit->SetSelected();
   }
 
-  CFWL_EvtSelectChanged ev;
+  CFWL_EvtSelectChanged ev(this);
   ev.bLButtonUp = bLButtonUp;
-  ev.m_pSrcTarget = this;
   DispatchEvent(&ev);
 }
 
@@ -608,8 +604,7 @@
     return;
 
   if (bActivate) {
-    CFWL_EvtPreDropDown preEvent;
-    preEvent.m_pSrcTarget = this;
+    CFWL_Event preEvent(CFWL_Event::Type::PreDropDown, this);
     DispatchEvent(&preEvent);
 
     CFWL_ComboList* pComboList = m_pListBox.get();
@@ -642,8 +637,7 @@
 
   m_pListBox->SetStates(FWL_WGTSTATE_Invisible, !bActivate);
   if (bActivate) {
-    CFWL_EvtPostDropDown postEvent;
-    postEvent.m_pSrcTarget = this;
+    CFWL_Event postEvent(CFWL_Event::Type::PostDropDown, this);
     DispatchEvent(&postEvent);
   }
 
@@ -794,14 +788,14 @@
   if (!pMessage)
     return;
 
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::SetFocus:
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus:
       OnFocusChanged(pMessage, true);
       break;
-    case CFWL_MessageType::KillFocus:
+    case CFWL_Message::Type::KillFocus:
       OnFocusChanged(pMessage, false);
       break;
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -821,7 +815,7 @@
       }
       break;
     }
-    case CFWL_MessageType::Key:
+    case CFWL_Message::Type::Key:
       OnKey(static_cast<CFWL_MsgKey*>(pMessage));
       break;
     default:
@@ -832,17 +826,15 @@
 }
 
 void CFWL_ComboBox::OnProcessEvent(CFWL_Event* pEvent) {
-  CFWL_EventType dwFlag = pEvent->GetClassID();
-  if (dwFlag == CFWL_EventType::Scroll) {
+  CFWL_Event::Type type = pEvent->GetType();
+  if (type == CFWL_Event::Type::Scroll) {
     CFWL_EvtScroll* pScrollEvent = static_cast<CFWL_EvtScroll*>(pEvent);
-    CFWL_EvtScroll pScrollEv;
-    pScrollEv.m_pSrcTarget = this;
+    CFWL_EvtScroll pScrollEv(this);
     pScrollEv.m_iScrollCode = pScrollEvent->m_iScrollCode;
     pScrollEv.m_fPos = pScrollEvent->m_fPos;
     DispatchEvent(&pScrollEv);
-  } else if (dwFlag == CFWL_EventType::TextChanged) {
-    CFWL_EvtEditChanged pTemp;
-    pTemp.m_pSrcTarget = this;
+  } else if (type == CFWL_Event::Type::TextChanged) {
+    CFWL_Event pTemp(CFWL_Event::Type::EditChanged, this);
     DispatchEvent(&pTemp);
   }
 }
@@ -934,10 +926,8 @@
 
 void CFWL_ComboBox::OnKey(CFWL_MsgKey* pMsg) {
   uint32_t dwKeyCode = pMsg->m_dwKeyCode;
-  if (dwKeyCode == FWL_VKEY_Tab) {
-    DispatchKeyEvent(pMsg);
+  if (dwKeyCode == FWL_VKEY_Tab)
     return;
-  }
   if (pMsg->m_pDstTarget == this)
     DoSubCtrlKey(pMsg);
 }
@@ -990,18 +980,18 @@
     return;
 
   bool backDefault = true;
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::SetFocus: {
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus: {
       backDefault = false;
       DisForm_OnFocusChanged(pMessage, true);
       break;
     }
-    case CFWL_MessageType::KillFocus: {
+    case CFWL_Message::Type::KillFocus: {
       backDefault = false;
       DisForm_OnFocusChanged(pMessage, false);
       break;
     }
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       backDefault = false;
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
@@ -1016,7 +1006,7 @@
       }
       break;
     }
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       backDefault = false;
       CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
       if (pKey->m_dwCmd == FWL_KeyCommand::KeyUp)
@@ -1061,17 +1051,13 @@
   if (bSet) {
     m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
     if ((m_pEdit->GetStates() & FWL_WGTSTATE_Focused) == 0) {
-      CFWL_MsgSetFocus msg;
-      msg.m_pDstTarget = m_pEdit.get();
-      msg.m_pSrcTarget = nullptr;
+      CFWL_MsgSetFocus msg(nullptr, m_pEdit.get());
       m_pEdit->GetDelegate()->OnProcessMessage(&msg);
     }
   } else {
     m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
     DisForm_ShowDropList(false);
-    CFWL_MsgKillFocus msg;
-    msg.m_pDstTarget = nullptr;
-    msg.m_pSrcTarget = m_pEdit.get();
+    CFWL_MsgKillFocus msg(m_pEdit.get());
     m_pEdit->GetDelegate()->OnProcessMessage(&msg);
   }
 }
diff --git a/xfa/fwl/core/cfwl_comboboxproxy.cpp b/xfa/fwl/core/cfwl_comboboxproxy.cpp
index 4ad358d..4fb6bbb 100644
--- a/xfa/fwl/core/cfwl_comboboxproxy.cpp
+++ b/xfa/fwl/core/cfwl_comboboxproxy.cpp
@@ -31,8 +31,8 @@
   if (!pMessage)
     return;
 
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::Mouse: {
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -46,10 +46,10 @@
       }
       break;
     }
-    case CFWL_MessageType::KillFocus:
+    case CFWL_Message::Type::KillFocus:
       OnFocusChanged(pMessage, false);
       break;
-    case CFWL_MessageType::SetFocus:
+    case CFWL_Message::Type::SetFocus:
       OnFocusChanged(pMessage, true);
       break;
     default:
diff --git a/xfa/fwl/core/cfwl_comboedit.cpp b/xfa/fwl/core/cfwl_comboedit.cpp
index af5c2a7..32e4cbb 100644
--- a/xfa/fwl/core/cfwl_comboedit.cpp
+++ b/xfa/fwl/core/cfwl_comboedit.cpp
@@ -47,18 +47,18 @@
     return;
 
   bool backDefault = true;
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::SetFocus: {
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus: {
       m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused;
       backDefault = false;
       break;
     }
-    case CFWL_MessageType::KillFocus: {
+    case CFWL_Message::Type::KillFocus: {
       m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused;
       backDefault = false;
       break;
     }
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       if ((pMsg->m_dwCmd == FWL_MouseCommand::LeftButtonDown) &&
           ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0)) {
diff --git a/xfa/fwl/core/cfwl_combolist.cpp b/xfa/fwl/core/cfwl_combolist.cpp
index e333cda..ad80ac0 100644
--- a/xfa/fwl/core/cfwl_combolist.cpp
+++ b/xfa/fwl/core/cfwl_combolist.cpp
@@ -77,12 +77,12 @@
   if (!pMessage)
     return;
 
-  CFWL_MessageType dwHashCode = pMessage->GetClassID();
+  CFWL_Message::Type type = pMessage->GetType();
   bool backDefault = true;
-  if (dwHashCode == CFWL_MessageType::SetFocus ||
-      dwHashCode == CFWL_MessageType::KillFocus) {
-    OnDropListFocusChanged(pMessage, dwHashCode == CFWL_MessageType::SetFocus);
-  } else if (dwHashCode == CFWL_MessageType::Mouse) {
+  if (type == CFWL_Message::Type::SetFocus ||
+      type == CFWL_Message::Type::KillFocus) {
+    OnDropListFocusChanged(pMessage, type == CFWL_Message::Type::SetFocus);
+  } else if (type == CFWL_Message::Type::Mouse) {
     CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
     CFWL_ScrollBar* vertSB = GetVertScrollBar();
     if (IsShowScrollBar(true) && vertSB) {
@@ -114,7 +114,7 @@
       default:
         break;
     }
-  } else if (dwHashCode == CFWL_MessageType::Key) {
+  } else if (type == CFWL_Message::Type::Key) {
     backDefault = !OnDropListKey(static_cast<CFWL_MsgKey*>(pMessage));
   }
   if (backDefault)
diff --git a/xfa/fwl/core/cfwl_datetimeedit.cpp b/xfa/fwl/core/cfwl_datetimeedit.cpp
index b74efb1..dc7aa1f 100644
--- a/xfa/fwl/core/cfwl_datetimeedit.cpp
+++ b/xfa/fwl/core/cfwl_datetimeedit.cpp
@@ -26,18 +26,17 @@
     return;
   }
 
-  CFWL_MessageType dwHashCode = pMessage->GetClassID();
-  if (dwHashCode == CFWL_MessageType::SetFocus ||
-      dwHashCode == CFWL_MessageType::KillFocus) {
+  CFWL_Message::Type type = pMessage->GetType();
+  if (type == CFWL_Message::Type::SetFocus ||
+      type == CFWL_Message::Type::KillFocus) {
     CFWL_Widget* pOuter = GetOuter();
     pOuter->GetDelegate()->OnProcessMessage(pMessage);
   }
 }
 
 void CFWL_DateTimeEdit::DisForm_OnProcessMessage(CFWL_Message* pMessage) {
-  CFWL_MessageType dwHashCode = pMessage->GetClassID();
   if (!m_pWidgetMgr->IsFormDisabled() ||
-      dwHashCode != CFWL_MessageType::Mouse) {
+      pMessage->GetType() != CFWL_Message::Type::Mouse) {
     CFWL_Edit::OnProcessMessage(pMessage);
     return;
   }
diff --git a/xfa/fwl/core/cfwl_datetimepicker.cpp b/xfa/fwl/core/cfwl_datetimepicker.cpp
index 35b038d..28f174c 100644
--- a/xfa/fwl/core/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/core/cfwl_datetimepicker.cpp
@@ -10,7 +10,7 @@
 #include <utility>
 
 #include "third_party/base/ptr_util.h"
-#include "xfa/fwl/core/cfwl_evteditchanged.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_evtselectchanged.h"
 #include "xfa/fwl/core/cfwl_formproxy.h"
 #include "xfa/fwl/core/cfwl_msgmouse.h"
@@ -192,7 +192,7 @@
   m_pEdit->SetText(wsText);
   Repaint(&m_rtClient);
 
-  CFWL_EvtEditChanged ev;
+  CFWL_Event ev(CFWL_Event::Type::EditChanged);
   DispatchEvent(&ev);
 }
 
@@ -347,8 +347,7 @@
   m_pEdit->Update();
   Repaint(&m_rtClient);
 
-  CFWL_EvtSelectChanged ev;
-  ev.m_pSrcTarget = this;
+  CFWL_EvtSelectChanged ev(this);
   ev.iYear = m_iYear;
   ev.iMonth = m_iMonth;
   ev.iDay = m_iDay;
@@ -399,9 +398,7 @@
   m_pMonthCal->SetStates(FWL_WGTSTATE_Invisible, !bActivate);
 
   if (bActivate) {
-    CFWL_MsgSetFocus msg;
-    msg.m_pDstTarget = m_pMonthCal.get();
-    msg.m_pSrcTarget = m_pEdit.get();
+    CFWL_MsgSetFocus msg(m_pEdit.get(), m_pMonthCal.get());
     m_pEdit->GetDelegate()->OnProcessMessage(&msg);
   }
 
@@ -520,14 +517,14 @@
   if (!pMessage)
     return;
 
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::SetFocus:
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus:
       OnFocusChanged(pMessage, true);
       break;
-    case CFWL_MessageType::KillFocus:
+    case CFWL_Message::Type::KillFocus:
       OnFocusChanged(pMessage, false);
       break;
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMouse->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -547,7 +544,7 @@
       }
       break;
     }
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       if (m_pEdit->GetStates() & FWL_WGTSTATE_Focused) {
         m_pEdit->GetDelegate()->OnProcessMessage(pMessage);
         return;
diff --git a/xfa/fwl/core/cfwl_edit.cpp b/xfa/fwl/core/cfwl_edit.cpp
index 4544ebc..751bf43 100644
--- a/xfa/fwl/core/cfwl_edit.cpp
+++ b/xfa/fwl/core/cfwl_edit.cpp
@@ -20,9 +20,9 @@
 #include "xfa/fgas/font/cfgas_gefont.h"
 #include "xfa/fwl/core/cfwl_app.h"
 #include "xfa/fwl/core/cfwl_caret.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_evtcheckword.h"
 #include "xfa/fwl/core/cfwl_evttextchanged.h"
-#include "xfa/fwl/core/cfwl_evttextfull.h"
 #include "xfa/fwl/core/cfwl_evtvalidate.h"
 #include "xfa/fwl/core/cfwl_msgkey.h"
 #include "xfa/fwl/core/cfwl_msgmouse.h"
@@ -200,8 +200,7 @@
     pGraphics->ConcatMatrix(const_cast<CFX_Matrix*>(pMatrix));
 
   CFX_Color crLine(0xFFFF0000);
-  CFWL_EvtCheckWord checkWordEvent;
-  checkWordEvent.m_pSrcTarget = this;
+  CFWL_EvtCheckWord checkWordEvent(this);
 
   CFX_ByteString sLatinWord;
   CFX_Path pathSpell;
@@ -452,11 +451,7 @@
   CFX_RectF rtTemp;
   GetClientRect(rtTemp);
 
-  CFWL_EvtTextChanged event;
-  event.m_pSrcTarget = this;
-  event.nChangeType = ChangeInfo.nChangeType;
-  event.wsInsert = ChangeInfo.wsInsert;
-  event.wsDelete = ChangeInfo.wsDelete;
+  CFWL_EvtTextChanged event(this);
   event.wsPrevText = ChangeInfo.wsPrevText;
   DispatchEvent(&event);
 
@@ -502,9 +497,7 @@
   if (!pDst)
     pDst = this;
 
-  CFWL_EvtValidate event;
-  event.pDstWidget = pDst;
-  event.m_pSrcTarget = this;
+  CFWL_EvtValidate event(this);
   event.wsInsert = wsText;
   event.bValidate = true;
   DispatchEvent(&event);
@@ -1277,8 +1270,7 @@
   if (iError != -2)
     return;
 
-  CFWL_EvtTextFull textFullEvent;
-  textFullEvent.m_pSrcTarget = this;
+  CFWL_Event textFullEvent(CFWL_Event::Type::TextFull, this);
   DispatchEvent(&textFullEvent);
 }
 
@@ -1286,13 +1278,14 @@
   if (!pMessage)
     return;
 
-  CFWL_MessageType dwMsgCode = pMessage->GetClassID();
-  switch (dwMsgCode) {
-    case CFWL_MessageType::SetFocus:
-    case CFWL_MessageType::KillFocus:
-      OnFocusChanged(pMessage, dwMsgCode == CFWL_MessageType::SetFocus);
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus:
+      OnFocusChanged(pMessage, true);
       break;
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::KillFocus:
+      OnFocusChanged(pMessage, false);
+      break;
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -1315,7 +1308,7 @@
       }
       break;
     }
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
       if (pKey->m_dwCmd == FWL_KeyCommand::KeyDown)
         OnKeyDown(pKey);
@@ -1332,7 +1325,7 @@
 void CFWL_Edit::OnProcessEvent(CFWL_Event* pEvent) {
   if (!pEvent)
     return;
-  if (pEvent->GetClassID() != CFWL_EventType::Scroll)
+  if (pEvent->GetType() != CFWL_Event::Type::Scroll)
     return;
 
   CFWL_Widget* pSrcTarget = pEvent->m_pSrcTarget;
@@ -1522,11 +1515,7 @@
       break;
     }
     case FWL_VKEY_F2:
-      break;
-    case FWL_VKEY_Tab: {
-      DispatchKeyEvent(pMsg);
-      break;
-    }
+    case FWL_VKEY_Tab:
     default:
       break;
   }
@@ -1589,54 +1578,54 @@
 }
 
 bool CFWL_Edit::OnScroll(CFWL_ScrollBar* pScrollBar,
-                         FWL_SCBCODE dwCode,
+                         CFWL_EvtScroll::Code dwCode,
                          FX_FLOAT fPos) {
   CFX_SizeF fs;
   pScrollBar->GetRange(&fs.x, &fs.y);
   FX_FLOAT iCurPos = pScrollBar->GetPos();
   FX_FLOAT fStep = pScrollBar->GetStepSize();
   switch (dwCode) {
-    case FWL_SCBCODE::Min: {
+    case CFWL_EvtScroll::Code::Min: {
       fPos = fs.x;
       break;
     }
-    case FWL_SCBCODE::Max: {
+    case CFWL_EvtScroll::Code::Max: {
       fPos = fs.y;
       break;
     }
-    case FWL_SCBCODE::StepBackward: {
+    case CFWL_EvtScroll::Code::StepBackward: {
       fPos -= fStep;
       if (fPos < fs.x + fStep / 2) {
         fPos = fs.x;
       }
       break;
     }
-    case FWL_SCBCODE::StepForward: {
+    case CFWL_EvtScroll::Code::StepForward: {
       fPos += fStep;
       if (fPos > fs.y - fStep / 2) {
         fPos = fs.y;
       }
       break;
     }
-    case FWL_SCBCODE::PageBackward: {
+    case CFWL_EvtScroll::Code::PageBackward: {
       fPos -= pScrollBar->GetPageSize();
       if (fPos < fs.x) {
         fPos = fs.x;
       }
       break;
     }
-    case FWL_SCBCODE::PageForward: {
+    case CFWL_EvtScroll::Code::PageForward: {
       fPos += pScrollBar->GetPageSize();
       if (fPos > fs.y) {
         fPos = fs.y;
       }
       break;
     }
-    case FWL_SCBCODE::Pos:
-    case FWL_SCBCODE::TrackPos:
-    case FWL_SCBCODE::None:
+    case CFWL_EvtScroll::Code::Pos:
+    case CFWL_EvtScroll::Code::TrackPos:
+    case CFWL_EvtScroll::Code::None:
       break;
-    case FWL_SCBCODE::EndScroll:
+    case CFWL_EvtScroll::Code::EndScroll:
       return false;
   }
   if (iCurPos == fPos)
diff --git a/xfa/fwl/core/cfwl_edit.h b/xfa/fwl/core/cfwl_edit.h
index 342c6dd..d560bc5 100644
--- a/xfa/fwl/core/cfwl_edit.h
+++ b/xfa/fwl/core/cfwl_edit.h
@@ -166,7 +166,9 @@
   void OnMouseMove(CFWL_MsgMouse* pMsg);
   void OnKeyDown(CFWL_MsgKey* pMsg);
   void OnChar(CFWL_MsgKey* pMsg);
-  bool OnScroll(CFWL_ScrollBar* pScrollBar, FWL_SCBCODE dwCode, FX_FLOAT fPos);
+  bool OnScroll(CFWL_ScrollBar* pScrollBar,
+                CFWL_EvtScroll::Code dwCode,
+                FX_FLOAT fPos);
 
   CFX_RectF m_rtClient;
   CFX_RectF m_rtEngine;
diff --git a/xfa/fwl/core/cfwl_event.cpp b/xfa/fwl/core/cfwl_event.cpp
index 06b7345..d598f69 100644
--- a/xfa/fwl/core/cfwl_event.cpp
+++ b/xfa/fwl/core/cfwl_event.cpp
@@ -6,10 +6,15 @@
 
 #include "xfa/fwl/core/cfwl_event.h"
 
-CFWL_Event::CFWL_Event() : m_pSrcTarget(nullptr), m_pDstTarget(nullptr) {}
+CFWL_Event::CFWL_Event(CFWL_Event::Type type)
+    : CFWL_Event(type, nullptr, nullptr) {}
+
+CFWL_Event::CFWL_Event(Type type, CFWL_Widget* pSrcTarget)
+    : CFWL_Event(type, pSrcTarget, nullptr) {}
+
+CFWL_Event::CFWL_Event(Type type,
+                       CFWL_Widget* pSrcTarget,
+                       CFWL_Widget* pDstTarget)
+    : m_pSrcTarget(pSrcTarget), m_pDstTarget(pDstTarget), m_type(type) {}
 
 CFWL_Event::~CFWL_Event() {}
-
-CFWL_EventType CFWL_Event::GetClassID() const {
-  return CFWL_EventType::None;
-}
diff --git a/xfa/fwl/core/cfwl_event.h b/xfa/fwl/core/cfwl_event.h
index fe8e1b3..aa435e5 100644
--- a/xfa/fwl/core/cfwl_event.h
+++ b/xfa/fwl/core/cfwl_event.h
@@ -14,41 +14,39 @@
 #include "xfa/fwl/core/cfwl_msgmouse.h"
 #include "xfa/fwl/core/fwl_error.h"
 
-enum class CFWL_EventType {
-  None = 0,
-
-  CheckStateChanged,
-  CheckWord,
-  Click,
-  Close,
-  EditChanged,
-  Key,
-  KillFocus,
-  Mouse,
-  MouseWheel,
-  PostDropDown,
-  PreDropDown,
-  Scroll,
-  SelectChanged,
-  SetFocus,
-  SizeChanged,
-  TextChanged,
-  TextFull,
-  Validate
-};
-
 class CFX_Graphics;
 class CFWL_Widget;
 
 class CFWL_Event {
  public:
-  CFWL_Event();
+  enum class Type {
+    CheckStateChanged,
+    CheckWord,
+    Click,
+    Close,
+    EditChanged,
+    Mouse,
+    PostDropDown,
+    PreDropDown,
+    Scroll,
+    SelectChanged,
+    TextChanged,
+    TextFull,
+    Validate
+  };
+
+  explicit CFWL_Event(Type type);
+  CFWL_Event(Type type, CFWL_Widget* pSrcTarget);
+  CFWL_Event(Type type, CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   virtual ~CFWL_Event();
 
-  virtual CFWL_EventType GetClassID() const;
+  Type GetType() const { return m_type; }
 
   CFWL_Widget* m_pSrcTarget;
   CFWL_Widget* m_pDstTarget;
+
+ private:
+  Type m_type;
 };
 
 #endif  // XFA_FWL_CORE_CFWL_EVENT_H_
diff --git a/xfa/fwl/core/cfwl_evtcheckstatechanged.cpp b/xfa/fwl/core/cfwl_evtcheckstatechanged.cpp
deleted file mode 100644
index 53f7848..0000000
--- a/xfa/fwl/core/cfwl_evtcheckstatechanged.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtcheckstatechanged.h"
-
-CFWL_EvtCheckStateChanged::CFWL_EvtCheckStateChanged() {}
-
-CFWL_EvtCheckStateChanged::~CFWL_EvtCheckStateChanged() {}
-
-CFWL_EventType CFWL_EvtCheckStateChanged::GetClassID() const {
-  return CFWL_EventType::CheckStateChanged;
-}
diff --git a/xfa/fwl/core/cfwl_evtcheckstatechanged.h b/xfa/fwl/core/cfwl_evtcheckstatechanged.h
deleted file mode 100644
index 544fbad..0000000
--- a/xfa/fwl/core/cfwl_evtcheckstatechanged.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTCHECKSTATECHANGED_H_
-#define XFA_FWL_CORE_CFWL_EVTCHECKSTATECHANGED_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtCheckStateChanged : public CFWL_Event {
- public:
-  CFWL_EvtCheckStateChanged();
-  ~CFWL_EvtCheckStateChanged() override;
-
-  CFWL_EventType GetClassID() const override;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTCHECKSTATECHANGED_H_
diff --git a/xfa/fwl/core/cfwl_evtcheckword.cpp b/xfa/fwl/core/cfwl_evtcheckword.cpp
index 99ecee9..88bdcf6 100644
--- a/xfa/fwl/core/cfwl_evtcheckword.cpp
+++ b/xfa/fwl/core/cfwl_evtcheckword.cpp
@@ -6,10 +6,8 @@
 
 #include "xfa/fwl/core/cfwl_evtcheckword.h"
 
-CFWL_EvtCheckWord::CFWL_EvtCheckWord() {}
+CFWL_EvtCheckWord::CFWL_EvtCheckWord(CFWL_Widget* pSrcTarget)
+    : CFWL_Event(CFWL_Event::Type::CheckWord, pSrcTarget) {}
 
 CFWL_EvtCheckWord::~CFWL_EvtCheckWord() {}
 
-CFWL_EventType CFWL_EvtCheckWord::GetClassID() const {
-  return CFWL_EventType::CheckWord;
-}
diff --git a/xfa/fwl/core/cfwl_evtcheckword.h b/xfa/fwl/core/cfwl_evtcheckword.h
index aceb865..aa853c6 100644
--- a/xfa/fwl/core/cfwl_evtcheckword.h
+++ b/xfa/fwl/core/cfwl_evtcheckword.h
@@ -11,11 +11,9 @@
 
 class CFWL_EvtCheckWord : public CFWL_Event {
  public:
-  CFWL_EvtCheckWord();
+  explicit CFWL_EvtCheckWord(CFWL_Widget* pSrcTarget);
   ~CFWL_EvtCheckWord() override;
 
-  CFWL_EventType GetClassID() const override;
-
   CFX_ByteString bsWord;
   bool bCheckWord;
 };
diff --git a/xfa/fwl/core/cfwl_evtclick.cpp b/xfa/fwl/core/cfwl_evtclick.cpp
deleted file mode 100644
index 35ff645..0000000
--- a/xfa/fwl/core/cfwl_evtclick.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtclick.h"
-
-CFWL_EvtClick::CFWL_EvtClick() {}
-
-CFWL_EvtClick::~CFWL_EvtClick() {}
-
-CFWL_EventType CFWL_EvtClick::GetClassID() const {
-  return CFWL_EventType::Click;
-}
diff --git a/xfa/fwl/core/cfwl_evtclick.h b/xfa/fwl/core/cfwl_evtclick.h
deleted file mode 100644
index 280004a..0000000
--- a/xfa/fwl/core/cfwl_evtclick.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTCLICK_H_
-#define XFA_FWL_CORE_CFWL_EVTCLICK_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtClick : public CFWL_Event {
- public:
-  CFWL_EvtClick();
-  ~CFWL_EvtClick() override;
-
-  CFWL_EventType GetClassID() const override;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTCLICK_H_
diff --git a/xfa/fwl/core/cfwl_evtclose.cpp b/xfa/fwl/core/cfwl_evtclose.cpp
deleted file mode 100644
index 72713a1..0000000
--- a/xfa/fwl/core/cfwl_evtclose.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtclose.h"
-
-CFWL_EvtClose::CFWL_EvtClose() {}
-
-CFWL_EvtClose::~CFWL_EvtClose() {}
-
-CFWL_EventType CFWL_EvtClose::GetClassID() const {
-  return CFWL_EventType::Close;
-}
diff --git a/xfa/fwl/core/cfwl_evtclose.h b/xfa/fwl/core/cfwl_evtclose.h
deleted file mode 100644
index 5847a39..0000000
--- a/xfa/fwl/core/cfwl_evtclose.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTCLOSE_H_
-#define XFA_FWL_CORE_CFWL_EVTCLOSE_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtClose : public CFWL_Event {
- public:
-  CFWL_EvtClose();
-  ~CFWL_EvtClose() override;
-
-  CFWL_EventType GetClassID() const override;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTCLOSE_H_
diff --git a/xfa/fwl/core/cfwl_evteditchanged.cpp b/xfa/fwl/core/cfwl_evteditchanged.cpp
deleted file mode 100644
index abffbe8..0000000
--- a/xfa/fwl/core/cfwl_evteditchanged.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evteditchanged.h"
-
-CFWL_EvtEditChanged::CFWL_EvtEditChanged() {}
-
-CFWL_EvtEditChanged::~CFWL_EvtEditChanged() {}
-
-CFWL_EventType CFWL_EvtEditChanged::GetClassID() const {
-  return CFWL_EventType::EditChanged;
-}
diff --git a/xfa/fwl/core/cfwl_evteditchanged.h b/xfa/fwl/core/cfwl_evteditchanged.h
deleted file mode 100644
index d910f7d..0000000
--- a/xfa/fwl/core/cfwl_evteditchanged.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTEDITCHANGED_H_
-#define XFA_FWL_CORE_CFWL_EVTEDITCHANGED_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtEditChanged : public CFWL_Event {
- public:
-  CFWL_EvtEditChanged();
-  ~CFWL_EvtEditChanged() override;
-
-  CFWL_EventType GetClassID() const override;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTEDITCHANGED_H_
diff --git a/xfa/fwl/core/cfwl_evtkey.cpp b/xfa/fwl/core/cfwl_evtkey.cpp
deleted file mode 100644
index 492c42f..0000000
--- a/xfa/fwl/core/cfwl_evtkey.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtkey.h"
-
-CFWL_EvtKey::CFWL_EvtKey() {}
-
-CFWL_EvtKey::~CFWL_EvtKey() {}
-
-CFWL_EventType CFWL_EvtKey::GetClassID() const {
-  return CFWL_EventType::Key;
-}
diff --git a/xfa/fwl/core/cfwl_evtkey.h b/xfa/fwl/core/cfwl_evtkey.h
deleted file mode 100644
index 6344562..0000000
--- a/xfa/fwl/core/cfwl_evtkey.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTKEY_H_
-#define XFA_FWL_CORE_CFWL_EVTKEY_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtKey : public CFWL_Event {
- public:
-  CFWL_EvtKey();
-  ~CFWL_EvtKey() override;
-
-  CFWL_EventType GetClassID() const override;
-
-  uint32_t m_dwKeyCode;
-  uint32_t m_dwFlags;
-  FWL_KeyCommand m_dwCmd;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTKEY_H_
diff --git a/xfa/fwl/core/cfwl_evtkillfocus.cpp b/xfa/fwl/core/cfwl_evtkillfocus.cpp
deleted file mode 100644
index ad6f40b..0000000
--- a/xfa/fwl/core/cfwl_evtkillfocus.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtkillfocus.h"
-
-CFWL_EvtKillFocus::CFWL_EvtKillFocus() {}
-
-CFWL_EvtKillFocus::~CFWL_EvtKillFocus() {}
-
-CFWL_EventType CFWL_EvtKillFocus::GetClassID() const {
-  return CFWL_EventType::KillFocus;
-}
diff --git a/xfa/fwl/core/cfwl_evtkillfocus.h b/xfa/fwl/core/cfwl_evtkillfocus.h
deleted file mode 100644
index 737053b..0000000
--- a/xfa/fwl/core/cfwl_evtkillfocus.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTKILLFOCUS_H_
-#define XFA_FWL_CORE_CFWL_EVTKILLFOCUS_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtKillFocus : public CFWL_Event {
- public:
-  CFWL_EvtKillFocus();
-  ~CFWL_EvtKillFocus() override;
-
-  CFWL_EventType GetClassID() const override;
-
-  CFWL_Widget* m_pKillFocus;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTKILLFOCUS_H_
diff --git a/xfa/fwl/core/cfwl_evtmouse.cpp b/xfa/fwl/core/cfwl_evtmouse.cpp
index c85172b..8bfce8a 100644
--- a/xfa/fwl/core/cfwl_evtmouse.cpp
+++ b/xfa/fwl/core/cfwl_evtmouse.cpp
@@ -6,10 +6,10 @@
 
 #include "xfa/fwl/core/cfwl_evtmouse.h"
 
-CFWL_EvtMouse::CFWL_EvtMouse() {}
+CFWL_EvtMouse::CFWL_EvtMouse(CFWL_Widget* pSrcTarget)
+    : CFWL_EvtMouse(pSrcTarget, nullptr) {}
+
+CFWL_EvtMouse::CFWL_EvtMouse(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget)
+    : CFWL_Event(CFWL_Event::Type::Mouse, pSrcTarget, pDstTarget) {}
 
 CFWL_EvtMouse::~CFWL_EvtMouse() {}
-
-CFWL_EventType CFWL_EvtMouse::GetClassID() const {
-  return CFWL_EventType::Mouse;
-}
diff --git a/xfa/fwl/core/cfwl_evtmouse.h b/xfa/fwl/core/cfwl_evtmouse.h
index 386301e..e8b1fd5 100644
--- a/xfa/fwl/core/cfwl_evtmouse.h
+++ b/xfa/fwl/core/cfwl_evtmouse.h
@@ -11,14 +11,10 @@
 
 class CFWL_EvtMouse : public CFWL_Event {
  public:
-  CFWL_EvtMouse();
+  explicit CFWL_EvtMouse(CFWL_Widget* pSrcTarget);
+  CFWL_EvtMouse(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   ~CFWL_EvtMouse() override;
 
-  CFWL_EventType GetClassID() const override;
-
-  FX_FLOAT m_fx;
-  FX_FLOAT m_fy;
-  uint32_t m_dwFlags;
   FWL_MouseCommand m_dwCmd;
 };
 
diff --git a/xfa/fwl/core/cfwl_evtmousewheel.cpp b/xfa/fwl/core/cfwl_evtmousewheel.cpp
deleted file mode 100644
index 215947c..0000000
--- a/xfa/fwl/core/cfwl_evtmousewheel.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtmousewheel.h"
-
-CFWL_EvtMouseWheel::CFWL_EvtMouseWheel() {}
-
-CFWL_EvtMouseWheel::~CFWL_EvtMouseWheel() {}
-
-CFWL_EventType CFWL_EvtMouseWheel::GetClassID() const {
-  return CFWL_EventType::MouseWheel;
-}
diff --git a/xfa/fwl/core/cfwl_evtmousewheel.h b/xfa/fwl/core/cfwl_evtmousewheel.h
deleted file mode 100644
index 09e73ca..0000000
--- a/xfa/fwl/core/cfwl_evtmousewheel.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTMOUSEWHEEL_H_
-#define XFA_FWL_CORE_CFWL_EVTMOUSEWHEEL_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtMouseWheel : public CFWL_Event {
- public:
-  CFWL_EvtMouseWheel();
-  ~CFWL_EvtMouseWheel() override;
-
-  CFWL_EventType GetClassID() const override;
-
-  FX_FLOAT m_fx;
-  FX_FLOAT m_fy;
-  FX_FLOAT m_fDeltaX;
-  FX_FLOAT m_fDeltaY;
-  uint32_t m_dwFlags;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTMOUSEWHEEL_H_
diff --git a/xfa/fwl/core/cfwl_evtpostdropdown.cpp b/xfa/fwl/core/cfwl_evtpostdropdown.cpp
deleted file mode 100644
index 52ba803..0000000
--- a/xfa/fwl/core/cfwl_evtpostdropdown.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtpostdropdown.h"
-
-CFWL_EvtPostDropDown::CFWL_EvtPostDropDown() {}
-
-CFWL_EvtPostDropDown::~CFWL_EvtPostDropDown() {}
-
-CFWL_EventType CFWL_EvtPostDropDown::GetClassID() const {
-  return CFWL_EventType::PostDropDown;
-}
diff --git a/xfa/fwl/core/cfwl_evtpostdropdown.h b/xfa/fwl/core/cfwl_evtpostdropdown.h
deleted file mode 100644
index b4d8516..0000000
--- a/xfa/fwl/core/cfwl_evtpostdropdown.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTPOSTDROPDOWN_H_
-#define XFA_FWL_CORE_CFWL_EVTPOSTDROPDOWN_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtPostDropDown : public CFWL_Event {
- public:
-  CFWL_EvtPostDropDown();
-  ~CFWL_EvtPostDropDown() override;
-
-  CFWL_EventType GetClassID() const override;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTPOSTDROPDOWN_H_
diff --git a/xfa/fwl/core/cfwl_evtpredropdown.cpp b/xfa/fwl/core/cfwl_evtpredropdown.cpp
deleted file mode 100644
index 12fe9fc..0000000
--- a/xfa/fwl/core/cfwl_evtpredropdown.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtpredropdown.h"
-
-CFWL_EvtPreDropDown::CFWL_EvtPreDropDown() {}
-
-CFWL_EvtPreDropDown::~CFWL_EvtPreDropDown() {}
-
-CFWL_EventType CFWL_EvtPreDropDown::GetClassID() const {
-  return CFWL_EventType::PreDropDown;
-}
diff --git a/xfa/fwl/core/cfwl_evtpredropdown.h b/xfa/fwl/core/cfwl_evtpredropdown.h
deleted file mode 100644
index df4d29a..0000000
--- a/xfa/fwl/core/cfwl_evtpredropdown.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTPREDROPDOWN_H_
-#define XFA_FWL_CORE_CFWL_EVTPREDROPDOWN_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtPreDropDown : public CFWL_Event {
- public:
-  CFWL_EvtPreDropDown();
-  ~CFWL_EvtPreDropDown() override;
-
-  CFWL_EventType GetClassID() const override;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTPREDROPDOWN_H_
diff --git a/xfa/fwl/core/cfwl_evtscroll.cpp b/xfa/fwl/core/cfwl_evtscroll.cpp
index 37e5610..00ca57e 100644
--- a/xfa/fwl/core/cfwl_evtscroll.cpp
+++ b/xfa/fwl/core/cfwl_evtscroll.cpp
@@ -6,10 +6,7 @@
 
 #include "xfa/fwl/core/cfwl_evtscroll.h"
 
-CFWL_EvtScroll::CFWL_EvtScroll() {}
+CFWL_EvtScroll::CFWL_EvtScroll(CFWL_Widget* pSrcTarget)
+    : CFWL_Event(CFWL_Event::Type::Scroll, pSrcTarget) {}
 
 CFWL_EvtScroll::~CFWL_EvtScroll() {}
-
-CFWL_EventType CFWL_EvtScroll::GetClassID() const {
-  return CFWL_EventType::Scroll;
-}
diff --git a/xfa/fwl/core/cfwl_evtscroll.h b/xfa/fwl/core/cfwl_evtscroll.h
index d8da34e..64ee781 100644
--- a/xfa/fwl/core/cfwl_evtscroll.h
+++ b/xfa/fwl/core/cfwl_evtscroll.h
@@ -9,29 +9,26 @@
 
 #include "xfa/fwl/core/cfwl_event.h"
 
-enum class FWL_SCBCODE {
-  None = 1,
-  Min,
-  Max,
-  PageBackward,
-  PageForward,
-  StepBackward,
-  StepForward,
-  Pos,
-  TrackPos,
-  EndScroll,
-};
-
 class CFWL_EvtScroll : public CFWL_Event {
  public:
-  CFWL_EvtScroll();
+  enum class Code {
+    None = 1,
+    Min,
+    Max,
+    PageBackward,
+    PageForward,
+    StepBackward,
+    StepForward,
+    Pos,
+    TrackPos,
+    EndScroll,
+  };
+
+  explicit CFWL_EvtScroll(CFWL_Widget* pSrcTarget);
   ~CFWL_EvtScroll() override;
 
-  CFWL_EventType GetClassID() const override;
-
-  FWL_SCBCODE m_iScrollCode;
+  Code m_iScrollCode;
   FX_FLOAT m_fPos;
-  bool* m_pRet;
 };
 
 #endif  // XFA_FWL_CORE_CFWL_EVTSCROLL_H_
diff --git a/xfa/fwl/core/cfwl_evtselectchanged.cpp b/xfa/fwl/core/cfwl_evtselectchanged.cpp
index 3eead94..811fc94 100644
--- a/xfa/fwl/core/cfwl_evtselectchanged.cpp
+++ b/xfa/fwl/core/cfwl_evtselectchanged.cpp
@@ -6,10 +6,7 @@
 
 #include "xfa/fwl/core/cfwl_evtselectchanged.h"
 
-CFWL_EvtSelectChanged::CFWL_EvtSelectChanged() {}
+CFWL_EvtSelectChanged::CFWL_EvtSelectChanged(CFWL_Widget* pSrcTarget)
+    : CFWL_Event(CFWL_Event::Type::SelectChanged, pSrcTarget) {}
 
 CFWL_EvtSelectChanged::~CFWL_EvtSelectChanged() {}
-
-CFWL_EventType CFWL_EvtSelectChanged::GetClassID() const {
-  return CFWL_EventType::SelectChanged;
-}
diff --git a/xfa/fwl/core/cfwl_evtselectchanged.h b/xfa/fwl/core/cfwl_evtselectchanged.h
index f01b2aa..94381c7 100644
--- a/xfa/fwl/core/cfwl_evtselectchanged.h
+++ b/xfa/fwl/core/cfwl_evtselectchanged.h
@@ -11,11 +11,9 @@
 
 class CFWL_EvtSelectChanged : public CFWL_Event {
  public:
-  CFWL_EvtSelectChanged();
+  explicit CFWL_EvtSelectChanged(CFWL_Widget* pSrcTarget);
   ~CFWL_EvtSelectChanged() override;
 
-  CFWL_EventType GetClassID() const override;
-
   // Used by ComboBox.
   bool bLButtonUp;
 
diff --git a/xfa/fwl/core/cfwl_evtsetfocus.cpp b/xfa/fwl/core/cfwl_evtsetfocus.cpp
deleted file mode 100644
index def4c82..0000000
--- a/xfa/fwl/core/cfwl_evtsetfocus.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtsetfocus.h"
-
-CFWL_EvtSetFocus::CFWL_EvtSetFocus() {}
-
-CFWL_EvtSetFocus::~CFWL_EvtSetFocus() {}
-
-CFWL_EventType CFWL_EvtSetFocus::GetClassID() const {
-  return CFWL_EventType::SetFocus;
-}
diff --git a/xfa/fwl/core/cfwl_evtsetfocus.h b/xfa/fwl/core/cfwl_evtsetfocus.h
deleted file mode 100644
index 0232b59..0000000
--- a/xfa/fwl/core/cfwl_evtsetfocus.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTSETFOCUS_H_
-#define XFA_FWL_CORE_CFWL_EVTSETFOCUS_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtSetFocus : public CFWL_Event {
- public:
-  CFWL_EvtSetFocus();
-  ~CFWL_EvtSetFocus() override;
-
-  CFWL_EventType GetClassID() const override;
-
-  CFWL_Widget* m_pSetFocus;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTSETFOCUS_H_
diff --git a/xfa/fwl/core/cfwl_evtsizechanged.cpp b/xfa/fwl/core/cfwl_evtsizechanged.cpp
deleted file mode 100644
index efccde3..0000000
--- a/xfa/fwl/core/cfwl_evtsizechanged.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evtsizechanged.h"
-
-CFWL_EvtSizeChanged::CFWL_EvtSizeChanged() {}
-
-CFWL_EvtSizeChanged::~CFWL_EvtSizeChanged() {}
-
-CFWL_EventType CFWL_EvtSizeChanged::GetClassID() const {
-  return CFWL_EventType::SizeChanged;
-}
diff --git a/xfa/fwl/core/cfwl_evtsizechanged.h b/xfa/fwl/core/cfwl_evtsizechanged.h
deleted file mode 100644
index 33d5267..0000000
--- a/xfa/fwl/core/cfwl_evtsizechanged.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTSIZECHANGED_H_
-#define XFA_FWL_CORE_CFWL_EVTSIZECHANGED_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtSizeChanged : public CFWL_Event {
- public:
-  CFWL_EvtSizeChanged();
-  ~CFWL_EvtSizeChanged() override;
-
-  CFWL_EventType GetClassID() const override;
-
-  CFWL_Widget* m_pWidget;
-  CFX_RectF m_rtOld;
-  CFX_RectF m_rtNew;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTSIZECHANGED_H_
diff --git a/xfa/fwl/core/cfwl_evttextchanged.cpp b/xfa/fwl/core/cfwl_evttextchanged.cpp
index 76718be..d21dd03 100644
--- a/xfa/fwl/core/cfwl_evttextchanged.cpp
+++ b/xfa/fwl/core/cfwl_evttextchanged.cpp
@@ -6,10 +6,7 @@
 
 #include "xfa/fwl/core/cfwl_evttextchanged.h"
 
-CFWL_EvtTextChanged::CFWL_EvtTextChanged() {}
+CFWL_EvtTextChanged::CFWL_EvtTextChanged(CFWL_Widget* pSrcTarget)
+    : CFWL_Event(CFWL_Event::Type::TextChanged, pSrcTarget) {}
 
 CFWL_EvtTextChanged::~CFWL_EvtTextChanged() {}
-
-CFWL_EventType CFWL_EvtTextChanged::GetClassID() const {
-  return CFWL_EventType::TextChanged;
-}
diff --git a/xfa/fwl/core/cfwl_evttextchanged.h b/xfa/fwl/core/cfwl_evttextchanged.h
index 69d28bb..a2d0761 100644
--- a/xfa/fwl/core/cfwl_evttextchanged.h
+++ b/xfa/fwl/core/cfwl_evttextchanged.h
@@ -11,14 +11,9 @@
 
 class CFWL_EvtTextChanged : public CFWL_Event {
  public:
-  CFWL_EvtTextChanged();
+  explicit CFWL_EvtTextChanged(CFWL_Widget* pSrcTarget);
   ~CFWL_EvtTextChanged() override;
 
-  CFWL_EventType GetClassID() const override;
-
-  int32_t nChangeType;
-  CFX_WideString wsInsert;
-  CFX_WideString wsDelete;
   CFX_WideString wsPrevText;
 };
 
diff --git a/xfa/fwl/core/cfwl_evttextfull.cpp b/xfa/fwl/core/cfwl_evttextfull.cpp
deleted file mode 100644
index 4762f24..0000000
--- a/xfa/fwl/core/cfwl_evttextfull.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fwl/core/cfwl_evttextfull.h"
-
-CFWL_EvtTextFull::CFWL_EvtTextFull() {}
-
-CFWL_EvtTextFull::~CFWL_EvtTextFull() {}
-
-CFWL_EventType CFWL_EvtTextFull::GetClassID() const {
-  return CFWL_EventType::TextFull;
-}
diff --git a/xfa/fwl/core/cfwl_evttextfull.h b/xfa/fwl/core/cfwl_evttextfull.h
deleted file mode 100644
index 40fcd8a..0000000
--- a/xfa/fwl/core/cfwl_evttextfull.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FWL_CORE_CFWL_EVTTEXTFULL_H_
-#define XFA_FWL_CORE_CFWL_EVTTEXTFULL_H_
-
-#include "xfa/fwl/core/cfwl_event.h"
-
-class CFWL_EvtTextFull : public CFWL_Event {
- public:
-  CFWL_EvtTextFull();
-  ~CFWL_EvtTextFull() override;
-
-  CFWL_EventType GetClassID() const override;
-};
-
-#endif  // XFA_FWL_CORE_CFWL_EVTTEXTFULL_H_
diff --git a/xfa/fwl/core/cfwl_evtvalidate.cpp b/xfa/fwl/core/cfwl_evtvalidate.cpp
index 7b795f6..1f2b697 100644
--- a/xfa/fwl/core/cfwl_evtvalidate.cpp
+++ b/xfa/fwl/core/cfwl_evtvalidate.cpp
@@ -6,10 +6,7 @@
 
 #include "xfa/fwl/core/cfwl_evtvalidate.h"
 
-CFWL_EvtValidate::CFWL_EvtValidate() {}
+CFWL_EvtValidate::CFWL_EvtValidate(CFWL_Widget* pSrcTarget)
+    : CFWL_Event(CFWL_Event::Type::Validate, pSrcTarget) {}
 
 CFWL_EvtValidate::~CFWL_EvtValidate() {}
-
-CFWL_EventType CFWL_EvtValidate::GetClassID() const {
-  return CFWL_EventType::Validate;
-}
diff --git a/xfa/fwl/core/cfwl_evtvalidate.h b/xfa/fwl/core/cfwl_evtvalidate.h
index fae20b8..dbd5413 100644
--- a/xfa/fwl/core/cfwl_evtvalidate.h
+++ b/xfa/fwl/core/cfwl_evtvalidate.h
@@ -11,12 +11,9 @@
 
 class CFWL_EvtValidate : public CFWL_Event {
  public:
-  CFWL_EvtValidate();
+  explicit CFWL_EvtValidate(CFWL_Widget* pSrcTarget);
   ~CFWL_EvtValidate() override;
 
-  CFWL_EventType GetClassID() const override;
-
-  CFWL_Widget* pDstWidget;
   CFX_WideString wsInsert;
   bool bValidate;
 };
diff --git a/xfa/fwl/core/cfwl_form.cpp b/xfa/fwl/core/cfwl_form.cpp
index 4eec163..00d47d4 100644
--- a/xfa/fwl/core/cfwl_form.cpp
+++ b/xfa/fwl/core/cfwl_form.cpp
@@ -11,7 +11,7 @@
 #include "third_party/base/ptr_util.h"
 #include "xfa/fde/tto/fde_textout.h"
 #include "xfa/fwl/core/cfwl_app.h"
-#include "xfa/fwl/core/cfwl_evtclose.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_formproxy.h"
 #include "xfa/fwl/core/cfwl_msgmouse.h"
 #include "xfa/fwl/core/cfwl_notedriver.h"
@@ -487,8 +487,8 @@
   if (!pMessage)
     return;
 
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::Mouse: {
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -556,8 +556,7 @@
     }
     m_bMaximized = !m_bMaximized;
   } else if (pPressedBtn != m_pMinBox) {
-    CFWL_EvtClose eClose;
-    eClose.m_pSrcTarget = this;
+    CFWL_Event eClose(CFWL_Event::Type::Close, this);
     DispatchEvent(&eClose);
   }
 }
diff --git a/xfa/fwl/core/cfwl_listbox.cpp b/xfa/fwl/core/cfwl_listbox.cpp
index dff981f..be9e8b9 100644
--- a/xfa/fwl/core/cfwl_listbox.cpp
+++ b/xfa/fwl/core/cfwl_listbox.cpp
@@ -772,15 +772,14 @@
   if (!IsEnabled())
     return;
 
-  CFWL_MessageType dwMsgCode = pMessage->GetClassID();
-  switch (dwMsgCode) {
-    case CFWL_MessageType::SetFocus:
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus:
       OnFocusChanged(pMessage, true);
       break;
-    case CFWL_MessageType::KillFocus:
+    case CFWL_Message::Type::KillFocus:
       OnFocusChanged(pMessage, false);
       break;
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -794,10 +793,10 @@
       }
       break;
     }
-    case CFWL_MessageType::MouseWheel:
+    case CFWL_Message::Type::MouseWheel:
       OnMouseWheel(static_cast<CFWL_MsgMouseWheel*>(pMessage));
       break;
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       CFWL_MsgKey* pMsg = static_cast<CFWL_MsgKey*>(pMessage);
       if (pMsg->m_dwCmd == FWL_KeyCommand::KeyDown)
         OnKeyDown(pMsg);
@@ -812,7 +811,7 @@
 void CFWL_ListBox::OnProcessEvent(CFWL_Event* pEvent) {
   if (!pEvent)
     return;
-  if (pEvent->GetClassID() != CFWL_EventType::Scroll)
+  if (pEvent->GetType() != CFWL_Event::Type::Scroll)
     return;
 
   CFWL_Widget* pSrcTarget = pEvent->m_pSrcTarget;
@@ -949,50 +948,50 @@
 }
 
 bool CFWL_ListBox::OnScroll(CFWL_ScrollBar* pScrollBar,
-                            FWL_SCBCODE dwCode,
+                            CFWL_EvtScroll::Code dwCode,
                             FX_FLOAT fPos) {
   CFX_SizeF fs;
   pScrollBar->GetRange(&fs.x, &fs.y);
   FX_FLOAT iCurPos = pScrollBar->GetPos();
   FX_FLOAT fStep = pScrollBar->GetStepSize();
   switch (dwCode) {
-    case FWL_SCBCODE::Min: {
+    case CFWL_EvtScroll::Code::Min: {
       fPos = fs.x;
       break;
     }
-    case FWL_SCBCODE::Max: {
+    case CFWL_EvtScroll::Code::Max: {
       fPos = fs.y;
       break;
     }
-    case FWL_SCBCODE::StepBackward: {
+    case CFWL_EvtScroll::Code::StepBackward: {
       fPos -= fStep;
       if (fPos < fs.x + fStep / 2)
         fPos = fs.x;
       break;
     }
-    case FWL_SCBCODE::StepForward: {
+    case CFWL_EvtScroll::Code::StepForward: {
       fPos += fStep;
       if (fPos > fs.y - fStep / 2)
         fPos = fs.y;
       break;
     }
-    case FWL_SCBCODE::PageBackward: {
+    case CFWL_EvtScroll::Code::PageBackward: {
       fPos -= pScrollBar->GetPageSize();
       if (fPos < fs.x)
         fPos = fs.x;
       break;
     }
-    case FWL_SCBCODE::PageForward: {
+    case CFWL_EvtScroll::Code::PageForward: {
       fPos += pScrollBar->GetPageSize();
       if (fPos > fs.y)
         fPos = fs.y;
       break;
     }
-    case FWL_SCBCODE::Pos:
-    case FWL_SCBCODE::TrackPos:
-    case FWL_SCBCODE::None:
+    case CFWL_EvtScroll::Code::Pos:
+    case CFWL_EvtScroll::Code::TrackPos:
+    case CFWL_EvtScroll::Code::None:
       break;
-    case FWL_SCBCODE::EndScroll:
+    case CFWL_EvtScroll::Code::EndScroll:
       return false;
   }
   if (iCurPos != fPos) {
diff --git a/xfa/fwl/core/cfwl_listbox.h b/xfa/fwl/core/cfwl_listbox.h
index e30068b..d2f439e 100644
--- a/xfa/fwl/core/cfwl_listbox.h
+++ b/xfa/fwl/core/cfwl_listbox.h
@@ -148,7 +148,9 @@
   void OnMouseWheel(CFWL_MsgMouseWheel* pMsg);
   void OnKeyDown(CFWL_MsgKey* pMsg);
   void OnVK(CFWL_ListItem* hItem, bool bShift, bool bCtrl);
-  bool OnScroll(CFWL_ScrollBar* pScrollBar, FWL_SCBCODE dwCode, FX_FLOAT fPos);
+  bool OnScroll(CFWL_ScrollBar* pScrollBar,
+                CFWL_EvtScroll::Code dwCode,
+                FX_FLOAT fPos);
 
   CFX_RectF m_rtClient;
   CFX_RectF m_rtStatic;
diff --git a/xfa/fwl/core/cfwl_message.cpp b/xfa/fwl/core/cfwl_message.cpp
index e233900..b20cf0e 100644
--- a/xfa/fwl/core/cfwl_message.cpp
+++ b/xfa/fwl/core/cfwl_message.cpp
@@ -6,15 +6,22 @@
 
 #include "xfa/fwl/core/cfwl_message.h"
 
-CFWL_Message::CFWL_Message()
-    : m_pSrcTarget(nullptr), m_pDstTarget(nullptr), m_dwExtend(0) {}
+CFWL_Message::CFWL_Message(CFWL_Message::Type type)
+    : CFWL_Message(type, nullptr, nullptr) {}
+
+CFWL_Message::CFWL_Message(Type type, CFWL_Widget* pSrcTarget)
+    : CFWL_Message(type, pSrcTarget, nullptr) {}
+
+CFWL_Message::CFWL_Message(Type type,
+                           CFWL_Widget* pSrcTarget,
+                           CFWL_Widget* pDstTarget)
+    : m_pSrcTarget(pSrcTarget),
+      m_pDstTarget(pDstTarget),
+      m_dwExtend(0),
+      m_type(type) {}
 
 CFWL_Message::~CFWL_Message() {}
 
 std::unique_ptr<CFWL_Message> CFWL_Message::Clone() {
   return nullptr;
 }
-
-CFWL_MessageType CFWL_Message::GetClassID() const {
-  return CFWL_MessageType::None;
-}
diff --git a/xfa/fwl/core/cfwl_message.h b/xfa/fwl/core/cfwl_message.h
index 827b418..a1545b1 100644
--- a/xfa/fwl/core/cfwl_message.h
+++ b/xfa/fwl/core/cfwl_message.h
@@ -14,28 +14,26 @@
 #include "core/fxcrt/fx_system.h"
 #include "xfa/fwl/core/fwl_error.h"
 
-enum class CFWL_MessageType {
-  None = 0,
-  Key,
-  KillFocus,
-  Mouse,
-  MouseWheel,
-  SetFocus
-};
-
 class CFWL_Widget;
 
 class CFWL_Message {
  public:
-  CFWL_Message();
+  enum class Type { Key, KillFocus, Mouse, MouseWheel, SetFocus };
+
+  explicit CFWL_Message(Type type);
+  CFWL_Message(Type type, CFWL_Widget* pSrcTarget);
+  CFWL_Message(Type type, CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   virtual ~CFWL_Message();
 
   virtual std::unique_ptr<CFWL_Message> Clone();
-  virtual CFWL_MessageType GetClassID() const;
+  Type GetType() const { return m_type; }
 
   CFWL_Widget* m_pSrcTarget;
   CFWL_Widget* m_pDstTarget;
   uint32_t m_dwExtend;
+
+ private:
+  Type m_type;
 };
 
 
diff --git a/xfa/fwl/core/cfwl_monthcalendar.cpp b/xfa/fwl/core/cfwl_monthcalendar.cpp
index 9d22b13..a550d31 100644
--- a/xfa/fwl/core/cfwl_monthcalendar.cpp
+++ b/xfa/fwl/core/cfwl_monthcalendar.cpp
@@ -912,15 +912,14 @@
   if (!pMessage)
     return;
 
-  CFWL_MessageType dwMsgCode = pMessage->GetClassID();
-  switch (dwMsgCode) {
-    case CFWL_MessageType::SetFocus:
-    case CFWL_MessageType::KillFocus:
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus:
+    case CFWL_Message::Type::KillFocus:
       GetOuter()->GetDelegate()->OnProcessMessage(pMessage);
       break;
-    case CFWL_MessageType::Key:
+    case CFWL_Message::Type::Key:
       break;
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMouse = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMouse->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
diff --git a/xfa/fwl/core/cfwl_msgkey.cpp b/xfa/fwl/core/cfwl_msgkey.cpp
index 7d839f7..3eda29a 100644
--- a/xfa/fwl/core/cfwl_msgkey.cpp
+++ b/xfa/fwl/core/cfwl_msgkey.cpp
@@ -10,14 +10,11 @@
 
 #include "third_party/base/ptr_util.h"
 
-CFWL_MsgKey::CFWL_MsgKey() {}
+CFWL_MsgKey::CFWL_MsgKey(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget)
+    : CFWL_Message(CFWL_Message::Type::Key, pSrcTarget, pDstTarget) {}
 
 CFWL_MsgKey::~CFWL_MsgKey() {}
 
 std::unique_ptr<CFWL_Message> CFWL_MsgKey::Clone() {
   return pdfium::MakeUnique<CFWL_MsgKey>(*this);
 }
-
-CFWL_MessageType CFWL_MsgKey::GetClassID() const {
-  return CFWL_MessageType::Key;
-}
diff --git a/xfa/fwl/core/cfwl_msgkey.h b/xfa/fwl/core/cfwl_msgkey.h
index c7cd743..36089ea 100644
--- a/xfa/fwl/core/cfwl_msgkey.h
+++ b/xfa/fwl/core/cfwl_msgkey.h
@@ -15,12 +15,11 @@
 
 class CFWL_MsgKey : public CFWL_Message {
  public:
-  CFWL_MsgKey();
+  CFWL_MsgKey(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   ~CFWL_MsgKey() override;
 
   // CFWL_Message
   std::unique_ptr<CFWL_Message> Clone() override;
-  CFWL_MessageType GetClassID() const override;
 
   uint32_t m_dwKeyCode;
   uint32_t m_dwFlags;
diff --git a/xfa/fwl/core/cfwl_msgkillfocus.cpp b/xfa/fwl/core/cfwl_msgkillfocus.cpp
index 0c8ac47..c716485 100644
--- a/xfa/fwl/core/cfwl_msgkillfocus.cpp
+++ b/xfa/fwl/core/cfwl_msgkillfocus.cpp
@@ -10,14 +10,15 @@
 
 #include "third_party/base/ptr_util.h"
 
-CFWL_MsgKillFocus::CFWL_MsgKillFocus() {}
+CFWL_MsgKillFocus::CFWL_MsgKillFocus(CFWL_Widget* pSrcTarget)
+    : CFWL_MsgKillFocus(pSrcTarget, nullptr) {}
+
+CFWL_MsgKillFocus::CFWL_MsgKillFocus(CFWL_Widget* pSrcTarget,
+                                     CFWL_Widget* pDstTarget)
+    : CFWL_Message(CFWL_Message::Type::KillFocus, pSrcTarget, pDstTarget) {}
 
 CFWL_MsgKillFocus::~CFWL_MsgKillFocus() {}
 
 std::unique_ptr<CFWL_Message> CFWL_MsgKillFocus::Clone() {
   return pdfium::MakeUnique<CFWL_MsgKillFocus>(*this);
 }
-
-CFWL_MessageType CFWL_MsgKillFocus::GetClassID() const {
-  return CFWL_MessageType::KillFocus;
-}
diff --git a/xfa/fwl/core/cfwl_msgkillfocus.h b/xfa/fwl/core/cfwl_msgkillfocus.h
index ef68752..1c176b1 100644
--- a/xfa/fwl/core/cfwl_msgkillfocus.h
+++ b/xfa/fwl/core/cfwl_msgkillfocus.h
@@ -13,12 +13,12 @@
 
 class CFWL_MsgKillFocus : public CFWL_Message {
  public:
-  CFWL_MsgKillFocus();
+  explicit CFWL_MsgKillFocus(CFWL_Widget* pSrcTarget);
+  CFWL_MsgKillFocus(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   ~CFWL_MsgKillFocus() override;
 
   // CFWL_Message
   std::unique_ptr<CFWL_Message> Clone() override;
-  CFWL_MessageType GetClassID() const override;
 
   CFWL_Widget* m_pSetFocus;
 };
diff --git a/xfa/fwl/core/cfwl_msgmouse.cpp b/xfa/fwl/core/cfwl_msgmouse.cpp
index de2540d..f8a4e64 100644
--- a/xfa/fwl/core/cfwl_msgmouse.cpp
+++ b/xfa/fwl/core/cfwl_msgmouse.cpp
@@ -10,14 +10,11 @@
 
 #include "third_party/base/ptr_util.h"
 
-CFWL_MsgMouse::CFWL_MsgMouse() {}
+CFWL_MsgMouse::CFWL_MsgMouse(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget)
+    : CFWL_Message(CFWL_Message::Type::Mouse, pSrcTarget, pDstTarget) {}
 
 CFWL_MsgMouse::~CFWL_MsgMouse() {}
 
 std::unique_ptr<CFWL_Message> CFWL_MsgMouse::Clone() {
   return pdfium::MakeUnique<CFWL_MsgMouse>(*this);
 }
-
-CFWL_MessageType CFWL_MsgMouse::GetClassID() const {
-  return CFWL_MessageType::Mouse;
-}
diff --git a/xfa/fwl/core/cfwl_msgmouse.h b/xfa/fwl/core/cfwl_msgmouse.h
index 5a4054c..0765cbc 100644
--- a/xfa/fwl/core/cfwl_msgmouse.h
+++ b/xfa/fwl/core/cfwl_msgmouse.h
@@ -26,12 +26,11 @@
 
 class CFWL_MsgMouse : public CFWL_Message {
  public:
-  CFWL_MsgMouse();
+  CFWL_MsgMouse(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   ~CFWL_MsgMouse() override;
 
   // CFWL_Message
   std::unique_ptr<CFWL_Message> Clone() override;
-  CFWL_MessageType GetClassID() const override;
 
   FX_FLOAT m_fx;
   FX_FLOAT m_fy;
diff --git a/xfa/fwl/core/cfwl_msgmousewheel.cpp b/xfa/fwl/core/cfwl_msgmousewheel.cpp
index 739c431..02629ec 100644
--- a/xfa/fwl/core/cfwl_msgmousewheel.cpp
+++ b/xfa/fwl/core/cfwl_msgmousewheel.cpp
@@ -10,14 +10,12 @@
 
 #include "third_party/base/ptr_util.h"
 
-CFWL_MsgMouseWheel::CFWL_MsgMouseWheel() {}
+CFWL_MsgMouseWheel::CFWL_MsgMouseWheel(CFWL_Widget* pSrcTarget,
+                                       CFWL_Widget* pDstTarget)
+    : CFWL_Message(CFWL_Message::Type::MouseWheel, pSrcTarget, pDstTarget) {}
 
 CFWL_MsgMouseWheel::~CFWL_MsgMouseWheel() {}
 
 std::unique_ptr<CFWL_Message> CFWL_MsgMouseWheel::Clone() {
   return pdfium::MakeUnique<CFWL_MsgMouseWheel>(*this);
 }
-
-CFWL_MessageType CFWL_MsgMouseWheel::GetClassID() const {
-  return CFWL_MessageType::MouseWheel;
-}
diff --git a/xfa/fwl/core/cfwl_msgmousewheel.h b/xfa/fwl/core/cfwl_msgmousewheel.h
index 0768701..503bcde 100644
--- a/xfa/fwl/core/cfwl_msgmousewheel.h
+++ b/xfa/fwl/core/cfwl_msgmousewheel.h
@@ -13,12 +13,11 @@
 
 class CFWL_MsgMouseWheel : public CFWL_Message {
  public:
-  CFWL_MsgMouseWheel();
+  CFWL_MsgMouseWheel(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   ~CFWL_MsgMouseWheel() override;
 
   // CFWL_Message
   std::unique_ptr<CFWL_Message> Clone() override;
-  CFWL_MessageType GetClassID() const override;
 
   FX_FLOAT m_fx;
   FX_FLOAT m_fy;
diff --git a/xfa/fwl/core/cfwl_msgsetfocus.cpp b/xfa/fwl/core/cfwl_msgsetfocus.cpp
index 0463da1..82e9610 100644
--- a/xfa/fwl/core/cfwl_msgsetfocus.cpp
+++ b/xfa/fwl/core/cfwl_msgsetfocus.cpp
@@ -10,14 +10,12 @@
 
 #include "third_party/base/ptr_util.h"
 
-CFWL_MsgSetFocus::CFWL_MsgSetFocus() {}
+CFWL_MsgSetFocus::CFWL_MsgSetFocus(CFWL_Widget* pSrcTarget,
+                                   CFWL_Widget* pDstTarget)
+    : CFWL_Message(CFWL_Message::Type::SetFocus, pSrcTarget, pDstTarget) {}
 
 CFWL_MsgSetFocus::~CFWL_MsgSetFocus() {}
 
 std::unique_ptr<CFWL_Message> CFWL_MsgSetFocus::Clone() {
   return pdfium::MakeUnique<CFWL_MsgSetFocus>(*this);
 }
-
-CFWL_MessageType CFWL_MsgSetFocus::GetClassID() const {
-  return CFWL_MessageType::SetFocus;
-}
diff --git a/xfa/fwl/core/cfwl_msgsetfocus.h b/xfa/fwl/core/cfwl_msgsetfocus.h
index 42f14ed..628f7a6 100644
--- a/xfa/fwl/core/cfwl_msgsetfocus.h
+++ b/xfa/fwl/core/cfwl_msgsetfocus.h
@@ -13,14 +13,11 @@
 
 class CFWL_MsgSetFocus : public CFWL_Message {
  public:
-  CFWL_MsgSetFocus();
+  CFWL_MsgSetFocus(CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget);
   ~CFWL_MsgSetFocus() override;
 
   // CFWL_Message
   std::unique_ptr<CFWL_Message> Clone() override;
-  CFWL_MessageType GetClassID() const override;
-
-  CFWL_Widget* m_pKillFocus;
 };
 
 #endif  // XFA_FWL_CORE_CFWL_MSGSETFOCUS_H_
diff --git a/xfa/fwl/core/cfwl_notedriver.cpp b/xfa/fwl/core/cfwl_notedriver.cpp
index 06d8fd5..00a0b3e 100644
--- a/xfa/fwl/core/cfwl_notedriver.cpp
+++ b/xfa/fwl/core/cfwl_notedriver.cpp
@@ -91,9 +91,7 @@
   CFWL_Widget* pPrev = m_pFocus;
   m_pFocus = pFocus;
   if (pPrev) {
-    CFWL_MsgKillFocus ms;
-    ms.m_pDstTarget = pPrev;
-    ms.m_pSrcTarget = pPrev;
+    CFWL_MsgKillFocus ms(pPrev, pPrev);
     if (bNotify)
       ms.m_dwExtend = 1;
 
@@ -107,8 +105,7 @@
     if (pForm)
       pForm->SetSubFocus(pFocus);
 
-    CFWL_MsgSetFocus ms;
-    ms.m_pDstTarget = pFocus;
+    CFWL_MsgSetFocus ms(nullptr, pFocus);
     if (bNotify)
       ms.m_dwExtend = 1;
     if (IFWL_WidgetDelegate* pDelegate = pFocus->GetDelegate())
@@ -222,34 +219,34 @@
   if (!DispatchMessage(pMessage, pMessageForm))
     return;
 
-  if (pMessage->GetClassID() == CFWL_MessageType::Mouse)
+  if (pMessage->GetType() == CFWL_Message::Type::Mouse)
     MouseSecondary(pMessage);
 }
 
 bool CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
                                       CFWL_Widget* pMessageForm) {
-  switch (pMessage->GetClassID()) {
-    case CFWL_MessageType::SetFocus: {
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus: {
       if (!DoSetFocus(pMessage, pMessageForm))
         return false;
       break;
     }
-    case CFWL_MessageType::KillFocus: {
+    case CFWL_Message::Type::KillFocus: {
       if (!DoKillFocus(pMessage, pMessageForm))
         return false;
       break;
     }
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       if (!DoKey(pMessage, pMessageForm))
         return false;
       break;
     }
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       if (!DoMouse(pMessage, pMessageForm))
         return false;
       break;
     }
-    case CFWL_MessageType::MouseWheel: {
+    case CFWL_Message::Type::MouseWheel: {
       if (!DoWheel(pMessage, pMessageForm))
         return false;
       break;
@@ -416,8 +413,7 @@
 
   CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
   if (m_pHover) {
-    CFWL_MsgMouse msLeave;
-    msLeave.m_pDstTarget = m_pHover;
+    CFWL_MsgMouse msLeave(nullptr, m_pHover);
     msLeave.m_fx = pMsg->m_fx;
     msLeave.m_fy = pMsg->m_fy;
     pTarget->TransformTo(m_pHover, msLeave.m_fx, msLeave.m_fy);
@@ -432,8 +428,7 @@
   }
   m_pHover = pTarget;
 
-  CFWL_MsgMouse msHover;
-  msHover.m_pDstTarget = pTarget;
+  CFWL_MsgMouse msHover(nullptr, pTarget);
   msHover.m_fx = pMsg->m_fx;
   msHover.m_fy = pMsg->m_fy;
   msHover.m_dwFlags = 0;
diff --git a/xfa/fwl/core/cfwl_pushbutton.cpp b/xfa/fwl/core/cfwl_pushbutton.cpp
index 15e98fc..295de1e 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"
@@ -174,15 +174,14 @@
   if (!IsEnabled())
     return;
 
-  CFWL_MessageType dwMsgCode = pMessage->GetClassID();
-  switch (dwMsgCode) {
-    case CFWL_MessageType::SetFocus:
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus:
       OnFocusChanged(pMessage, true);
       break;
-    case CFWL_MessageType::KillFocus:
+    case CFWL_Message::Type::KillFocus:
       OnFocusChanged(pMessage, false);
       break;
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -202,7 +201,7 @@
       }
       break;
     }
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
       if (pKey->m_dwCmd == FWL_KeyCommand::KeyDown)
         OnKeyDown(pKey);
@@ -248,8 +247,7 @@
     m_pProperties->m_dwStates &= ~FWL_STATE_PSB_Pressed;
   }
   if (m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
-    CFWL_EvtClick wmClick;
-    wmClick.m_pSrcTarget = this;
+    CFWL_Event wmClick(CFWL_Event::Type::Click, this);
     DispatchEvent(&wmClick);
   }
   Repaint(&m_rtClient);
@@ -297,18 +295,13 @@
 }
 
 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(this);
+  wmMouse.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
+  DispatchEvent(&wmMouse);
+
+  CFWL_Event wmClick(CFWL_Event::Type::Click, this);
+  DispatchEvent(&wmClick);
 }
diff --git a/xfa/fwl/core/cfwl_scrollbar.cpp b/xfa/fwl/core/cfwl_scrollbar.cpp
index 6647350..4909404 100644
--- a/xfa/fwl/core/cfwl_scrollbar.cpp
+++ b/xfa/fwl/core/cfwl_scrollbar.cpp
@@ -115,8 +115,8 @@
   CalcMaxTrackRect(m_rtMaxTrack);
 }
 
-bool CFWL_ScrollBar::DoScroll(FWL_SCBCODE dwCode, FX_FLOAT fPos) {
-  if (dwCode == FWL_SCBCODE::None)
+bool CFWL_ScrollBar::DoScroll(CFWL_EvtScroll::Code dwCode, FX_FLOAT fPos) {
+  if (dwCode == CFWL_EvtScroll::Code::None)
     return false;
   return OnScroll(dwCode, fPos);
 }
@@ -351,46 +351,44 @@
 
 bool CFWL_ScrollBar::SendEvent() {
   if (m_iMinButtonState == CFWL_PartState_Pressed) {
-    DoScroll(FWL_SCBCODE::StepBackward, m_fTrackPos);
+    DoScroll(CFWL_EvtScroll::Code::StepBackward, m_fTrackPos);
     return false;
   }
   if (m_iMaxButtonState == CFWL_PartState_Pressed) {
-    DoScroll(FWL_SCBCODE::StepForward, m_fTrackPos);
+    DoScroll(CFWL_EvtScroll::Code::StepForward, m_fTrackPos);
     return false;
   }
   if (m_iMinTrackState == CFWL_PartState_Pressed) {
-    DoScroll(FWL_SCBCODE::PageBackward, m_fTrackPos);
+    DoScroll(CFWL_EvtScroll::Code::PageBackward, m_fTrackPos);
     return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY);
   }
   if (m_iMaxTrackState == CFWL_PartState_Pressed) {
-    DoScroll(FWL_SCBCODE::PageForward, m_fTrackPos);
+    DoScroll(CFWL_EvtScroll::Code::PageForward, m_fTrackPos);
     return m_rtThumb.Contains(m_cpTrackPointX, m_cpTrackPointY);
   }
   if (m_iMouseWheel) {
-    FWL_SCBCODE dwCode = m_iMouseWheel < 0 ? FWL_SCBCODE::StepForward
-                                           : FWL_SCBCODE::StepBackward;
+    CFWL_EvtScroll::Code dwCode = m_iMouseWheel < 0
+                                      ? CFWL_EvtScroll::Code::StepForward
+                                      : CFWL_EvtScroll::Code::StepBackward;
     DoScroll(dwCode, m_fTrackPos);
   }
   return true;
 }
 
-bool CFWL_ScrollBar::OnScroll(FWL_SCBCODE dwCode, FX_FLOAT fPos) {
-  bool bRet = true;
-  CFWL_EvtScroll ev;
+bool CFWL_ScrollBar::OnScroll(CFWL_EvtScroll::Code dwCode, FX_FLOAT fPos) {
+  CFWL_EvtScroll ev(this);
   ev.m_iScrollCode = dwCode;
-  ev.m_pSrcTarget = this;
   ev.m_fPos = fPos;
-  ev.m_pRet = &bRet;
   DispatchEvent(&ev);
-  return bRet;
+  return true;
 }
 
 void CFWL_ScrollBar::OnProcessMessage(CFWL_Message* pMessage) {
   if (!pMessage)
     return;
 
-  CFWL_MessageType dwMsgCode = pMessage->GetClassID();
-  if (dwMsgCode == CFWL_MessageType::Mouse) {
+  CFWL_Message::Type type = pMessage->GetType();
+  if (type == CFWL_Message::Type::Mouse) {
     CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
     switch (pMsg->m_dwCmd) {
       case FWL_MouseCommand::LeftButtonDown:
@@ -408,7 +406,7 @@
       default:
         break;
     }
-  } else if (dwMsgCode == CFWL_MessageType::MouseWheel) {
+  } else if (type == CFWL_Message::Type::MouseWheel) {
     CFWL_MsgMouseWheel* pMsg = static_cast<CFWL_MsgMouseWheel*>(pMessage);
     OnMouseWheel(pMsg->m_fx, pMsg->m_fy, pMsg->m_dwFlags, pMsg->m_fDeltaX,
                  pMsg->m_fDeltaY);
@@ -507,7 +505,7 @@
 
   iState = iNewState;
   Repaint(&rtItem);
-  OnScroll(FWL_SCBCODE::EndScroll, m_fTrackPos);
+  OnScroll(CFWL_EvtScroll::Code::EndScroll, m_fTrackPos);
 }
 
 void CFWL_ScrollBar::DoMouseMove(int32_t iItem,
@@ -526,7 +524,7 @@
   } else if ((2 == iItem) && (m_iThumbButtonState == CFWL_PartState_Pressed)) {
     FX_FLOAT fPos = GetTrackPointPos(fx, fy);
     m_fTrackPos = fPos;
-    OnScroll(FWL_SCBCODE::TrackPos, fPos);
+    OnScroll(CFWL_EvtScroll::Code::TrackPos, fPos);
   }
 }
 
diff --git a/xfa/fwl/core/cfwl_scrollbar.h b/xfa/fwl/core/cfwl_scrollbar.h
index 800df51..98bcaf2 100644
--- a/xfa/fwl/core/cfwl_scrollbar.h
+++ b/xfa/fwl/core/cfwl_scrollbar.h
@@ -89,7 +89,7 @@
   FX_FLOAT GetTrackPointPos(FX_FLOAT fx, FX_FLOAT fy);
   void GetTrackRect(CFX_RectF& rect, bool bLower = true);
   bool SendEvent();
-  bool OnScroll(FWL_SCBCODE dwCode, FX_FLOAT fPos);
+  bool OnScroll(CFWL_EvtScroll::Code dwCode, FX_FLOAT fPos);
   void OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
   void OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
   void OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
@@ -99,7 +99,7 @@
                     uint32_t dwFlags,
                     FX_FLOAT fDeltaX,
                     FX_FLOAT fDeltaY);
-  bool DoScroll(FWL_SCBCODE dwCode, FX_FLOAT fPos = 0.0f);
+  bool DoScroll(CFWL_EvtScroll::Code dwCode, FX_FLOAT fPos = 0.0f);
   void DoMouseDown(int32_t iItem,
                    const CFX_RectF& rtItem,
                    int32_t& iState,
diff --git a/xfa/fwl/core/cfwl_spinbutton.cpp b/xfa/fwl/core/cfwl_spinbutton.cpp
index 71ed3b0..e66b92e 100644
--- a/xfa/fwl/core/cfwl_spinbutton.cpp
+++ b/xfa/fwl/core/cfwl_spinbutton.cpp
@@ -10,7 +10,7 @@
 #include <utility>
 
 #include "third_party/base/ptr_util.h"
-#include "xfa/fwl/core/cfwl_evtclick.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_msgkey.h"
 #include "xfa/fwl/core/cfwl_msgmouse.h"
 #include "xfa/fwl/core/cfwl_notedriver.h"
@@ -161,17 +161,16 @@
   if (!pMessage)
     return;
 
-  CFWL_MessageType dwMsgCode = pMessage->GetClassID();
-  switch (dwMsgCode) {
-    case CFWL_MessageType::SetFocus: {
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::SetFocus: {
       OnFocusChanged(pMessage, true);
       break;
     }
-    case CFWL_MessageType::KillFocus: {
+    case CFWL_Message::Type::KillFocus: {
       OnFocusChanged(pMessage, false);
       break;
     }
-    case CFWL_MessageType::Mouse: {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
       switch (pMsg->m_dwCmd) {
         case FWL_MouseCommand::LeftButtonDown:
@@ -191,7 +190,7 @@
       }
       break;
     }
-    case CFWL_MessageType::Key: {
+    case CFWL_Message::Type::Key: {
       CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
       if (pKey->m_dwCmd == FWL_KeyCommand::KeyDown)
         OnKeyDown(pKey);
@@ -237,8 +236,7 @@
     m_dwDnState = CFWL_PartState_Pressed;
   }
 
-  CFWL_EvtClick wmPosChanged;
-  wmPosChanged.m_pSrcTarget = this;
+  CFWL_Event wmPosChanged(CFWL_Event::Type::Click, this);
   DispatchEvent(&wmPosChanged);
 
   Repaint(bUpPress ? &m_rtUpButton : &m_rtDnButton);
@@ -359,8 +357,7 @@
   if (!bUpEnable && !bDownEnable)
     return;
 
-  CFWL_EvtClick wmPosChanged;
-  wmPosChanged.m_pSrcTarget = this;
+  CFWL_Event wmPosChanged(CFWL_Event::Type::Click, this);
   DispatchEvent(&wmPosChanged);
 
   Repaint(bUpEnable ? &m_rtUpButton : &m_rtDnButton);
@@ -375,7 +372,6 @@
   if (!pButton->m_pTimerInfo)
     return;
 
-  CFWL_EvtClick wmPosChanged;
-  wmPosChanged.m_pSrcTarget = pButton;
+  CFWL_Event wmPosChanged(CFWL_Event::Type::Click, pButton);
   pButton->DispatchEvent(&wmPosChanged);
 }
diff --git a/xfa/fwl/core/cfwl_spinbutton.h b/xfa/fwl/core/cfwl_spinbutton.h
index 6b53e68..391d55c 100644
--- a/xfa/fwl/core/cfwl_spinbutton.h
+++ b/xfa/fwl/core/cfwl_spinbutton.h
@@ -9,7 +9,6 @@
 
 #include <memory>
 
-#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_timer.h"
 #include "xfa/fwl/core/cfwl_widget.h"
 #include "xfa/fxfa/cxfa_eventparam.h"
@@ -33,7 +32,6 @@
   void DrawWidget(CFX_Graphics* pGraphics,
                   const CFX_Matrix* pMatrix = nullptr) override;
   void OnProcessMessage(CFWL_Message* pMessage) override;
-  void OnProcessEvent(CFWL_Event* pEvent) override;
   void OnDrawWidget(CFX_Graphics* pGraphics,
                     const CFX_Matrix* pMatrix) override;
 
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp
index e2de866..d487aad 100644
--- a/xfa/fwl/core/cfwl_widget.cpp
+++ b/xfa/fwl/core/cfwl_widget.cpp
@@ -12,12 +12,8 @@
 #include "xfa/fde/tto/fde_textout.h"
 #include "xfa/fwl/core/cfwl_app.h"
 #include "xfa/fwl/core/cfwl_combobox.h"
-#include "xfa/fwl/core/cfwl_evtkey.h"
-#include "xfa/fwl/core/cfwl_evtkillfocus.h"
+#include "xfa/fwl/core/cfwl_event.h"
 #include "xfa/fwl/core/cfwl_evtmouse.h"
-#include "xfa/fwl/core/cfwl_evtmousewheel.h"
-#include "xfa/fwl/core/cfwl_evtsetfocus.h"
-#include "xfa/fwl/core/cfwl_evtsizechanged.h"
 #include "xfa/fwl/core/cfwl_form.h"
 #include "xfa/fwl/core/cfwl_msgkey.h"
 #include "xfa/fwl/core/cfwl_msgkillfocus.h"
@@ -86,21 +82,10 @@
 }
 
 void CFWL_Widget::SetWidgetRect(const CFX_RectF& rect) {
-  CFX_RectF rtOld = m_pProperties->m_rtWidget;
   m_pProperties->m_rtWidget = rect;
-  if (IsChild()) {
-    if (FXSYS_fabs(rtOld.width - rect.width) > 0.5f ||
-        FXSYS_fabs(rtOld.height - rect.height) > 0.5f) {
-      CFWL_EvtSizeChanged ev;
-      ev.m_pSrcTarget = this;
-      ev.m_rtOld = rtOld;
-      ev.m_rtNew = rect;
-
-      if (IFWL_WidgetDelegate* pDelegate = GetDelegate())
-        pDelegate->OnProcessEvent(&ev);
-    }
+  if (IsChild())
     return;
-  }
+
   m_pWidgetMgr->SetWidgetRect_Native(this, rect);
 }
 
@@ -598,18 +583,6 @@
   pNoteDriver->UnregisterEventTarget(this);
 }
 
-void CFWL_Widget::DispatchKeyEvent(CFWL_MsgKey* pNote) {
-  if (!pNote)
-    return;
-
-  auto pEvent = pdfium::MakeUnique<CFWL_EvtKey>();
-  pEvent->m_pSrcTarget = this;
-  pEvent->m_dwCmd = pNote->m_dwCmd;
-  pEvent->m_dwKeyCode = pNote->m_dwKeyCode;
-  pEvent->m_dwFlags = pNote->m_dwFlags;
-  DispatchEvent(pEvent.get());
-}
-
 void CFWL_Widget::DispatchEvent(CFWL_Event* pEvent) {
   if (m_pOuter) {
     m_pOuter->GetDelegate()->OnProcessEvent(pEvent);
@@ -733,61 +706,12 @@
     return;
 
   CFWL_Widget* pWidget = pMessage->m_pDstTarget;
-  CFWL_MessageType dwMsgCode = pMessage->GetClassID();
-  switch (dwMsgCode) {
-    case CFWL_MessageType::Mouse: {
+  switch (pMessage->GetType()) {
+    case CFWL_Message::Type::Mouse: {
       CFWL_MsgMouse* pMsgMouse = static_cast<CFWL_MsgMouse*>(pMessage);
-      CFWL_EvtMouse evt;
-      evt.m_pSrcTarget = pWidget;
-      evt.m_pDstTarget = pWidget;
+
+      CFWL_EvtMouse evt(pWidget, pWidget);
       evt.m_dwCmd = pMsgMouse->m_dwCmd;
-      evt.m_dwFlags = pMsgMouse->m_dwFlags;
-      evt.m_fx = pMsgMouse->m_fx;
-      evt.m_fy = pMsgMouse->m_fy;
-      pWidget->DispatchEvent(&evt);
-      break;
-    }
-    case CFWL_MessageType::MouseWheel: {
-      CFWL_MsgMouseWheel* pMsgMouseWheel =
-          static_cast<CFWL_MsgMouseWheel*>(pMessage);
-      CFWL_EvtMouseWheel evt;
-      evt.m_pSrcTarget = pWidget;
-      evt.m_pDstTarget = pWidget;
-      evt.m_dwFlags = pMsgMouseWheel->m_dwFlags;
-      evt.m_fDeltaX = pMsgMouseWheel->m_fDeltaX;
-      evt.m_fDeltaY = pMsgMouseWheel->m_fDeltaY;
-      evt.m_fx = pMsgMouseWheel->m_fx;
-      evt.m_fy = pMsgMouseWheel->m_fy;
-      pWidget->DispatchEvent(&evt);
-      break;
-    }
-    case CFWL_MessageType::Key: {
-      CFWL_MsgKey* pMsgKey = static_cast<CFWL_MsgKey*>(pMessage);
-      CFWL_EvtKey evt;
-      evt.m_pSrcTarget = pWidget;
-      evt.m_pDstTarget = pWidget;
-      evt.m_dwKeyCode = pMsgKey->m_dwKeyCode;
-      evt.m_dwFlags = pMsgKey->m_dwFlags;
-      evt.m_dwCmd = pMsgKey->m_dwCmd;
-      pWidget->DispatchEvent(&evt);
-      break;
-    }
-    case CFWL_MessageType::SetFocus: {
-      CFWL_MsgSetFocus* pMsgSetFocus = static_cast<CFWL_MsgSetFocus*>(pMessage);
-      CFWL_EvtSetFocus evt;
-      evt.m_pSrcTarget = pMsgSetFocus->m_pDstTarget;
-      evt.m_pDstTarget = pMsgSetFocus->m_pDstTarget;
-      evt.m_pSetFocus = pWidget;
-      pWidget->DispatchEvent(&evt);
-      break;
-    }
-    case CFWL_MessageType::KillFocus: {
-      CFWL_MsgKillFocus* pMsgKillFocus =
-          static_cast<CFWL_MsgKillFocus*>(pMessage);
-      CFWL_EvtKillFocus evt;
-      evt.m_pSrcTarget = pMsgKillFocus->m_pDstTarget;
-      evt.m_pDstTarget = pMsgKillFocus->m_pDstTarget;
-      evt.m_pKillFocus = pWidget;
       pWidget->DispatchEvent(&evt);
       break;
     }
diff --git a/xfa/fwl/core/cfwl_widget.h b/xfa/fwl/core/cfwl_widget.h
index 7a993e5..5e9660c 100644
--- a/xfa/fwl/core/cfwl_widget.h
+++ b/xfa/fwl/core/cfwl_widget.h
@@ -140,7 +140,6 @@
                    CFX_RectF& rtPopup);
   void RegisterEventTarget(CFWL_Widget* pEventSource);
   void UnregisterEventTarget();
-  void DispatchKeyEvent(CFWL_MsgKey* pNote);
   void DispatchEvent(CFWL_Event* pEvent);
   void DrawBorder(CFX_Graphics* pGraphics,
                   CFWL_Part iPartBorder,
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index 06e3b2c..dab6b2c 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -246,13 +246,12 @@
     return false;
 
   SetButtonDown(false);
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -300,8 +299,8 @@
 
 void CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
   CXFA_FFField::OnProcessEvent(pEvent);
-  switch (pEvent->GetClassID()) {
-    case CFWL_EventType::CheckStateChanged: {
+  switch (pEvent->GetType()) {
+    case CFWL_Event::Type::CheckStateChanged: {
       CXFA_EventParam eParam;
       eParam.m_eType = XFA_EVENT_Change;
       m_pDataAcc->GetValue(eParam.m_wsNewText, XFA_VALUEPICTURE_Raw);
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index c9a5136..d4cfe07 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -196,8 +196,8 @@
 
 void CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) {
   CXFA_FFField::OnProcessEvent(pEvent);
-  switch (pEvent->GetClassID()) {
-    case CFWL_EventType::SelectChanged: {
+  switch (pEvent->GetType()) {
+    case CFWL_Event::Type::SelectChanged: {
       CFX_Int32Array arrSels;
       OnSelectChanged(m_pNormalWidget, arrSels);
       break;
@@ -510,23 +510,23 @@
 
 void CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) {
   CXFA_FFField::OnProcessEvent(pEvent);
-  switch (pEvent->GetClassID()) {
-    case CFWL_EventType::SelectChanged: {
+  switch (pEvent->GetType()) {
+    case CFWL_Event::Type::SelectChanged: {
       CFWL_EvtSelectChanged* postEvent =
           static_cast<CFWL_EvtSelectChanged*>(pEvent);
       OnSelectChanged(m_pNormalWidget, postEvent->bLButtonUp);
       break;
     }
-    case CFWL_EventType::EditChanged: {
+    case CFWL_Event::Type::EditChanged: {
       CFX_WideString wsChanged;
       OnTextChanged(m_pNormalWidget, wsChanged);
       break;
     }
-    case CFWL_EventType::PreDropDown: {
+    case CFWL_Event::Type::PreDropDown: {
       OnPreOpen(m_pNormalWidget);
       break;
     }
-    case CFWL_EventType::PostDropDown: {
+    case CFWL_Event::Type::PostDropDown: {
       OnPostOpen(m_pNormalWidget);
       break;
     }
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index 43efb5e..689a0b5 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -349,10 +349,8 @@
   if (!m_pNormalWidget) {
     return false;
   }
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::Enter;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -360,9 +358,8 @@
   if (!m_pNormalWidget) {
     return false;
   }
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::Leave;
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -387,13 +384,12 @@
     return false;
   }
   SetButtonDown(true);
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -405,13 +401,12 @@
     return false;
   }
   SetButtonDown(false);
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::LeftButtonUp;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -419,13 +414,12 @@
   if (!m_pNormalWidget) {
     return false;
   }
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::LeftButtonDblClk;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -433,13 +427,12 @@
   if (!m_pNormalWidget) {
     return false;
   }
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::Move;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -450,14 +443,13 @@
   if (!m_pNormalWidget) {
     return false;
   }
-  CFWL_MsgMouseWheel ms;
+  CFWL_MsgMouseWheel ms(nullptr, m_pNormalWidget);
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
   ms.m_fDeltaX = zDelta;
   ms.m_fDeltaY = 0;
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -473,13 +465,13 @@
     return false;
   }
   SetButtonDown(true);
-  CFWL_MsgMouse ms;
+
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::RightButtonDown;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -491,13 +483,12 @@
     return false;
   }
   SetButtonDown(false);
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::RightButtonUp;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -505,13 +496,12 @@
   if (!m_pNormalWidget) {
     return false;
   }
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::RightButtonDblClk;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
   FWLToClient(ms.m_fx, ms.m_fy);
-  ms.m_pDstTarget = m_pNormalWidget;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -521,9 +511,7 @@
   if (!m_pNormalWidget) {
     return false;
   }
-  CFWL_MsgSetFocus ms;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
+  CFWL_MsgSetFocus ms(nullptr, m_pNormalWidget);
   TranslateFWLMessage(&ms);
   m_dwStatus |= XFA_WidgetStatus_Focused;
   AddInvalidateRect();
@@ -533,9 +521,7 @@
   if (!m_pNormalWidget) {
     return CXFA_FFWidget::OnKillFocus(pNewWidget);
   }
-  CFWL_MsgKillFocus ms;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
+  CFWL_MsgKillFocus ms(nullptr, m_pNormalWidget);
   TranslateFWLMessage(&ms);
   m_dwStatus &= ~XFA_WidgetStatus_Focused;
   AddInvalidateRect();
@@ -546,12 +532,10 @@
   if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
     return false;
   }
-  CFWL_MsgKey ms;
+  CFWL_MsgKey ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_KeyCommand::KeyDown;
   ms.m_dwFlags = dwFlags;
   ms.m_dwKeyCode = dwKeyCode;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -559,12 +543,10 @@
   if (!m_pNormalWidget || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
     return false;
   }
-  CFWL_MsgKey ms;
+  CFWL_MsgKey ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_KeyCommand::KeyUp;
   ms.m_dwFlags = dwFlags;
   ms.m_dwKeyCode = dwKeyCode;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -581,12 +563,10 @@
   if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) {
     return false;
   }
-  CFWL_MsgKey ms;
+  CFWL_MsgKey ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_KeyCommand::Char;
   ms.m_dwFlags = dwFlags;
   ms.m_dwKeyCode = dwChar;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
   TranslateFWLMessage(&ms);
   return true;
 }
@@ -779,8 +759,8 @@
 void CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) {}
 
 void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
-  switch (pEvent->GetClassID()) {
-    case CFWL_EventType::Mouse: {
+  switch (pEvent->GetType()) {
+    case CFWL_Event::Type::Mouse: {
       CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent;
       if (event->m_dwCmd == FWL_MouseCommand::Enter) {
         CXFA_EventParam eParam;
@@ -805,7 +785,7 @@
       }
       break;
     }
-    case CFWL_EventType::Click: {
+    case CFWL_Event::Type::Click: {
       CXFA_EventParam eParam;
       eParam.m_eType = XFA_EVENT_Click;
       eParam.m_pTarget = m_pDataAcc;
diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp
index 318a772..3506cc9 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.cpp
+++ b/xfa/fxfa/app/xfa_ffimageedit.cpp
@@ -93,12 +93,12 @@
     return false;
 
   SetButtonDown(true);
-  CFWL_MsgMouse ms;
+
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
-  ms.m_pDstTarget = m_pNormalWidget;
   FWLToClient(ms.m_fx, ms.m_fy);
   TranslateFWLMessage(&ms);
   return true;
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index a070f90..89c323c 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -117,12 +117,11 @@
     AddInvalidateRect();
   }
   SetButtonDown(true);
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, m_pNormalWidget);
   ms.m_dwCmd = FWL_MouseCommand::LeftButtonDown;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
   ms.m_fy = fy;
-  ms.m_pDstTarget = m_pNormalWidget;
   FWLToClient(ms.m_fx, ms.m_fy);
   TranslateFWLMessage(&ms);
   return true;
@@ -142,7 +141,7 @@
     AddInvalidateRect();
   }
   SetButtonDown(true);
-  CFWL_MsgMouse ms;
+  CFWL_MsgMouse ms(nullptr, nullptr);
   ms.m_dwCmd = FWL_MouseCommand::RightButtonDown;
   ms.m_dwFlags = dwFlags;
   ms.m_fx = fx;
@@ -166,16 +165,12 @@
     AddInvalidateRect();
   }
   CXFA_FFWidget::OnSetFocus(pOldWidget);
-  CFWL_MsgSetFocus ms;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
+  CFWL_MsgSetFocus ms(nullptr, m_pNormalWidget);
   TranslateFWLMessage(&ms);
   return true;
 }
 bool CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) {
-  CFWL_MsgKillFocus ms;
-  ms.m_pDstTarget = m_pNormalWidget;
-  ms.m_pSrcTarget = nullptr;
+  CFWL_MsgKillFocus ms(nullptr, m_pNormalWidget);
   TranslateFWLMessage(&ms);
   m_dwStatus &= ~XFA_WidgetStatus_Focused;
   SetEditScrollOffset();
@@ -338,18 +333,18 @@
 
 void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) {
   CXFA_FFField::OnProcessEvent(pEvent);
-  switch (pEvent->GetClassID()) {
-    case CFWL_EventType::TextChanged: {
+  switch (pEvent->GetType()) {
+    case CFWL_Event::Type::TextChanged: {
       CFWL_EvtTextChanged* event = static_cast<CFWL_EvtTextChanged*>(pEvent);
       CFX_WideString wsChange;
       OnTextChanged(m_pNormalWidget, wsChange, event->wsPrevText);
       break;
     }
-    case CFWL_EventType::TextFull: {
+    case CFWL_Event::Type::TextFull: {
       OnTextFull(m_pNormalWidget);
       break;
     }
-    case CFWL_EventType::CheckWord: {
+    case CFWL_Event::Type::CheckWord: {
       CFX_WideString wstr(L"FWL_EVENT_DTP_SelectChanged");
       CFWL_EvtCheckWord* event = static_cast<CFWL_EvtCheckWord*>(pEvent);
       event->bCheckWord = CheckWord(event->bsWord.AsStringC());
@@ -418,7 +413,7 @@
 }
 
 void CXFA_FFNumericEdit::OnProcessEvent(CFWL_Event* pEvent) {
-  if (pEvent->GetClassID() == CFWL_EventType::Validate) {
+  if (pEvent->GetType() == CFWL_Event::Type::Validate) {
     CFWL_EvtValidate* event = static_cast<CFWL_EvtValidate*>(pEvent);
     event->bValidate = OnValidate(m_pNormalWidget, event->wsInsert);
     return;
@@ -683,7 +678,7 @@
 }
 
 void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) {
-  if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) {
+  if (pEvent->GetType() == CFWL_Event::Type::SelectChanged) {
     CFWL_EvtSelectChanged* event = static_cast<CFWL_EvtSelectChanged*>(pEvent);
     OnSelectChanged(m_pNormalWidget, event->iYear, event->iMonth, event->iDay);
     return;