diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-07 09:08:12 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-09-07 09:08:12 +0200 |
| commit | 167e50bf7c4af84a6793326e39b0d3e41d4eb8bf (patch) | |
| tree | 57a9239773e3eb0b60e648119ddb782db92439f3 /src/GraphicObjects/GraphicObject.cs | |
| parent | bacf29e47409c20292b6861e6ef40bfc2119eb7b (diff) | |
Focus improvments:
New function (checkHoverWidget) to check most inner control under the
mouse, than bubble onMouseMove through the parents
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index e1972669..d74442d7 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -661,20 +661,23 @@ namespace go {
return Visible ? ScreenCoordinates(Slot).ContainsOrIsEqual (m) : false;
}
- internal virtual void checkHoverWidget(Point m)
+ internal virtual void checkHoverWidget(MouseMoveEventArgs e)
{
-
- }
- public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
- {
- //ILayoutable w = sender as ILayoutable;
-
if (TopContainer.hoverWidget != this) {
TopContainer.hoverWidget = this;
- onMouseEnter (sender, e);
+ onMouseEnter (this, e);
}
-
- MouseMove.Raise (this, e);
+
+ this.onMouseMove (this, e);
+ }
+ public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
+ {
+ //bubble event to the top
+ GraphicObject p = Parent as GraphicObject;
+ if (p != null)
+ p.onMouseMove(sender,e);
+
+ MouseMove.Raise (sender, e);
}
public virtual void onMouseButtonUp(object sender, MouseButtonEventArgs e){
if (MouseIsIn (e.Position))
|