Exemplo n.º 1
0
        private void FinishedResizeMoveMarks(ElementMoveType type)
        {
            //TODO This selected mark move thing needs help
            _timeLineGlobalEventManager.OnAlignmentActivity(new AlignmentEventArgs(false, null));

            _timeLineGlobalEventManager.OnMarkMoved(new MarksMovedEventArgs(_marksMoveResizeInfo, type));

            _marksMoveResizeInfo     = null;
            _moveResizeStartLocation = Point.Empty;
        }
Exemplo n.º 2
0
		protected override void OnMouseUp(MouseEventArgs e)
		{
			if (e.Clicks == 2)
			{
				// Add a mark
				OnClickedAtTime(new RulerClickedEventArgs(pixelsToTime(e.X) + VisibleTimeStart, Form.ModifierKeys, m_button));
			}
			else
			{
				if (m_button == MouseButtons.Left)
				{
					switch (m_mouseState)
					{
						case MouseState.Normal:
							break; // this is okay and will happen
						//throw new Exception("MouseUp in MouseState.Normal - WTF?");

						case MouseState.DragWait:
							// Didn't move enough to be considered dragging. Just a click.
							OnClickedAtTime(new RulerClickedEventArgs(pixelsToTime(e.X) + VisibleTimeStart, Form.ModifierKeys, m_button));
							break;

						case MouseState.Dragging:
							// Finished a time range drag.
							OnTimeRangeDragged(new ModifierKeysEventArgs(Form.ModifierKeys));
							break;
						case MouseState.DraggingMark:
							if (_marksSelectionManager.SelectedMarks.Any())
							{
								// Did we move the mark?
								if (e.X != m_mouseDownX)
								{
									_timeLineGlobalEventManager.OnMarkMoved(new MarksMovedEventArgs(_marksMoveResizeInfo, ElementMoveType.Move));
									_timeLineGlobalEventManager.OnAlignmentActivity(new AlignmentEventArgs(false, null));
								}
							}
							break;
						case MouseState.ResizeRuler:
							break;
						default:
							throw new Exception("Invalid MouseState. WTF?!");
					}
				}
				else if (m_button == MouseButtons.Right)
				{
					var marks = MarksAt(pixelsToTime(e.X) + VisibleTimeStart);
					if (marks.Any())
					{
						// See if we got a right-click on top of a mark.
						if (e.X == m_mouseDownX)
						{
							ContextMenuStrip c = new ContextMenuStrip();
							c.Renderer = new ThemeToolStripRenderer();
							c.Items.Add("&Delete Selected Marks");
							c.Click += DeleteMark_Click;
							c.Show(this, new Point(e.X, e.Y));
						}
					}
					// Otherwise, we've added a mark
					else
					{
						//TODO this is jenky and should be fixed to be more specific.
						OnClickedAtTime(new RulerClickedEventArgs(pixelsToTime(e.X) + VisibleTimeStart, Form.ModifierKeys, m_button));
					}
				}
			}
			m_mouseState = MouseState.Normal;
			m_button = MouseButtons.None;
			Invalidate();
		}