[XmlAttributeAttribute][DefaultValue(false)]
public bool IsOpened {
- //get { return MenuRoot == null ? false : MenuRoot.IsOpened; }
get { return isOpened; }
set {
if (isOpened == value)
isOpened = value;
NotifyValueChanged ("IsOpened", isOpened);
- if (isOpened) {
+ if (isOpened)
onOpen (this, null);
-// if (MenuRoot != null)
-// MenuRoot.IsOpened = true;
- }else
+ else
onClose (this, null);
}
}
Execute.Raise (this, null);
}
protected virtual void onOpen (object sender, EventArgs e){
- //MenuRoot.IsOpened = true;
Open.Raise (this, null);
}
protected virtual void onClose (object sender, EventArgs e){
- //MenuRoot.IsOpened = true;
Close.Raise (this, null);
}
- public override void onMouseEnter (object sender, MouseMoveEventArgs e)
+ public override bool MouseIsIn (Point m)
{
- base.onMouseEnter (sender, e);
- if (MenuRoot == null || Items.Count == 0)
- return;
- IsOpened = MenuRoot.IsOpened;
+ return base.MouseIsIn (m) || child.MouseIsIn (m);
+ }
+ public override void onMouseLeave (object sender, MouseMoveEventArgs e)
+ {
+ if (IsOpened)
+ IsOpened = false;
+ base.onMouseLeave (this, e);
}
}
}
{
if (_canPop)
IsPopped = !IsPopped;
- base.onMouseClick (sender, e);
+ base.onMouseClick (this, e);
}
public override void onMouseLeave (object sender, MouseMoveEventArgs e)
{
- if (!_isPopped || _content == null) {
- base.onMouseLeave (sender, e);
- return;
+ base.onMouseLeave (this, e);
+ IsPopped = false;
+ }
+ public override bool MouseIsIn (Point m)
+ {
+ bool isInContent = false;
+ if (Content != null) {
+ if (Content.Parent != null)
+ isInContent = Content.MouseIsIn (m);
}
-
- if (!_content.MouseIsIn (e.Position)) {
- base.onMouseLeave (sender, e);
- IsPopped = false;
- return;
+ return base.MouseIsIn (m) || isInContent;
+ }
+ public override void checkHoverWidget (MouseMoveEventArgs e)
+ {
+ if (CurrentInterface.HoverWidget != this) {
+ CurrentInterface.HoverWidget = this;
+ onMouseEnter (this, e);
+ }
+ if (Content != null){
+ if (Content.Parent != null) {
+ if (Content.MouseIsIn (e.Position)) {
+ Content.checkHoverWidget (e);
+ return;
+ }
+ }
}
+ base.checkHoverWidget (e);
}
#endregion
GraphicObject topc = null;
while (tmp is GraphicObject) {
topc = tmp;
- tmp = tmp.Parent as GraphicObject;
+ tmp = tmp.LogicalParent as GraphicObject;
}
int idxhw = GraphicTree.IndexOf (topc);
if (idxhw != 0) {
int i = 0;
while (i < idxhw) {
- if (GraphicTree [i].MouseIsIn (e.Position)) {
- while (HoverWidget != null) {
- if (HoverWidget is Popper) {
- if ((HoverWidget as Popper).Content == GraphicTree[i])
- break;
+ if (GraphicTree [i].localLogicalParentIsNull) {
+ if (GraphicTree [i].MouseIsIn (e.Position)) {
+ while (HoverWidget != null) {
+ HoverWidget.onMouseLeave (HoverWidget, e);
+ HoverWidget = HoverWidget.LogicalParent as GraphicObject;
}
- HoverWidget.onMouseLeave (HoverWidget, e);
- HoverWidget = HoverWidget.LogicalParent as GraphicObject;
- }
- GraphicTree [i].checkHoverWidget (e);
- return true;
+ GraphicTree [i].checkHoverWidget (e);
+ return true;
+ }
}
i++;
}