qucs_s/qucs/mouseactions.h

132 lines
5.0 KiB
C
Raw Normal View History

2006-03-28 06:10:52 +00:00
/***************************************************************************
mouseactions.h
----------------
begin : Thu Aug 28 2003
copyright : (C) 2003 by Michael Margraf
email : michael.margraf@alumni.tu-berlin.de
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef MOUSEACTIONS_H
#define MOUSEACTIONS_H
#include "element.h"
2023-01-17 13:27:12 +03:00
#include <QAction>
2006-03-28 06:10:52 +00:00
#include <qt3_compat/qt_compat.h>
2006-03-28 06:10:52 +00:00
class Wire;
class WireLabel;
2006-03-28 06:10:52 +00:00
class Schematic;
class Diagram;
2006-03-28 06:10:52 +00:00
class QPainter;
2014-11-03 21:02:58 +08:00
class QMenu;
2006-03-28 06:10:52 +00:00
class QMouseEvent;
2014-02-07 15:04:12 +00:00
class QucsApp;
2006-03-28 06:10:52 +00:00
2007-02-27 07:04:18 +00:00
extern QAction *formerAction;
2006-03-28 06:10:52 +00:00
class MouseActions {
public:
2014-02-07 15:04:12 +00:00
MouseActions(QucsApp*);
2006-03-28 06:10:52 +00:00
virtual ~MouseActions();
2024-01-18 12:28:33 +03:00
static void setPainter(Schematic*);
2006-03-28 06:10:52 +00:00
bool pasteElements(Schematic*);
void editElement(Schematic*, QMouseEvent*);
void editLabel(Schematic*, WireLabel*);
Element *selElem; // component/diagram/painting selected in IconView
Element *focusElement;
QMouseEvent *focusMEvent;
int MAx1, MAy1,MAx2, MAy2, MAx3, MAy3; // cache for mouse movements
QList<Element*> movingElements;
int movingRotated;
2006-03-28 06:10:52 +00:00
// menu appearing by right mouse button click on component
2014-11-03 21:02:58 +08:00
QMenu *ComponentMenu;
2006-03-28 06:10:52 +00:00
private:
bool isMoveEqual;
2014-02-07 15:04:12 +00:00
QucsApp* App;
2006-03-28 06:10:52 +00:00
Diagram* pActiveDiagram = nullptr;
QPointF mouseDownPoint;
QPointF mouseUpPoint;
2006-03-28 06:10:52 +00:00
// -------------------------------------------------------------------
public:
void MMoveSelect(Schematic*, QMouseEvent*);
void MMoveElement(Schematic*, QMouseEvent*);
void MMoveWire1(Schematic*, QMouseEvent*);
void MMoveWire2(Schematic*, QMouseEvent*);
void MMoveMoving(Schematic*, QMouseEvent*);
void MMoveMoving2(Schematic*, QMouseEvent*);
void MMovePaste(Schematic*, QMouseEvent*);
void MMoveDelete(Schematic*, QMouseEvent*);
void MMoveLabel(Schematic*, QMouseEvent*);
void MMoveMarker(Schematic*, QMouseEvent*);
void MMoveSetLimits(Schematic*, QMouseEvent*);
2006-03-28 06:10:52 +00:00
void MMoveMirrorY(Schematic*, QMouseEvent*);
void MMoveMirrorX(Schematic*, QMouseEvent*);
void MMoveRotate(Schematic*, QMouseEvent*);
void MMoveActivate(Schematic*, QMouseEvent*);
void MMoveOnGrid(Schematic*, QMouseEvent*);
void MMoveResizePainting(Schematic*, QMouseEvent*);
void MMoveMoveText(Schematic*, QMouseEvent*);
void MMoveMoveTextB(Schematic*, QMouseEvent*);
void MMoveZoomIn(Schematic*, QMouseEvent*);
2006-11-06 06:58:05 +00:00
void MMoveScrollBar(Schematic*, QMouseEvent*);
2006-03-28 06:10:52 +00:00
2007-02-08 07:04:54 +00:00
void MPressSelect(Schematic*, QMouseEvent*, float, float);
void MPressTune(Schematic *Doc, QMouseEvent *Event, float fX, float fY);
2007-02-08 07:04:54 +00:00
void MPressDelete(Schematic*, QMouseEvent*, float, float);
void MPressActivate(Schematic*, QMouseEvent*, float, float);
void MPressMirrorX(Schematic*, QMouseEvent*, float, float);
void MPressMirrorY(Schematic*, QMouseEvent*, float, float);
void MPressRotate(Schematic*, QMouseEvent*, float, float);
void MPressElement(Schematic*, QMouseEvent*, float, float);
void MPressLabel(Schematic*, QMouseEvent*, float, float);
void MPressWire1(Schematic*, QMouseEvent*, float, float);
void MPressWire2(Schematic*, QMouseEvent*, float, float);
void MPressPainting(Schematic*, QMouseEvent*, float, float);
void MPressMarker(Schematic*, QMouseEvent*, float, float);
void MPressSetLimits(Schematic*, QMouseEvent*, float, float);
2007-02-08 07:04:54 +00:00
void MPressOnGrid(Schematic*, QMouseEvent*, float, float);
void MPressMoveText(Schematic*, QMouseEvent*, float, float);
void MPressZoomIn(Schematic*, QMouseEvent*, float, float);
2006-03-28 06:10:52 +00:00
void MDoubleClickSelect(Schematic*, QMouseEvent*);
void MDoubleClickWire2(Schematic*, QMouseEvent*);
void MReleaseSelect(Schematic*, QMouseEvent*);
void MReleaseSelect2(Schematic*, QMouseEvent*);
void MReleaseActivate(Schematic*, QMouseEvent*);
void MReleaseMoving(Schematic*, QMouseEvent*);
void MReleaseResizeDiagram(Schematic*, QMouseEvent*);
void MReleasePaste(Schematic*, QMouseEvent*);
void MReleaseResizePainting(Schematic*, QMouseEvent*);
void MReleaseMoveText(Schematic*, QMouseEvent*);
void MReleaseZoomIn(Schematic*, QMouseEvent*);
void MReleaseSetLimits(Schematic*, QMouseEvent*);
2006-03-28 06:10:52 +00:00
void paintElementsScheme(Schematic*);
void rotateElements(Schematic*, int&, int&);
void moveElements(Schematic*, int&, int&);
static void moveElements(QList<Element*>*, int, int);
void endElementMoving(Schematic*, QList<Element*>*);
2007-02-08 07:04:54 +00:00
void rightPressMenu(Schematic*, QMouseEvent*, float, float);
2006-03-28 06:10:52 +00:00
};
#endif