예제 #1
0
	public new void mouseDown(NSEvent evt)
	{
		NSPoint originalPoint = convertPoint_fromView(evt.locationInWindow(), null);
		
		if (m_selection.size != NSSize.Zero)
		{
			setNeedsDisplayInRect(m_selection);
			m_selection = NSRect.Empty;
		}
		
		do
		{
			evt = window().nextEventMatchingMask(Enums.NSLeftMouseDraggedMask | Enums.NSLeftMouseUpMask);
			autoscroll(evt);
			
			NSPoint currentPoint = convertPoint_fromView(evt.locationInWindow(), null);
			NSRect oldSelection = m_selection;
			m_selection = DoCreateSelectionRect(originalPoint, currentPoint);
			setNeedsDisplayInRect(m_selection.Union(oldSelection));
		}
		while (evt.type() == Enums.NSLeftMouseDragged);
		
		DoInvariant();
	}