@@ -1073,6 +1073,16 @@ void Component::getInterceptsMouseClicks (bool& allowsClicksOnThisComponent,
10731073 allowsClicksOnChildComponents = flags.allowChildMouseClicksFlag ;
10741074}
10751075
1076+ void Component::setDisableInternalMouseEvents (bool disableInternalMouseEvents) noexcept
1077+ {
1078+ flags.disableInternalMouseEventsFlag = disableInternalMouseEvents;
1079+ }
1080+
1081+ bool Component::getDisableInternalMouseEvents () const noexcept
1082+ {
1083+ return flags.disableInternalMouseEventsFlag ;
1084+ }
1085+
10761086bool Component::contains (Point<int > point)
10771087{
10781088 return contains (point.toFloat ());
@@ -2107,7 +2117,7 @@ void Component::internalMouseEnter (MouseInputSource source, Point<float> relati
21072117 false );
21082118
21092119 HierarchyChecker checker (this , me);
2110- mouseEnter (me);
2120+ if (!flags. disableInternalMouseEventsFlag ) mouseEnter (me);
21112121
21122122 flags.cachedMouseInsideComponent = true ;
21132123
@@ -2144,7 +2154,7 @@ void Component::internalMouseExit (MouseInputSource source, Point<float> relativ
21442154 false );
21452155
21462156 HierarchyChecker checker (this , me);
2147- mouseExit (me);
2157+ if (!flags. disableInternalMouseEventsFlag ) mouseExit (me);
21482158
21492159 if (checker.shouldBailOut ())
21502160 return ;
@@ -2211,7 +2221,7 @@ void Component::internalMouseDown (MouseInputSource source,
22112221 if (flags.repaintOnMouseActivityFlag )
22122222 repaint ();
22132223
2214- mouseDown (me);
2224+ if (!flags. disableInternalMouseEventsFlag ) mouseDown (me);
22152225
22162226 if (checker.shouldBailOut ())
22172227 return ;
@@ -2250,7 +2260,7 @@ void Component::internalMouseUp (MouseInputSource source,
22502260 if (flags.repaintOnMouseActivityFlag )
22512261 repaint ();
22522262
2253- mouseUp (me);
2263+ if (!flags. disableInternalMouseEventsFlag ) mouseUp (me);
22542264
22552265 if (checker.shouldBailOut ())
22562266 return ;
@@ -2267,7 +2277,7 @@ void Component::internalMouseUp (MouseInputSource source,
22672277 if (me.getNumberOfClicks () >= 2 )
22682278 {
22692279 if (checker.nearestNonNullParent () == this )
2270- mouseDoubleClick (checker.eventWithNearestParent ());
2280+ if (!flags. disableInternalMouseEventsFlag ) mouseDoubleClick (checker.eventWithNearestParent ());
22712281
22722282 if (checker.shouldBailOut ())
22732283 return ;
@@ -2294,7 +2304,7 @@ void Component::internalMouseDrag (MouseInputSource source, const detail::Pointe
22942304
22952305 HierarchyChecker checker (this , me);
22962306
2297- mouseDrag (me);
2307+ if (!flags. disableInternalMouseEventsFlag ) mouseDrag (me);
22982308
22992309 if (checker.shouldBailOut ())
23002310 return ;
@@ -2328,7 +2338,7 @@ void Component::internalMouseMove (MouseInputSource source, Point<float> relativ
23282338
23292339 HierarchyChecker checker (this , me);
23302340
2331- mouseMove (me);
2341+ if (!flags. disableInternalMouseEventsFlag ) mouseMove (me);
23322342
23332343 if (checker.shouldBailOut ())
23342344 return ;
0 commit comments