Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
dsinclair | 447b1f3 | 2016-12-08 10:06:32 -0800 | [diff] [blame] | 7 | #include "xfa/fwl/cfwl_widget.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 8 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 9 | #include <algorithm> |
| 10 | #include <utility> |
Tom Sepez | 576e815 | 2017-01-30 14:26:24 -0800 | [diff] [blame] | 11 | #include <vector> |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 12 | |
Tom Sepez | 576e815 | 2017-01-30 14:26:24 -0800 | [diff] [blame] | 13 | #include "third_party/base/stl_util.h" |
Dan Sinclair | bccf573 | 2017-03-30 14:10:32 -0400 | [diff] [blame] | 14 | #include "xfa/fde/cfde_textout.h" |
dsinclair | 447b1f3 | 2016-12-08 10:06:32 -0800 | [diff] [blame] | 15 | #include "xfa/fwl/cfwl_app.h" |
| 16 | #include "xfa/fwl/cfwl_combobox.h" |
| 17 | #include "xfa/fwl/cfwl_event.h" |
| 18 | #include "xfa/fwl/cfwl_eventmouse.h" |
| 19 | #include "xfa/fwl/cfwl_form.h" |
| 20 | #include "xfa/fwl/cfwl_messagekey.h" |
| 21 | #include "xfa/fwl/cfwl_messagekillfocus.h" |
| 22 | #include "xfa/fwl/cfwl_messagemouse.h" |
| 23 | #include "xfa/fwl/cfwl_messagemousewheel.h" |
| 24 | #include "xfa/fwl/cfwl_messagesetfocus.h" |
| 25 | #include "xfa/fwl/cfwl_notedriver.h" |
| 26 | #include "xfa/fwl/cfwl_themebackground.h" |
| 27 | #include "xfa/fwl/cfwl_themepart.h" |
| 28 | #include "xfa/fwl/cfwl_themetext.h" |
| 29 | #include "xfa/fwl/cfwl_widgetmgr.h" |
| 30 | #include "xfa/fwl/ifwl_themeprovider.h" |
Dan Sinclair | 80c4878 | 2017-03-23 12:11:20 -0400 | [diff] [blame] | 31 | #include "xfa/fxfa/cxfa_ffapp.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 32 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 33 | #define FWL_STYLEEXT_MNU_Vert (1L << 0) |
dsinclair | 55fa356 | 2016-05-04 14:24:53 -0700 | [diff] [blame] | 34 | #define FWL_WGT_CalcHeight 2048 |
| 35 | #define FWL_WGT_CalcWidth 2048 |
| 36 | #define FWL_WGT_CalcMultiLineDefWidth 120.0f |
| 37 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 38 | CFWL_Widget::CFWL_Widget(const CFWL_App* app, |
| 39 | std::unique_ptr<CFWL_WidgetProperties> properties, |
| 40 | CFWL_Widget* pOuter) |
| 41 | : m_pOwnerApp(app), |
| 42 | m_pWidgetMgr(app->GetWidgetMgr()), |
| 43 | m_pProperties(std::move(properties)), |
| 44 | m_pOuter(pOuter), |
| 45 | m_iLock(0), |
| 46 | m_pLayoutItem(nullptr), |
| 47 | m_nEventKey(0), |
| 48 | m_pDelegate(nullptr) { |
| 49 | ASSERT(m_pWidgetMgr); |
dsinclair | 73895de | 2016-10-20 07:19:43 -0700 | [diff] [blame] | 50 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 51 | CFWL_Widget* pParent = m_pProperties->m_pParent; |
| 52 | m_pWidgetMgr->InsertWidget(pParent, this); |
| 53 | if (IsChild()) |
| 54 | return; |
dsinclair | 73895de | 2016-10-20 07:19:43 -0700 | [diff] [blame] | 55 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 56 | CFWL_Widget* pOwner = m_pProperties->m_pOwner; |
| 57 | if (pOwner) |
| 58 | m_pWidgetMgr->SetOwner(pOwner, this); |
| 59 | } |
| 60 | |
| 61 | CFWL_Widget::~CFWL_Widget() { |
| 62 | NotifyDriver(); |
| 63 | m_pWidgetMgr->RemoveWidget(this); |
| 64 | } |
| 65 | |
| 66 | bool CFWL_Widget::IsInstance(const CFX_WideStringC& wsClass) const { |
| 67 | return false; |
dsinclair | 2085538 | 2016-10-31 07:29:34 -0700 | [diff] [blame] | 68 | } |
| 69 | |
dsinclair | da911bc | 2016-12-07 18:47:00 -0800 | [diff] [blame] | 70 | CFX_RectF CFWL_Widget::GetAutosizedWidgetRect() { |
| 71 | return CFX_RectF(); |
| 72 | } |
| 73 | |
| 74 | CFX_RectF CFWL_Widget::GetWidgetRect() { |
| 75 | return m_pProperties->m_rtWidget; |
dsinclair | 67c6ca3 | 2016-12-07 18:24:00 -0800 | [diff] [blame] | 76 | } |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 77 | |
dsinclair | 67c6ca3 | 2016-12-07 18:24:00 -0800 | [diff] [blame] | 78 | void CFWL_Widget::InflateWidgetRect(CFX_RectF& rect) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 79 | if (HasBorder()) { |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 80 | float fBorder = GetBorderSize(true); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 81 | rect.Inflate(fBorder, fBorder); |
| 82 | } |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 83 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 84 | |
dsinclair | 98329fe | 2016-11-10 09:40:14 -0800 | [diff] [blame] | 85 | void CFWL_Widget::SetWidgetRect(const CFX_RectF& rect) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 86 | m_pProperties->m_rtWidget = rect; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 87 | } |
| 88 | |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 89 | CFX_RectF CFWL_Widget::GetClientRect() { |
dsinclair | 46a4bbf | 2016-12-15 13:44:02 -0800 | [diff] [blame] | 90 | return GetEdgeRect(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | void CFWL_Widget::SetParent(CFWL_Widget* pParent) { |
| 94 | m_pProperties->m_pParent = pParent; |
| 95 | m_pWidgetMgr->SetParent(pParent, this); |
| 96 | } |
| 97 | |
| 98 | uint32_t CFWL_Widget::GetStyles() const { |
| 99 | return m_pProperties->m_dwStyles; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 100 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 101 | |
dsinclair | 98329fe | 2016-11-10 09:40:14 -0800 | [diff] [blame] | 102 | void CFWL_Widget::ModifyStyles(uint32_t dwStylesAdded, |
| 103 | uint32_t dwStylesRemoved) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 104 | m_pProperties->m_dwStyles = |
| 105 | (m_pProperties->m_dwStyles & ~dwStylesRemoved) | dwStylesAdded; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 106 | } |
dsinclair | 55fa356 | 2016-05-04 14:24:53 -0700 | [diff] [blame] | 107 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 108 | uint32_t CFWL_Widget::GetStylesEx() const { |
| 109 | return m_pProperties->m_dwStyleExes; |
| 110 | } |
| 111 | uint32_t CFWL_Widget::GetStates() const { |
| 112 | return m_pProperties->m_dwStates; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 113 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 114 | |
dsinclair | 98329fe | 2016-11-10 09:40:14 -0800 | [diff] [blame] | 115 | void CFWL_Widget::ModifyStylesEx(uint32_t dwStylesExAdded, |
| 116 | uint32_t dwStylesExRemoved) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 117 | m_pProperties->m_dwStyleExes = |
| 118 | (m_pProperties->m_dwStyleExes & ~dwStylesExRemoved) | dwStylesExAdded; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 119 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 120 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 121 | static void NotifyHideChildWidget(CFWL_WidgetMgr* widgetMgr, |
| 122 | CFWL_Widget* widget, |
| 123 | CFWL_NoteDriver* noteDriver) { |
| 124 | CFWL_Widget* child = widgetMgr->GetFirstChildWidget(widget); |
| 125 | while (child) { |
| 126 | noteDriver->NotifyTargetHide(child); |
| 127 | NotifyHideChildWidget(widgetMgr, child, noteDriver); |
| 128 | child = widgetMgr->GetNextSiblingWidget(child); |
| 129 | } |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 130 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 131 | |
dsinclair | 7fa190d | 2016-12-07 17:23:28 -0800 | [diff] [blame] | 132 | void CFWL_Widget::SetStates(uint32_t dwStates) { |
| 133 | m_pProperties->m_dwStates |= dwStates; |
| 134 | if (!(dwStates & FWL_WGTSTATE_Invisible)) |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 135 | return; |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 136 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 137 | CFWL_NoteDriver* noteDriver = |
| 138 | static_cast<CFWL_NoteDriver*>(GetOwnerApp()->GetNoteDriver()); |
| 139 | CFWL_WidgetMgr* widgetMgr = GetOwnerApp()->GetWidgetMgr(); |
| 140 | noteDriver->NotifyTargetHide(this); |
| 141 | CFWL_Widget* child = widgetMgr->GetFirstChildWidget(this); |
| 142 | while (child) { |
| 143 | noteDriver->NotifyTargetHide(child); |
| 144 | NotifyHideChildWidget(widgetMgr, child, noteDriver); |
| 145 | child = widgetMgr->GetNextSiblingWidget(child); |
| 146 | } |
| 147 | return; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 148 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 149 | |
dsinclair | 7fa190d | 2016-12-07 17:23:28 -0800 | [diff] [blame] | 150 | void CFWL_Widget::RemoveStates(uint32_t dwStates) { |
| 151 | m_pProperties->m_dwStates &= ~dwStates; |
| 152 | } |
| 153 | |
Dan Sinclair | b45ea1f | 2017-02-21 14:27:59 -0500 | [diff] [blame] | 154 | FWL_WidgetHit CFWL_Widget::HitTest(const CFX_PointF& point) { |
| 155 | if (GetClientRect().Contains(point)) |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 156 | return FWL_WidgetHit::Client; |
Dan Sinclair | b45ea1f | 2017-02-21 14:27:59 -0500 | [diff] [blame] | 157 | if (HasBorder() && GetRelativeRect().Contains(point)) |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 158 | return FWL_WidgetHit::Border; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 159 | return FWL_WidgetHit::Unknown; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 160 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 161 | |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 162 | CFX_PointF CFWL_Widget::TransformTo(CFWL_Widget* pWidget, |
| 163 | const CFX_PointF& point) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 164 | if (m_pWidgetMgr->IsFormDisabled()) { |
| 165 | CFX_SizeF szOffset; |
| 166 | if (IsParent(pWidget)) { |
| 167 | szOffset = GetOffsetFromParent(pWidget); |
| 168 | } else { |
| 169 | szOffset = pWidget->GetOffsetFromParent(this); |
dan sinclair | 071d786 | 2017-02-07 20:46:32 -0500 | [diff] [blame] | 170 | szOffset.width = -szOffset.width; |
| 171 | szOffset.height = -szOffset.height; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 172 | } |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 173 | return point + CFX_PointF(szOffset.width, szOffset.height); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 174 | } |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 175 | |
| 176 | CFX_PointF ret = point; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 177 | CFWL_Widget* parent = GetParent(); |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 178 | if (parent) |
| 179 | ret = GetMatrix().Transform(ret + GetWidgetRect().TopLeft()); |
| 180 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 181 | CFWL_Widget* form1 = m_pWidgetMgr->GetSystemFormWidget(this); |
| 182 | if (!form1) |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 183 | return ret; |
dsinclair | da911bc | 2016-12-07 18:47:00 -0800 | [diff] [blame] | 184 | |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 185 | if (!pWidget) |
| 186 | return ret + form1->GetWidgetRect().TopLeft(); |
| 187 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 188 | CFWL_Widget* form2 = m_pWidgetMgr->GetSystemFormWidget(pWidget); |
| 189 | if (!form2) |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 190 | return ret; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 191 | if (form1 != form2) { |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 192 | ret += form1->GetWidgetRect().TopLeft(); |
| 193 | ret -= form2->GetWidgetRect().TopLeft(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 194 | } |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 195 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 196 | parent = pWidget->GetParent(); |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 197 | if (!parent) |
| 198 | return ret; |
| 199 | |
Nicolas Pena | b21f174 | 2017-06-29 12:02:06 -0400 | [diff] [blame] | 200 | return pWidget->GetMatrix().GetInverse().Transform(ret) - |
| 201 | pWidget->GetWidgetRect().TopLeft(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 202 | } |
| 203 | |
dsinclair | 1babeee | 2016-12-08 19:45:00 -0800 | [diff] [blame] | 204 | CFX_Matrix CFWL_Widget::GetMatrix() { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 205 | if (!m_pProperties) |
dsinclair | 1babeee | 2016-12-08 19:45:00 -0800 | [diff] [blame] | 206 | return CFX_Matrix(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 207 | |
| 208 | CFWL_Widget* parent = GetParent(); |
Tom Sepez | 576e815 | 2017-01-30 14:26:24 -0800 | [diff] [blame] | 209 | std::vector<CFWL_Widget*> parents; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 210 | while (parent) { |
Tom Sepez | 576e815 | 2017-01-30 14:26:24 -0800 | [diff] [blame] | 211 | parents.push_back(parent); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 212 | parent = parent->GetParent(); |
| 213 | } |
dsinclair | 1babeee | 2016-12-08 19:45:00 -0800 | [diff] [blame] | 214 | |
| 215 | CFX_Matrix matrix; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 216 | CFX_Matrix ctmOnParent; |
| 217 | CFX_RectF rect; |
Tom Sepez | 576e815 | 2017-01-30 14:26:24 -0800 | [diff] [blame] | 218 | int32_t count = pdfium::CollectionSize<int32_t>(parents); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 219 | for (int32_t i = count - 2; i >= 0; i--) { |
Tom Sepez | 576e815 | 2017-01-30 14:26:24 -0800 | [diff] [blame] | 220 | parent = parents[i]; |
dsinclair | 1babeee | 2016-12-08 19:45:00 -0800 | [diff] [blame] | 221 | if (parent->m_pProperties) |
| 222 | ctmOnParent.SetIdentity(); |
dsinclair | da911bc | 2016-12-07 18:47:00 -0800 | [diff] [blame] | 223 | rect = parent->GetWidgetRect(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 224 | matrix.Concat(ctmOnParent, true); |
| 225 | matrix.Translate(rect.left, rect.top, true); |
| 226 | } |
| 227 | CFX_Matrix m; |
| 228 | m.SetIdentity(); |
| 229 | matrix.Concat(m, true); |
Tom Sepez | 576e815 | 2017-01-30 14:26:24 -0800 | [diff] [blame] | 230 | parents.clear(); |
dsinclair | 1babeee | 2016-12-08 19:45:00 -0800 | [diff] [blame] | 231 | return matrix; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | IFWL_ThemeProvider* CFWL_Widget::GetThemeProvider() const { |
| 235 | return m_pProperties->m_pThemeProvider; |
| 236 | } |
| 237 | |
| 238 | void CFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) { |
| 239 | m_pProperties->m_pThemeProvider = pThemeProvider; |
| 240 | } |
| 241 | |
| 242 | bool CFWL_Widget::IsEnabled() const { |
| 243 | return (m_pProperties->m_dwStates & FWL_WGTSTATE_Disabled) == 0; |
| 244 | } |
| 245 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 246 | bool CFWL_Widget::HasBorder() const { |
| 247 | return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border); |
| 248 | } |
| 249 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 250 | bool CFWL_Widget::IsVisible() const { |
| 251 | return (m_pProperties->m_dwStates & FWL_WGTSTATE_Invisible) == 0; |
| 252 | } |
| 253 | |
| 254 | bool CFWL_Widget::IsOverLapper() const { |
| 255 | return (m_pProperties->m_dwStyles & FWL_WGTSTYLE_WindowTypeMask) == |
| 256 | FWL_WGTSTYLE_OverLapper; |
| 257 | } |
| 258 | |
| 259 | bool CFWL_Widget::IsPopup() const { |
| 260 | return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Popup); |
| 261 | } |
| 262 | |
| 263 | bool CFWL_Widget::IsChild() const { |
| 264 | return !!(m_pProperties->m_dwStyles & FWL_WGTSTYLE_Child); |
| 265 | } |
| 266 | |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 267 | CFX_RectF CFWL_Widget::GetEdgeRect() { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 268 | CFX_RectF rtEdge(0, 0, m_pProperties->m_rtWidget.width, |
| 269 | m_pProperties->m_rtWidget.height); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 270 | if (HasBorder()) { |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 271 | float fCX = GetBorderSize(true); |
| 272 | float fCY = GetBorderSize(false); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 273 | rtEdge.Deflate(fCX, fCY); |
| 274 | } |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 275 | return rtEdge; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 276 | } |
| 277 | |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 278 | float CFWL_Widget::GetBorderSize(bool bCX) { |
Dan Sinclair | c635c93 | 2017-01-03 15:46:55 -0500 | [diff] [blame] | 279 | IFWL_ThemeProvider* theme = GetAvailableTheme(); |
| 280 | if (!theme) |
| 281 | return 0.0f; |
| 282 | return bCX ? theme->GetCXBorderSize() : theme->GetCYBorderSize(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 283 | } |
| 284 | |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 285 | CFX_RectF CFWL_Widget::GetRelativeRect() { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 286 | return CFX_RectF(0, 0, m_pProperties->m_rtWidget.width, |
| 287 | m_pProperties->m_rtWidget.height); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 288 | } |
| 289 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 290 | IFWL_ThemeProvider* CFWL_Widget::GetAvailableTheme() { |
| 291 | if (m_pProperties->m_pThemeProvider) |
| 292 | return m_pProperties->m_pThemeProvider; |
| 293 | |
| 294 | CFWL_Widget* pUp = this; |
| 295 | do { |
| 296 | pUp = (pUp->GetStyles() & FWL_WGTSTYLE_Popup) |
| 297 | ? m_pWidgetMgr->GetOwnerWidget(pUp) |
| 298 | : m_pWidgetMgr->GetParentWidget(pUp); |
| 299 | if (pUp) { |
| 300 | IFWL_ThemeProvider* pRet = pUp->GetThemeProvider(); |
| 301 | if (pRet) |
| 302 | return pRet; |
| 303 | } |
| 304 | } while (pUp); |
| 305 | return nullptr; |
| 306 | } |
| 307 | |
| 308 | CFWL_Widget* CFWL_Widget::GetRootOuter() { |
| 309 | CFWL_Widget* pRet = m_pOuter; |
| 310 | if (!pRet) |
| 311 | return nullptr; |
| 312 | |
| 313 | while (CFWL_Widget* pOuter = pRet->GetOuter()) |
| 314 | pRet = pOuter; |
| 315 | return pRet; |
| 316 | } |
| 317 | |
| 318 | CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText, |
| 319 | IFWL_ThemeProvider* pTheme, |
dsinclair | 442997c | 2016-12-07 17:58:41 -0800 | [diff] [blame] | 320 | bool bMultiLine) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 321 | if (!pTheme) |
| 322 | return CFX_SizeF(); |
| 323 | |
| 324 | CFWL_ThemeText calPart; |
| 325 | calPart.m_pWidget = this; |
| 326 | calPart.m_wsText = wsText; |
| 327 | calPart.m_dwTTOStyles = |
| 328 | bMultiLine ? FDE_TTOSTYLE_LineWrap : FDE_TTOSTYLE_SingleLine; |
| 329 | calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft; |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 330 | float fWidth = bMultiLine ? FWL_WGT_CalcMultiLineDefWidth : FWL_WGT_CalcWidth; |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 331 | CFX_RectF rect(0, 0, fWidth, FWL_WGT_CalcHeight); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 332 | pTheme->CalcTextRect(&calPart, rect); |
| 333 | return CFX_SizeF(rect.width, rect.height); |
| 334 | } |
| 335 | |
| 336 | void CFWL_Widget::CalcTextRect(const CFX_WideString& wsText, |
| 337 | IFWL_ThemeProvider* pTheme, |
| 338 | uint32_t dwTTOStyles, |
| 339 | int32_t iTTOAlign, |
| 340 | CFX_RectF& rect) { |
| 341 | CFWL_ThemeText calPart; |
| 342 | calPart.m_pWidget = this; |
| 343 | calPart.m_wsText = wsText; |
| 344 | calPart.m_dwTTOStyles = dwTTOStyles; |
| 345 | calPart.m_iTTOAlign = iTTOAlign; |
| 346 | pTheme->CalcTextRect(&calPart, rect); |
| 347 | } |
| 348 | |
| 349 | void CFWL_Widget::SetFocus(bool bFocus) { |
| 350 | if (m_pWidgetMgr->IsFormDisabled()) |
| 351 | return; |
| 352 | |
| 353 | const CFWL_App* pApp = GetOwnerApp(); |
| 354 | if (!pApp) |
| 355 | return; |
| 356 | |
| 357 | CFWL_NoteDriver* pDriver = |
| 358 | static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); |
| 359 | if (!pDriver) |
| 360 | return; |
| 361 | |
| 362 | CFWL_Widget* curFocus = pDriver->GetFocus(); |
| 363 | if (bFocus && curFocus != this) |
| 364 | pDriver->SetFocus(this); |
| 365 | else if (!bFocus && curFocus == this) |
| 366 | pDriver->SetFocus(nullptr); |
| 367 | } |
| 368 | |
| 369 | void CFWL_Widget::SetGrab(bool bSet) { |
| 370 | const CFWL_App* pApp = GetOwnerApp(); |
| 371 | if (!pApp) |
| 372 | return; |
| 373 | |
| 374 | CFWL_NoteDriver* pDriver = |
| 375 | static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); |
| 376 | pDriver->SetGrab(this, bSet); |
| 377 | } |
| 378 | |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 379 | void CFWL_Widget::GetPopupPos(float fMinHeight, |
| 380 | float fMaxHeight, |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 381 | const CFX_RectF& rtAnchor, |
| 382 | CFX_RectF& rtPopup) { |
| 383 | if (GetClassID() == FWL_Type::ComboBox) { |
| 384 | if (m_pWidgetMgr->IsFormDisabled()) { |
| 385 | m_pWidgetMgr->GetAdapterPopupPos(this, fMinHeight, fMaxHeight, rtAnchor, |
| 386 | rtPopup); |
| 387 | return; |
| 388 | } |
| 389 | GetPopupPosComboBox(fMinHeight, fMaxHeight, rtAnchor, rtPopup); |
| 390 | return; |
| 391 | } |
| 392 | if (GetClassID() == FWL_Type::DateTimePicker && |
| 393 | m_pWidgetMgr->IsFormDisabled()) { |
| 394 | m_pWidgetMgr->GetAdapterPopupPos(this, fMinHeight, fMaxHeight, rtAnchor, |
| 395 | rtPopup); |
| 396 | return; |
| 397 | } |
| 398 | GetPopupPosGeneral(fMinHeight, fMaxHeight, rtAnchor, rtPopup); |
| 399 | } |
| 400 | |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 401 | bool CFWL_Widget::GetPopupPosMenu(float fMinHeight, |
| 402 | float fMaxHeight, |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 403 | const CFX_RectF& rtAnchor, |
| 404 | CFX_RectF& rtPopup) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 405 | if (GetStylesEx() & FWL_STYLEEXT_MNU_Vert) { |
| 406 | bool bLeft = m_pProperties->m_rtWidget.left < 0; |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 407 | float fRight = rtAnchor.right() + rtPopup.width; |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 408 | CFX_PointF point = TransformTo(nullptr, CFX_PointF()); |
| 409 | if (fRight + point.x > 0.0f || bLeft) { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 410 | rtPopup = CFX_RectF(rtAnchor.left - rtPopup.width, rtAnchor.top, |
| 411 | rtPopup.width, rtPopup.height); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 412 | } else { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 413 | rtPopup = CFX_RectF(rtAnchor.right(), rtAnchor.top, rtPopup.width, |
| 414 | rtPopup.height); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 415 | } |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 416 | rtPopup.Offset(point.x, point.y); |
| 417 | return true; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 418 | } |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 419 | |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 420 | float fBottom = rtAnchor.bottom() + rtPopup.height; |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 421 | CFX_PointF point = TransformTo(nullptr, point); |
| 422 | if (fBottom + point.y > 0.0f) { |
| 423 | rtPopup = CFX_RectF(rtAnchor.left, rtAnchor.top - rtPopup.height, |
| 424 | rtPopup.width, rtPopup.height); |
| 425 | } else { |
| 426 | rtPopup = CFX_RectF(rtAnchor.left, rtAnchor.bottom(), rtPopup.width, |
| 427 | rtPopup.height); |
| 428 | } |
| 429 | rtPopup.Offset(point.x, point.y); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 430 | return true; |
| 431 | } |
| 432 | |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 433 | bool CFWL_Widget::GetPopupPosComboBox(float fMinHeight, |
| 434 | float fMaxHeight, |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 435 | const CFX_RectF& rtAnchor, |
| 436 | CFX_RectF& rtPopup) { |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 437 | float fPopHeight = rtPopup.height; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 438 | if (rtPopup.height > fMaxHeight) |
| 439 | fPopHeight = fMaxHeight; |
| 440 | else if (rtPopup.height < fMinHeight) |
| 441 | fPopHeight = fMinHeight; |
| 442 | |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 443 | float fWidth = std::max(rtAnchor.width, rtPopup.width); |
| 444 | float fBottom = rtAnchor.bottom() + fPopHeight; |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 445 | CFX_PointF point = TransformTo(nullptr, CFX_PointF()); |
| 446 | if (fBottom + point.y > 0.0f) { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 447 | rtPopup = |
| 448 | CFX_RectF(rtAnchor.left, rtAnchor.top - fPopHeight, fWidth, fPopHeight); |
| 449 | } else { |
| 450 | rtPopup = CFX_RectF(rtAnchor.left, rtAnchor.bottom(), fWidth, fPopHeight); |
| 451 | } |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 452 | |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 453 | rtPopup.Offset(point.x, point.y); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 454 | return true; |
| 455 | } |
| 456 | |
Dan Sinclair | 05df075 | 2017-03-14 14:43:42 -0400 | [diff] [blame] | 457 | bool CFWL_Widget::GetPopupPosGeneral(float fMinHeight, |
| 458 | float fMaxHeight, |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 459 | const CFX_RectF& rtAnchor, |
| 460 | CFX_RectF& rtPopup) { |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 461 | CFX_PointF point = TransformTo(nullptr, CFX_PointF()); |
| 462 | if (rtAnchor.bottom() + point.y > 0.0f) { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 463 | rtPopup = CFX_RectF(rtAnchor.left, rtAnchor.top - rtPopup.height, |
| 464 | rtPopup.width, rtPopup.height); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 465 | } else { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 466 | rtPopup = CFX_RectF(rtAnchor.left, rtAnchor.bottom(), rtPopup.width, |
| 467 | rtPopup.height); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 468 | } |
Dan Sinclair | 1f403ce | 2017-02-21 12:56:24 -0500 | [diff] [blame] | 469 | rtPopup.Offset(point.x, point.y); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 470 | return true; |
| 471 | } |
| 472 | |
| 473 | void CFWL_Widget::RegisterEventTarget(CFWL_Widget* pEventSource) { |
| 474 | const CFWL_App* pApp = GetOwnerApp(); |
| 475 | if (!pApp) |
| 476 | return; |
| 477 | |
| 478 | CFWL_NoteDriver* pNoteDriver = pApp->GetNoteDriver(); |
| 479 | if (!pNoteDriver) |
| 480 | return; |
| 481 | |
| 482 | pNoteDriver->RegisterEventTarget(this, pEventSource); |
| 483 | } |
| 484 | |
| 485 | void CFWL_Widget::UnregisterEventTarget() { |
| 486 | const CFWL_App* pApp = GetOwnerApp(); |
| 487 | if (!pApp) |
| 488 | return; |
| 489 | |
| 490 | CFWL_NoteDriver* pNoteDriver = pApp->GetNoteDriver(); |
| 491 | if (!pNoteDriver) |
| 492 | return; |
| 493 | |
| 494 | pNoteDriver->UnregisterEventTarget(this); |
| 495 | } |
| 496 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 497 | void CFWL_Widget::DispatchEvent(CFWL_Event* pEvent) { |
| 498 | if (m_pOuter) { |
| 499 | m_pOuter->GetDelegate()->OnProcessEvent(pEvent); |
| 500 | return; |
| 501 | } |
| 502 | const CFWL_App* pApp = GetOwnerApp(); |
| 503 | if (!pApp) |
| 504 | return; |
| 505 | |
| 506 | CFWL_NoteDriver* pNoteDriver = pApp->GetNoteDriver(); |
| 507 | if (!pNoteDriver) |
| 508 | return; |
| 509 | pNoteDriver->SendEvent(pEvent); |
| 510 | } |
| 511 | |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 512 | void CFWL_Widget::Repaint() { |
Dan Sinclair | bba2a7c | 2017-02-07 16:36:39 -0500 | [diff] [blame] | 513 | RepaintRect(CFX_RectF(0, 0, m_pProperties->m_rtWidget.width, |
| 514 | m_pProperties->m_rtWidget.height)); |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 515 | } |
| 516 | |
| 517 | void CFWL_Widget::RepaintRect(const CFX_RectF& pRect) { |
| 518 | m_pWidgetMgr->RepaintWidget(this, pRect); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 519 | } |
| 520 | |
Dan Sinclair | 2b918c8 | 2017-07-13 14:47:10 -0400 | [diff] [blame^] | 521 | void CFWL_Widget::DrawBackground(CXFA_Graphics* pGraphics, |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 522 | CFWL_Part iPartBk, |
| 523 | IFWL_ThemeProvider* pTheme, |
| 524 | const CFX_Matrix* pMatrix) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 525 | CFWL_ThemeBackground param; |
| 526 | param.m_pWidget = this; |
| 527 | param.m_iPart = iPartBk; |
| 528 | param.m_pGraphics = pGraphics; |
| 529 | if (pMatrix) |
| 530 | param.m_matrix.Concat(*pMatrix, true); |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 531 | param.m_rtPart = GetRelativeRect(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 532 | pTheme->DrawBackground(¶m); |
| 533 | } |
| 534 | |
Dan Sinclair | 2b918c8 | 2017-07-13 14:47:10 -0400 | [diff] [blame^] | 535 | void CFWL_Widget::DrawBorder(CXFA_Graphics* pGraphics, |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 536 | CFWL_Part iPartBorder, |
| 537 | IFWL_ThemeProvider* pTheme, |
dsinclair | 98329fe | 2016-11-10 09:40:14 -0800 | [diff] [blame] | 538 | const CFX_Matrix* pMatrix) { |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 539 | CFWL_ThemeBackground param; |
| 540 | param.m_pWidget = this; |
| 541 | param.m_iPart = iPartBorder; |
| 542 | param.m_pGraphics = pGraphics; |
| 543 | if (pMatrix) |
| 544 | param.m_matrix.Concat(*pMatrix, true); |
dsinclair | 43ac44c | 2016-12-08 14:05:14 -0800 | [diff] [blame] | 545 | param.m_rtPart = GetRelativeRect(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 546 | pTheme->DrawBackground(¶m); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 547 | } |
dsinclair | 7f432a1 | 2016-03-29 12:38:01 -0700 | [diff] [blame] | 548 | |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 549 | void CFWL_Widget::NotifyDriver() { |
| 550 | const CFWL_App* pApp = GetOwnerApp(); |
| 551 | if (!pApp) |
| 552 | return; |
| 553 | |
| 554 | CFWL_NoteDriver* pDriver = |
| 555 | static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver()); |
| 556 | if (!pDriver) |
| 557 | return; |
| 558 | |
| 559 | pDriver->NotifyTargetDestroy(this); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 560 | } |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 561 | |
| 562 | CFX_SizeF CFWL_Widget::GetOffsetFromParent(CFWL_Widget* pParent) { |
| 563 | if (pParent == this) |
| 564 | return CFX_SizeF(); |
| 565 | |
| 566 | CFWL_WidgetMgr* pWidgetMgr = GetOwnerApp()->GetWidgetMgr(); |
| 567 | if (!pWidgetMgr) |
| 568 | return CFX_SizeF(); |
| 569 | |
| 570 | CFX_SizeF szRet(m_pProperties->m_rtWidget.left, |
| 571 | m_pProperties->m_rtWidget.top); |
| 572 | |
| 573 | CFWL_Widget* pDstWidget = GetParent(); |
| 574 | while (pDstWidget && pDstWidget != pParent) { |
dsinclair | da911bc | 2016-12-07 18:47:00 -0800 | [diff] [blame] | 575 | CFX_RectF rtDst = pDstWidget->GetWidgetRect(); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 576 | szRet += CFX_SizeF(rtDst.left, rtDst.top); |
| 577 | pDstWidget = pWidgetMgr->GetParentWidget(pDstWidget); |
| 578 | } |
| 579 | return szRet; |
| 580 | } |
| 581 | |
| 582 | bool CFWL_Widget::IsParent(CFWL_Widget* pParent) { |
| 583 | CFWL_Widget* pUpWidget = GetParent(); |
| 584 | while (pUpWidget) { |
| 585 | if (pUpWidget == pParent) |
| 586 | return true; |
| 587 | pUpWidget = pUpWidget->GetParent(); |
| 588 | } |
| 589 | return false; |
| 590 | } |
| 591 | |
| 592 | void CFWL_Widget::OnProcessMessage(CFWL_Message* pMessage) { |
| 593 | if (!pMessage->m_pDstTarget) |
| 594 | return; |
| 595 | |
| 596 | CFWL_Widget* pWidget = pMessage->m_pDstTarget; |
dsinclair | 4614b45 | 2016-12-07 17:01:58 -0800 | [diff] [blame] | 597 | switch (pMessage->GetType()) { |
| 598 | case CFWL_Message::Type::Mouse: { |
dsinclair | 447b1f3 | 2016-12-08 10:06:32 -0800 | [diff] [blame] | 599 | CFWL_MessageMouse* pMsgMouse = static_cast<CFWL_MessageMouse*>(pMessage); |
dsinclair | 4614b45 | 2016-12-07 17:01:58 -0800 | [diff] [blame] | 600 | |
dsinclair | 447b1f3 | 2016-12-08 10:06:32 -0800 | [diff] [blame] | 601 | CFWL_EventMouse evt(pWidget, pWidget); |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 602 | evt.m_dwCmd = pMsgMouse->m_dwCmd; |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 603 | pWidget->DispatchEvent(&evt); |
| 604 | break; |
| 605 | } |
| 606 | default: |
| 607 | break; |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | void CFWL_Widget::OnProcessEvent(CFWL_Event* pEvent) {} |
| 612 | |
Dan Sinclair | 2b918c8 | 2017-07-13 14:47:10 -0400 | [diff] [blame^] | 613 | void CFWL_Widget::OnDrawWidget(CXFA_Graphics* pGraphics, |
dsinclair | 2c489cc | 2016-11-23 16:17:20 -0800 | [diff] [blame] | 614 | const CFX_Matrix* pMatrix) {} |