void hdCreationTool::mouseDown(hdMouseEvent &event)
{
	hdAbstractTool::mouseDown(event);
	if(event.LeftDown())
	{
		event.getView()->getDrawing()->add(figurePrototype);
		int x = event.GetPosition().x, y = event.GetPosition().y;
		figurePrototype->moveTo(event.getView()->getIdx(), x, y);
		event.getView()->getDrawing()->clearSelection();
		event.getView()->getDrawing()->addToSelection(figurePrototype);
	}
}
Esempio n. 2
0
void hdSelectAreaTool::mouseDown(hdMouseEvent &event)
{
	hdAbstractTool::mouseDown(event);
	if(!event.ShiftDown())
	{
		event.getView()->getDrawing()->clearSelection();
	}
	if(event.LeftDown())
	{
		int x = event.GetPosition().x, y = event.GetPosition().y;
		selectionRect.x = x;
		selectionRect.y = y;
		selectionRect.width = 0;
		selectionRect.height = 0;
		drawSelectionRect(event.getView());
	}
}
Esempio n. 3
0
void hdDragTrackerTool::mouseDown(hdMouseEvent &event)
{
	hdAbstractTool::mouseDown(event);

	if(event.LeftDown())
	{
		int x = event.GetPosition().x, y = event.GetPosition().y;

		setLastCoords(x, y);

		if(event.m_shiftDown)
		{
			event.getView()->getDrawing()->toggleSelection(anchorFigure);
		}
		else if(!event.getView()->getDrawing()->isFigureSelected(anchorFigure))
		{
			event.getView()->getDrawing()->clearSelection();
			event.getView()->getDrawing()->addToSelection(anchorFigure);
		}
	}
}