本文整理汇总了C++中hdMouseEvent::LeftIsDown方法的典型用法代码示例。如果您正苦于以下问题:C++ hdMouseEvent::LeftIsDown方法的具体用法?C++ hdMouseEvent::LeftIsDown怎么用?C++ hdMouseEvent::LeftIsDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hdMouseEvent
的用法示例。
在下文中一共展示了hdMouseEvent::LeftIsDown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseDrag
void hdDragCreationTool::mouseDrag(hdMouseEvent &event)
{
if(event.LeftIsDown())
{
figurePrototype->displayBox().SetPosition(event.getView()->getIdx(), event.GetPosition());
}
}
示例2: mouseDrag
void hdDragTrackerTool::mouseDrag(hdMouseEvent &event)
{
hdAbstractTool::mouseDrag(event);
if(event.LeftIsDown())
{
int x = event.GetPosition().x, y = event.GetPosition().y;
//Hack to avoid a weird bug that ocurrs when use double click very fast over figure and drag a same time, lastX
//and lastY values becomes big negatives numbers, if this happens, then reset it to click point
if(lastX < 0)
lastX = x;
if(lastY < 0)
lastY = y;
hasMovedValue = (abs (x - anchorX) > 4 || abs (y - anchorX) > 4);
if (hasMoved())
{
hdIFigure *tmp = NULL;
hdIteratorBase *iterator = event.getView()->getDrawing()->selectionFigures();
while(iterator->HasNext())
{
tmp = (hdIFigure *)iterator->Next();
tmp->moveBy(event.getView()->getIdx(), x - lastX, y - lastY);
event.getView()->notifyChanged();
}
delete iterator;
}
setLastCoords (x, y);
}
}
示例3: mouseDrag
void hdSelectAreaTool::mouseDrag(hdMouseEvent &event)
{
hdAbstractTool::mouseDrag(event);
if(event.LeftIsDown())
{
drawSelectionRect(event.getView());
int x = event.GetPosition().x, y = event.GetPosition().y;
selectionRect.x = anchorX;
selectionRect.y = anchorY;
selectionRect.SetBottomRight(wxPoint(x, y));
drawSelectionRect(event.getView());
event.getView()->ScrollToMakeVisible(event.GetPosition());
}
}