本文整理汇总了C++中hdMouseEvent类的典型用法代码示例。如果您正苦于以下问题:C++ hdMouseEvent类的具体用法?C++ hdMouseEvent怎么用?C++ hdMouseEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了hdMouseEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: mouseUp
void hdSelectAreaTool::mouseUp(hdMouseEvent &event)
{
hdAbstractTool::mouseUp(event);
hdGeometry g;
//hack-fix for bug when selecting figures from right to left
if(event.LeftUp())
{
if( selectionRect.width < 0 )
{
int tmp;
tmp = selectionRect.width;
selectionRect.x += tmp;
selectionRect.width = g.ddabs(tmp);
}
if( selectionRect.height < 0 )
{
int tmp;
tmp = selectionRect.height;
selectionRect.y += tmp;
selectionRect.height = g.ddabs(tmp);
}
//end hack-fix
drawSelectionRect(event.getView());
selectFiguresOnRect(event.ShiftDown(), event.getView());
event.getView()->disableSelRectDraw();
}
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:28,代码来源:hdSelectAreaTool.cpp
示例2: mouseDown
void hdSelectionTool::mouseDown(hdMouseEvent &event)
{
hdITool::mouseDown(event);
hdDrawingView *view = event.getView();
int x = event.GetPosition().x, y = event.GetPosition().y;
hdIHandle *handle = view->findHandle(view->getIdx(), x, y);
if(handle)
{
setDelegateTool(view, new hdHandleTrackerTool(view, handle));
}
else
{
hdIFigure *figure = view->getDrawing()->findFigure(view->getIdx(), x, y);
if(figure)
{
view->getDrawing()->bringToFront(figure);
setDelegateTool(event.getView(), figure->CreateFigureTool(view, new hdDragTrackerTool(view, figure)));
}
else
{
setDelegateTool(event.getView(), new hdCanvasMenuTool(view, new hdSelectAreaTool(view)) );
}
}
hdITool *delegateTool = getDelegateTool();
if (delegateTool)
delegateTool->mouseDown(event);
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:30,代码来源:hdSelectionTool.cpp
示例3: mouseDrag
void hdDragCreationTool::mouseDrag(hdMouseEvent &event)
{
if(event.LeftIsDown())
{
figurePrototype->displayBox().SetPosition(event.getView()->getIdx(), event.GetPosition());
}
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:7,代码来源:hdDragCreationTool.cpp
示例4: invokeStep
void hdPolyLineHandle::invokeStep(hdMouseEvent &event, hdDrawingView *view)
{
int x = event.GetPosition().x, y = event.GetPosition().y;
((hdPolyLineFigure *) getOwner())->setPointAt(view->getIdx(), indx, x, y);
view->notifyChanged();
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:7,代码来源:hdPolyLineHandle.cpp
示例5: invokeStep
void ddSouthTableSizeHandle::invokeStep(hdMouseEvent &event, hdDrawingView *view)
{
int y = event.GetPosition().y;
ddTableFigure *table = (ddTableFigure *) getOwner();
wxFont font = *hdFontAttribute::defaultFont;
int colOffset = table->getColDefaultHeight(font);
int divBy = (table->getTotalColumns() - table->getColumnsWindow());
if(divBy <= 0)
divBy = table->getColumnsWindow();
hdGeometry g;
if ( g.ddabs(anchorY - y) > colOffset)
{
if((anchorY - y) > 0)
{
table->setColumnsWindow(view->getIdx(), table->getColumnsWindow() - 1);
}
else
{
table->setColumnsWindow(view->getIdx(), table->getColumnsWindow() + 1);
}
anchorY = y;
}
//hack to update relationship position when table size change
table->manuallyNotifyChange(view->getIdx());
view->notifyChanged();
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:29,代码来源:ddSouthTableSizeHandle.cpp
示例6: ddRelationshipFigure
void ddAddFkButtonHandle::invokeStart(hdMouseEvent &event, hdDrawingView *view)
{
if(getOwner()->ms_classInfo.IsKindOf(&ddTableFigure::ms_classInfo))
{
ddRelationshipFigure *fkConnection = new ddRelationshipFigure();
//Check figure available positions for diagrams, add at least needed to allow initialization of the class
int i, start;
start = fkConnection->displayBox().CountPositions();
for(i = start; i < (view->getIdx() + 1); i++)
{
fkConnection->AddPosForNewDiagram();
}
fkConnection->setStartTerminal(new ddRelationshipTerminal(fkConnection, false));
fkConnection->setEndTerminal(new ddRelationshipTerminal(fkConnection, true));
hdConnectionCreationTool *conn = new hdConnectionCreationTool(view, fkConnection);
view->setTool(conn);
// Simulate button down to start connection of foreign key
wxMouseEvent e(wxEVT_LEFT_DOWN);
e.m_x = event.GetPosition().x;
e.m_y = event.GetPosition().y;
e.SetEventObject(view);
hdMouseEvent evento(e, view);
conn->mouseDown(evento);
ddTableFigure *table = (ddTableFigure *) getOwner();
table->setSelectFkDestMode(true);
view->notifyChanged();
}
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:28,代码来源:ddAddFkButtonHandle.cpp
示例7: invokeEnd
void hdLineConnectionHandle::invokeEnd(hdMouseEvent &event, hdDrawingView *view)
{
int x = event.GetPosition().x, y = event.GetPosition().y;
hdPolyLineFigure *figure = (hdPolyLineFigure *) getOwner();
//eliminate all handles in the middle of a straight line
if( figure->pointCount(view->getIdx()) > 2 && getIndex() != 0 && getIndex() != (figure->pointCount(view->getIdx()) - 1) )
{
hdPoint p1 = figure->pointAt(view->getIdx(), getIndex() - 1);
hdPoint p2 = figure->pointAt(view->getIdx(), getIndex() + 1);
hdGeometry g;
if(g.lineContainsPoint(p1.x, p1.y, p2.x, p2.y, x, y))
{
figure->removePointAt(view->getIdx(), getIndex());
}
}
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:17,代码来源:hdLineConnectionHandle.cpp
示例8: invokeStart
void hdPolyLineHandle::invokeStart(hdMouseEvent &event, hdDrawingView *view)
{
if(event.RightDown())
{
((hdPolyLineFigure *) getOwner())->removePointAt(view->getIdx(), indx);
view->notifyChanged();
}
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:8,代码来源:hdPolyLineHandle.cpp
示例9: invokeStart
void ddScrollBarHandle::invokeStart(hdMouseEvent &event, hdDrawingView *view)
{
int idx = view->getIdx();
int y = event.GetPosition().y;
anchorY = y;
if( (y > (getDisplayBox(idx).GetPosition().y + 2)) && (y < (getDisplayBox(idx).GetPosition().y + 2 + 6)) ) //6 image height
table->columnsWindowUp(idx);
if( (y > (getDisplayBox(idx).GetPosition().y + getDisplayBox(idx).height - 2 - downBitmap.GetHeight()) ) && (y < (getDisplayBox(idx).GetPosition().y + getDisplayBox(idx).height - 2) ) )
table->columnsWindowDown(idx);
view->notifyChanged();
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:12,代码来源:ddScrollBarHandle.cpp
示例10: 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);
}
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:32,代码来源:hdDragTrackerTool.cpp
示例11: 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);
}
}
开发者ID:FabianCollaguazo,项目名称:pgadmin3,代码行数:12,代码来源:hdCreationTool.cpp
示例12: mouseDown
void hdCanvasMenuTool::mouseDown(hdMouseEvent &event)
{
//Linux hack for bug
int x = event.GetPosition().x, y = event.GetPosition().y;
setAnchorCoords(x, y);
if(event.RightDown())
{
wxMenu menu;
event.getView()->setCanvasMenuTool(this);
createViewMenu(event.getView(), menu);
event.getView()->connectPopUpMenu(menu);
hdPoint p = event.GetPosition();
event.getView()->CalcScrolledPosition(p.x, p.y, &p.x, &p.y);
event.getView()->PopupMenu(&menu, p);
return;
}
defaultTool->mouseDown(event);
}
开发者ID:mintsoft,项目名称:pgadmin3,代码行数:20,代码来源:hdCanvasMenuTool.cpp
示例13: mouseMove
void hdSelectionTool::mouseMove(hdMouseEvent &event)
{
hdAbstractTool::mouseMove(event);
hdDrawingView *view = event.getView();
int x = event.GetPosition().x, y = event.GetPosition().y;
hdIHandle *handle = view->findHandle(view->getIdx(), x, y);
if(handle)
{
view->SetCursor(handle->createCursor());
}
else
{
hdIFigure *figure = view->getDrawing()->findFigure(view->getIdx(), x, y);
if(figure)
{
view->SetCursor(wxCursor(wxCURSOR_HAND));
}
else
{
view->SetCursor(wxCursor(wxCURSOR_ARROW));
}
}
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:24,代码来源:hdSelectionTool.cpp
示例14: 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());
}
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:14,代码来源:hdSelectAreaTool.cpp
示例15: mouseDown
void hdMenuTool::mouseDown(hdMouseEvent &event)
{
//Linux hack for bug
int x = event.GetPosition().x, y = event.GetPosition().y;
setAnchorCoords(x, y);
if(menuFigure->menuEnabled() && event.RightDown())
{
wxMenu menu;
event.getView()->setMenuToolFigure(menuFigure);
menuFigure->createMenu(menu);
event.getView()->connectPopUpMenu(menu);
hdPoint p = event.GetPosition();
event.getView()->CalcScrolledPosition(p.x, p.y, &p.x, &p.y);
event.getView()->PopupMenu(&menu, p);
return;
}
getDefaultTool()->mouseDown(event);
}
开发者ID:douglasresende,项目名称:pgadmin3,代码行数:20,代码来源:hdMenuTool.cpp
示例16: 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());
}
}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:17,代码来源:hdSelectAreaTool.cpp
示例17: 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);
}
}
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:21,代码来源:hdDragTrackerTool.cpp
示例18: invokeStep
void ddScrollBarHandle::invokeStep(hdMouseEvent &event, hdDrawingView *view)
{
int y = event.GetPosition().y;
int divBy = (table->getTotalColumns() - table->getColumnsWindow());
if(divBy <= 0)
divBy = table->getColumnsWindow();
int colOffset = barSize.GetHeight() / divBy;
hdGeometry g;
if ( g.ddabs(anchorY - y) > colOffset)
{
if((anchorY - y) > 0)
{
table->columnsWindowUp(view->getIdx());
}
else
{
table->columnsWindowDown(view->getIdx());
}
anchorY = y;
}
view->notifyChanged();
}
开发者ID:GHnubsST,项目名称:pgadmin3,代码行数:23,代码来源:ddScrollBarHandle.cpp
示例19: mouseUp
void hdCreationTool::mouseUp(hdMouseEvent &event)
{
hdAbstractTool::mouseUp(event);
event.getView()->setTool(new hdSelectionTool(event.getView()));
}
开发者ID:FabianCollaguazo,项目名称:pgadmin3,代码行数:5,代码来源:hdCreationTool.cpp
示例20: invokeStart
void ddSouthTableSizeHandle::invokeStart(hdMouseEvent &event, hdDrawingView *view)
{
anchorY = event.GetPosition().y;
}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:4,代码来源:ddSouthTableSizeHandle.cpp
注:本文中的hdMouseEvent类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论