本文整理汇总了C++中hdMouseEvent::LeftDown方法的典型用法代码示例。如果您正苦于以下问题:C++ hdMouseEvent::LeftDown方法的具体用法?C++ hdMouseEvent::LeftDown怎么用?C++ hdMouseEvent::LeftDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hdMouseEvent
的用法示例。
在下文中一共展示了hdMouseEvent::LeftDown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseDown
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);
}
}
示例2: mouseDown
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());
}
}
示例3: mouseDown
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);
}
}
}