48 return pr.first->second;
62 const auto enability_changed(
IsEnabled(wgt) != b);
67 return enability_changed;
78 CallEvent<KeyDown>(e.GetSender(), e);
84 IWidget& wgt(e.GetSender());
86 if(e.Strategy != RoutedEventArgs::Bubble)
88 if(e.Strategy == RoutedEventArgs::Direct)
90 if(e.Strategy != RoutedEventArgs::Tunnel)
97 if(e.Strategy == RoutedEventArgs::Direct)
101 if(st.GetTouchDownPtr())
103 auto& wgt(*st.GetTouchDownPtr());
105 if(st.DraggingOffset == Vec::Invalid)
107 - st.ControlLocation;
109 CallEvent<TouchMove>(wgt, e);
110 st.LastControlLocation = st.ControlLocation;
118 if(e.Strategy == RoutedEventArgs::Direct)
122 if(st.GetTouchDownPtr() && st.HeldTimer.Refresh(st.TouchHeldState,
124 CallEvent<TouchDown>(*st.GetTouchDownPtr(), e);
131 if(e.Strategy == RoutedEventArgs::Direct)
135 if(st.GetTouchDownPtr())
137 auto& wgt(*st.GetTouchDownPtr());
144 SetLocationOf(wgt, st.LastControlLocation + st.DraggingOffset);
153 FetchEnabledBoundControlPtr(KeyEventArgs&& e)
157 auto pCtl(dynamic_cast<Control&>(e.GetSender())
158 .BoundControlPtr(e.GetKeys()));
160 return pCtl &&
IsEnabled(*pCtl) ? pCtl :
nullptr;
162 catch(std::bad_function_call&)
164 catch(std::bad_cast&)
173 if(
const auto pCtl = FetchEnabledBoundControlPtr(std::move(e)))
175 TouchEventArgs et(*pCtl, e.Keys, TouchEventArgs::Invalid);
177 CallEvent<TouchUp>(*pCtl, et);
178 CallEvent<Leave>(*pCtl, et);
186 if(
const auto pCtl = FetchEnabledBoundControlPtr(std::move(e)))
188 TouchEventArgs et(*pCtl, e.Keys, TouchEventArgs::Invalid);
190 CallEvent<Enter>(*pCtl, et);
191 CallEvent<TouchDown>(*pCtl, et);
199 if(
const auto pCtl = FetchEnabledBoundControlPtr(std::move(e)))
201 TouchEventArgs et(*pCtl, e.Keys, TouchEventArgs::Invalid);
203 CallEvent<Click>(*pCtl, et);
209 Control::ControlEventMap::ControlEventMap()
217 Control::Control(
const Rect& r)
226 std::placeholders::_1))
233 FetchEvent<Move>(*
this) +=
h,
234 FetchEvent<Resize>(*
this) +=
h,
235 FetchEvent<GotFocus>(*
this) +=
h,
236 FetchEvent<LostFocus>(*
this) +=
h