当前位置: 首页>>代码示例>>C++>>正文


C++ hdMouseEvent::getView方法代码示例

本文整理汇总了C++中hdMouseEvent::getView方法的典型用法代码示例。如果您正苦于以下问题:C++ hdMouseEvent::getView方法的具体用法?C++ hdMouseEvent::getView怎么用?C++ hdMouseEvent::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hdMouseEvent的用法示例。


在下文中一共展示了hdMouseEvent::getView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例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: 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

示例4: 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

示例5: 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

示例6: mouseDrag

void hdDragCreationTool::mouseDrag(hdMouseEvent &event)
{
	if(event.LeftIsDown())
	{
		figurePrototype->displayBox().SetPosition(event.getView()->getIdx(), event.GetPosition());
	}
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:7,代码来源:hdDragCreationTool.cpp

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: mouseDrag

void hdHandleTrackerTool::mouseDrag(hdMouseEvent &event)
{
	anchorHandle->invokeStep(event, event.getView());
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:4,代码来源:hdHandleTrackerTool.cpp

示例13: mouseUp

void hdHandleTrackerTool::mouseUp(hdMouseEvent &event)
{
	anchorHandle->invokeEnd(event, event.getView());
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:4,代码来源:hdHandleTrackerTool.cpp

示例14: mouseDown

void hdHandleTrackerTool::mouseDown(hdMouseEvent &event)
{
	hdAbstractTool::mouseDown(event);
	anchorHandle->invokeStart(event, event.getView());
}
开发者ID:KrisShannon,项目名称:pgadmin3,代码行数:5,代码来源:hdHandleTrackerTool.cpp

示例15: mouseDown

void hdSimpleTextTool::mouseDown(hdMouseEvent &event)
{
	setAnchorCoords(event.GetPosition().x, event.GetPosition().y);

	// Right click to get the contextual menu
	if(txtFigure->menuEnabled() && event.RightDown())
	{
		wxMenu menu;
		event.getView()->setSimpleTextToolFigure(txtFigure, true);
		txtFigure->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;
	}

	// Double click to rename an object
	if(event.LeftDClick())
	{
		if(withoutDialog)
		{
			event.getView()->setSimpleTextToolFigure(txtFigure);
			showEdit = true;
			event.getView()->getSimpleTextToolEdit()->ChangeValue(txtFigure->getText()); //Same as SetValue but don't generated wxEVT_COMMAND_TEXT_UPDATED event
			calculateSizeEntry(event.getView());
			event.getView()->getSimpleTextToolEdit()->SetFocus();
			event.getView()->getSimpleTextToolEdit()->Show();
			event.getView()->getOkTxt()->Show();
			event.getView()->getCancelTxt()->Show();
		}
		else
		{
			callDialog(event.getView());
		}
		return;
	}
	getDefaultTool()->mouseDown(event);
}
开发者ID:mintsoft,项目名称:pgadmin3,代码行数:39,代码来源:hdSimpleTextTool.cpp


注:本文中的hdMouseEvent::getView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。