You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWATI/Include/iPlot/iPlotBase/Tools/ZxCompoundTool.h

71 lines
1.5 KiB
C++

#pragma once
#include "ZxSimpleTool.h"
/// 组合图形工具
class I_PLOTBASE_EXPORT ZxCompoundTool : public ZxTool
{
Q_OBJECT
public:
ZxCompoundTool();
~ZxCompoundTool();
public:
/// 在前面插入子工具
void prepend(ZxSimpleTool* pTool);
/// 在指定位置插入子工具
void insert(int pos, ZxSimpleTool* pTool);
/// 在后面追加子工具
void append(ZxSimpleTool* pTool);
/// 移除子工具
void remove(ZxSimpleTool* pTool);
virtual ZxSimpleTool* getLastActivateTool();
protected:
virtual bool onLeftDown(const QPointF& pt);
virtual bool onLeftUp(const QPointF& pt);
virtual bool onRightDown(const QPointF& pt);
virtual bool onRightUp(const QPointF& pt);
virtual bool onMouseMove(const QPointF& pt);
virtual bool onLeftDoubleClick(const QPointF& pt);
virtual bool onMouseWheel(const QPointF& pt, int delta);
virtual void onKeyPress(QKeyEvent* event);
virtual void onKeyRelease(QKeyEvent* event);
virtual void onSelectionChanged(ZxSelection& selection);
/// 绘制工具的拖曳线/拖曳框等临时的辅助元素
virtual void onPaint(QPainter* painter, const ZxPaintParam& param);
protected:
/// 在工具被激活时调用
virtual void onActivated();
/// 在工具被取消激活时调用
virtual void onDeactivated();
protected:
void _callOnActivated();
void _callOnDeactivated();
protected:
QVector<ZxSimpleTool *> m_vecSubTools;
QVector<ZxSimpleTool *> m_vecDownTools;
};