private void MouseEvents(UIMouseEventType evt, UpdateState state)
{
switch (evt)
{
case UIMouseEventType.MouseOver:
Master.HoverPrim = this;
break;
case UIMouseEventType.MouseOut:
if (Master.HoverPrim == this)
{
Master.HoverPrim = null;
}
break;
case UIMouseEventType.MouseDown:
state.InputManager.SetFocus(null);
Master.Select(this);
if (DoubleClickTime > 0 && Type == TREEBoxType.Primitive && Descriptor is SubroutineDescriptor)
{
var subD = (SubroutineDescriptor)Descriptor;
FSO.Client.Debug.IDEHook.IDE.IDEOpenBHAV(Master.Scope.GetBHAV(subD.PrimID), Master.Scope.Object);
}
DoubleClickTime = 25;
m_doDrag = true;
var position = this.GetMousePosition(state.MouseState);
m_doResize = Resizable && position.X > Width - 10 && position.Y > Height - 10;
m_dragOffsetX = position.X;
m_dragOffsetY = position.Y;
break;
case UIMouseEventType.MouseUp:
m_doDrag = false; //should probably just release when mouse is up in any case.
Master.Editor.QueueCommand(new UpdateBoxPosCommand(this));
if (TextEdit != null)
{
state.InputManager.SetFocus(TextEdit);
}
break;
default:
break;
}
if ((evt == UIMouseEventType.MouseOut || evt == UIMouseEventType.MouseOver) && CommentNode != null)
{
CommentNode.MouseEvent(evt, state);
}
}