예제 #1
0
 private void UpdateState(Control control, InteractiveState state)
 {
     ProcessAnyLeftClick(control, state);
     ProcessAnyLeftRelease(control, state);
     ProcessAnyMovement(control, state);
     ProcessAnyDrag(state);
 }
예제 #2
0
 private void ProcessAnyLeftClick(Control control, InteractiveState state)
 {
     if (leftClick != Vector2D.Unused)
     {
         state.IsPressed = control.RotatedDrawAreaContains(leftClick);
     }
 }
예제 #3
0
		private void UpdateState(Control control, InteractiveState state)
		{
			ProcessAnyLeftClick(control, state);
			ProcessAnyLeftRelease(control, state);
			ProcessAnyMovement(control, state);
			ProcessAnyDrag(state);
		}
예제 #4
0
 private static void ClickControl(Control control, InteractiveState state)
 {
     state.IsPressed = false;
     control.Click();
     if (state.CanHaveFocus)
         state.WantsFocus = true;
 }
예제 #5
0
 private static void ClickControl(Control control, InteractiveState state)
 {
     control.Click();
     if (state.CanHaveFocus)
     {
         state.WantsFocus = true;
     }
 }
예제 #6
0
 private void ProcessAnyDrag(InteractiveState state)
 {
     if (dragStart == Vector2D.Unused)
     {
         return;
     }
     state.DragStart = dragStart;
     state.DragEnd   = dragEnd;
     state.DragDone  = dragDone;
 }
예제 #7
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);
        }
예제 #8
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;
 }
예제 #9
0
 private static void ResetDragForControl(InteractiveState state)
 {
     state.DragStart = Vector2D.Unused;
     state.DragEnd   = Vector2D.Unused;
     state.DragDone  = false;
 }
예제 #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;
		}
예제 #11
0
		private void ProcessAnyLeftClick(Control control, InteractiveState state)
		{
			if (leftClick != Vector2D.Unused)
				state.IsPressed = control.RotatedDrawAreaContains(leftClick);
		}
예제 #12
0
		private static void ResetDragForControl(InteractiveState state)
		{
			state.DragStart = Vector2D.Unused;
			state.DragEnd = Vector2D.Unused;
			state.DragDone = false;
		}
예제 #13
0
		private void ProcessAnyDrag(InteractiveState state)
		{
			if (dragStart == Vector2D.Unused)
				return;
			state.DragStart = dragStart;
			state.DragEnd = dragEnd;
			state.DragDone = dragDone;
		}
예제 #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);
		}
예제 #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;
		}