private void UpdateState(Control control, InteractiveState state)
 {
     ProcessAnyLeftClick(control, state);
     ProcessAnyLeftRelease(control, state);
     ProcessAnyMovement(control, state);
     ProcessAnyDrag(state);
 }
 private void ProcessAnyLeftClick(Control control, InteractiveState state)
 {
     if (leftClick != Vector2D.Unused)
     {
         state.IsPressed = control.RotatedDrawAreaContains(leftClick);
     }
 }
Example #3
0
		private void UpdateState(Control control, InteractiveState state)
		{
			ProcessAnyLeftClick(control, state);
			ProcessAnyLeftRelease(control, state);
			ProcessAnyMovement(control, state);
			ProcessAnyDrag(state);
		}
Example #4
0
 private static void ClickControl(Control control, InteractiveState state)
 {
     state.IsPressed = false;
     control.Click();
     if (state.CanHaveFocus)
         state.WantsFocus = true;
 }
 private static void ClickControl(Control control, InteractiveState state)
 {
     control.Click();
     if (state.CanHaveFocus)
     {
         state.WantsFocus = true;
     }
 }
 private void ProcessAnyDrag(InteractiveState state)
 {
     if (dragStart == Vector2D.Unused)
     {
         return;
     }
     state.DragStart = dragStart;
     state.DragEnd   = dragEnd;
     state.DragDone  = dragDone;
 }
        private void ProcessAnyMovement(Control control, InteractiveState state)
        {
            if (movement == Vector2D.Unused)
            {
                return;
            }
            state.IsInside = control.RotatedDrawAreaContains(movement);
            Vector2D rotatedMovement = control.Rotation == 0.0f
                                ? movement : movement.RotateAround(control.RotationCenter, -control.Rotation);

            state.RelativePointerPosition = control.DrawArea.GetRelativePoint(rotatedMovement);
        }
 private void ProcessAnyLeftRelease(Control control, InteractiveState state)
 {
     if (leftRelease == Vector2D.Unused)
     {
         return;
     }
     if (state.IsPressed && control.RotatedDrawAreaContains(leftRelease) && control.IsVisible)
     {
         ClickControl(control, state);
     }
     state.IsPressed = false;
 }
 private static void ResetDragForControl(InteractiveState state)
 {
     state.DragStart = Vector2D.Unused;
     state.DragEnd   = Vector2D.Unused;
     state.DragDone  = false;
 }
Example #10
0
		private void ProcessAnyLeftRelease(Control control, InteractiveState state)
		{
			if (leftRelease == Vector2D.Unused)
				return;
			if (state.IsPressed && control.RotatedDrawAreaContains(leftRelease) && control.IsVisible)
				ClickControl(control, state);
			state.IsPressed = false;
		}
Example #11
0
		private void ProcessAnyLeftClick(Control control, InteractiveState state)
		{
			if (leftClick != Vector2D.Unused)
				state.IsPressed = control.RotatedDrawAreaContains(leftClick);
		}
Example #12
0
		private static void ResetDragForControl(InteractiveState state)
		{
			state.DragStart = Vector2D.Unused;
			state.DragEnd = Vector2D.Unused;
			state.DragDone = false;
		}
Example #13
0
		private void ProcessAnyDrag(InteractiveState state)
		{
			if (dragStart == Vector2D.Unused)
				return;
			state.DragStart = dragStart;
			state.DragEnd = dragEnd;
			state.DragDone = dragDone;
		}
Example #14
0
		private void ProcessAnyMovement(Control control, InteractiveState state)
		{
			if (movement == Vector2D.Unused)
				return;
			state.IsInside = control.RotatedDrawAreaContains(movement);
			Vector2D rotatedMovement = control.Rotation == 0.0f
				? movement : movement.RotateAround(control.RotationCenter, -control.Rotation);
			state.RelativePointerPosition = control.DrawArea.GetRelativePoint(rotatedMovement);
		}
Example #15
0
		private static InteractiveState LoadInteractiveState(BinaryReader reader)
		{
			var state = new InteractiveState
			{
				IsInside = reader.ReadBoolean(),
				IsPressed = reader.ReadBoolean(),
				IsSelected = reader.ReadBoolean(),
				RelativePointerPosition = new Vector2D(reader.ReadSingle(), reader.ReadSingle()),
				CanHaveFocus = reader.ReadBoolean(),
				HasFocus = reader.ReadBoolean(),
				WantsFocus = reader.ReadBoolean(),
				DragStart = new Vector2D(reader.ReadSingle(), reader.ReadSingle()),
				DragEnd = new Vector2D(reader.ReadSingle(), reader.ReadSingle()),
				DragDone = reader.ReadBoolean()
			};
			return state;
		}