Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mouseactions.h
Go to the documentation of this file.
1 /***************************************************************************
2  mouseactions.h
3  ----------------
4  begin : Thu Aug 28 2003
5  copyright : (C) 2003 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef MOUSEACTIONS_H
19 #define MOUSEACTIONS_H
20 
21 #include "element.h"
22 
23 #include <Q3PtrList>
24 //Added by qt3to4:
25 #include <QMouseEvent>
26 #include <Q3PopupMenu>
27 
28 
29 class Wire;
30 class Schematic;
31 class QPainter;
32 class Q3PopupMenu;
33 class QMouseEvent;
34 class QucsApp;
35 
36 extern QAction *formerAction;
37 
38 
39 class MouseActions {
40 public:
42  virtual ~MouseActions();
43 
44  void setPainter(Schematic*);
45  bool pasteElements(Schematic*);
46  void editElement(Schematic*, QMouseEvent*);
47  void editLabel(Schematic*, WireLabel*);
48 
49  bool drawn; // indicates whether the scheme element was drawn last time
50  Element *selElem; // component/diagram/painting selected in IconView
52  QMouseEvent *focusMEvent;
53 
54  int MAx1, MAy1,MAx2, MAy2, MAx3, MAy3; // cache for mouse movements
55  Q3PtrList<Element> movingElements;
57 
58  // menu appearing by right mouse button click on component
59  Q3PopupMenu *ComponentMenu;
60 
61 private:
64 
65  // -------------------------------------------------------------------
66 public:
67  void MMoveSelect(Schematic*, QMouseEvent*);
68  void MMoveElement(Schematic*, QMouseEvent*);
69  void MMoveWire1(Schematic*, QMouseEvent*);
70  void MMoveWire2(Schematic*, QMouseEvent*);
71  void MMoveMoving(Schematic*, QMouseEvent*);
72  void MMoveMoving2(Schematic*, QMouseEvent*);
73  void MMovePaste(Schematic*, QMouseEvent*);
74  void MMoveDelete(Schematic*, QMouseEvent*);
75  void MMoveLabel(Schematic*, QMouseEvent*);
76  void MMoveMarker(Schematic*, QMouseEvent*);
77  void MMoveMirrorY(Schematic*, QMouseEvent*);
78  void MMoveMirrorX(Schematic*, QMouseEvent*);
79  void MMoveRotate(Schematic*, QMouseEvent*);
80  void MMoveActivate(Schematic*, QMouseEvent*);
81  void MMoveOnGrid(Schematic*, QMouseEvent*);
82  void MMoveResizePainting(Schematic*, QMouseEvent*);
83  void MMoveMoveText(Schematic*, QMouseEvent*);
84  void MMoveMoveTextB(Schematic*, QMouseEvent*);
85  void MMoveZoomIn(Schematic*, QMouseEvent*);
86  void MMoveScrollBar(Schematic*, QMouseEvent*);
87 
88  void MPressSelect(Schematic*, QMouseEvent*, float, float);
89  void MPressDelete(Schematic*, QMouseEvent*, float, float);
90  void MPressActivate(Schematic*, QMouseEvent*, float, float);
91  void MPressMirrorX(Schematic*, QMouseEvent*, float, float);
92  void MPressMirrorY(Schematic*, QMouseEvent*, float, float);
93  void MPressRotate(Schematic*, QMouseEvent*, float, float);
94  void MPressElement(Schematic*, QMouseEvent*, float, float);
95  void MPressLabel(Schematic*, QMouseEvent*, float, float);
96  void MPressWire1(Schematic*, QMouseEvent*, float, float);
97  void MPressWire2(Schematic*, QMouseEvent*, float, float);
98  void MPressPainting(Schematic*, QMouseEvent*, float, float);
99  void MPressMarker(Schematic*, QMouseEvent*, float, float);
100  void MPressOnGrid(Schematic*, QMouseEvent*, float, float);
101  void MPressMoveText(Schematic*, QMouseEvent*, float, float);
102  void MPressZoomIn(Schematic*, QMouseEvent*, float, float);
103 
104  void MDoubleClickSelect(Schematic*, QMouseEvent*);
105  void MDoubleClickWire2(Schematic*, QMouseEvent*);
106 
107  void MReleaseSelect(Schematic*, QMouseEvent*);
108  void MReleaseSelect2(Schematic*, QMouseEvent*);
109  void MReleaseActivate(Schematic*, QMouseEvent*);
110  void MReleaseMoving(Schematic*, QMouseEvent*);
111  void MReleaseResizeDiagram(Schematic*, QMouseEvent*);
112  void MReleasePaste(Schematic*, QMouseEvent*);
113  void MReleaseResizePainting(Schematic*, QMouseEvent*);
114  void MReleaseMoveText(Schematic*, QMouseEvent*);
115  void MReleaseZoomIn(Schematic*, QMouseEvent*);
116 
118  void rotateElements(Schematic*, int&, int&);
119  void moveElements(Schematic*, int&, int&);
120  void moveElements(Q3PtrList<Element>*, int, int);
121  void endElementMoving(Schematic*, Q3PtrList<Element>*);
122  void rightPressMenu(Schematic*, QMouseEvent*, float, float);
123 };
124 
125 #endif
void MPressElement(Schematic *, QMouseEvent *, float, float)
Defines drawing elements for schematics.
void MMoveLabel(Schematic *, QMouseEvent *)
MouseActions::MMoveLabel Paints a label above the mouse cursor for "set wire label".
bool isMoveEqual
Definition: mouseactions.h:62
void rotateElements(Schematic *, int &, int &)
void MMoveMoving2(Schematic *, QMouseEvent *)
void MMoveMoving(Schematic *, QMouseEvent *)
void MMoveActivate(Schematic *, QMouseEvent *)
MouseActions::MMoveActivate Paints a crossed box mouse cursor to "(de)activate" components.
virtual ~MouseActions()
void MReleaseSelect2(Schematic *, QMouseEvent *)
Definition: wire.h:31
void MMoveMirrorY(Schematic *, QMouseEvent *)
MouseActions::MMoveMirrorX Paints rounded "mirror about y axis" mouse cursor.
void MMoveElement(Schematic *, QMouseEvent *)
void editElement(Schematic *, QMouseEvent *)
void MMoveMirrorX(Schematic *, QMouseEvent *)
MouseActions::MMoveMirrorX Paints rounded "mirror about x axis" mouse cursor.
void MPressActivate(Schematic *, QMouseEvent *, float, float)
void MMoveOnGrid(Schematic *, QMouseEvent *)
MouseActions::MMoveOnGrid Paints a grid beside the mouse cursor, put "on grid" mode.
void MMoveMoveTextB(Schematic *, QMouseEvent *)
MouseActions::MMoveMoveTextB Paints mouse symbol for "move component text" mode.
void MPressLabel(Schematic *, QMouseEvent *, float, float)
void MPressMirrorX(Schematic *, QMouseEvent *, float, float)
Q3PopupMenu * ComponentMenu
Definition: mouseactions.h:59
void MMoveRotate(Schematic *, QMouseEvent *)
MouseActions::MMoveMirrorX Paints "rotate" mouse cursor.
void MReleaseMoveText(Schematic *, QMouseEvent *)
void endElementMoving(Schematic *, Q3PtrList< Element > *)
Element * focusElement
Definition: mouseactions.h:51
void MPressDelete(Schematic *, QMouseEvent *, float, float)
void MPressMarker(Schematic *, QMouseEvent *, float, float)
Q3PtrList< Element > movingElements
Definition: mouseactions.h:55
void MMoveResizePainting(Schematic *, QMouseEvent *)
void MMoveScrollBar(Schematic *, QMouseEvent *)
MouseActions(QucsApp *)
void MPressWire1(Schematic *, QMouseEvent *, float, float)
MouseActions::MPressWire1 Is called if starting point of wire is pressed.
void MMoveWire1(Schematic *, QMouseEvent *)
MouseActions::MMoveWire1 Paint hair cross for "insert wire" mode.
void MReleaseResizePainting(Schematic *, QMouseEvent *)
void MMovePaste(Schematic *, QMouseEvent *)
MouseActions::MMovePaste Moves components after paste from clipboard.
void setPainter(Schematic *)
QucsApp * App
Definition: mouseactions.h:63
void MReleaseSelect(Schematic *, QMouseEvent *)
void MMoveMarker(Schematic *, QMouseEvent *)
MouseActions::MMoveMarker Paints a triangle above the mouse for "set marker on graph".
void MReleaseActivate(Schematic *, QMouseEvent *)
void MPressOnGrid(Schematic *, QMouseEvent *, float, float)
Element * selElem
Definition: mouseactions.h:50
void MMoveSelect(Schematic *, QMouseEvent *)
MouseActions::MMoveSelect Paints a rectangle for select area.
void MPressRotate(Schematic *, QMouseEvent *, float, float)
Superclass of all schematic drawing elements.
Definition: element.h:142
void MReleaseMoving(Schematic *, QMouseEvent *)
void MMoveMoveText(Schematic *, QMouseEvent *)
MouseActions::MMoveMoveText Paint rectangle around component text being mouse moved.
void MPressPainting(Schematic *, QMouseEvent *, float, float)
void editLabel(Schematic *, WireLabel *)
void MDoubleClickWire2(Schematic *, QMouseEvent *)
MouseActions::MDoubleClickWire2 Double click terminates wire insertion.
void MMoveDelete(Schematic *, QMouseEvent *)
MouseActions::MMoveDelete Paints a cross under the mouse cursor to show the delete mode...
void MPressWire2(Schematic *, QMouseEvent *, float, float)
MouseActions::MPressWire2 Is called if ending point of wire is pressed.
void MReleasePaste(Schematic *, QMouseEvent *)
void MPressMoveText(Schematic *, QMouseEvent *, float, float)
void paintElementsScheme(Schematic *)
void MReleaseZoomIn(Schematic *, QMouseEvent *)
bool pasteElements(Schematic *)
void moveElements(Schematic *, int &, int &)
Definition: qucs.h:61
void MPressMirrorY(Schematic *, QMouseEvent *, float, float)
void rightPressMenu(Schematic *, QMouseEvent *, float, float)
void MDoubleClickSelect(Schematic *, QMouseEvent *)
QMouseEvent * focusMEvent
Definition: mouseactions.h:52
void MMoveWire2(Schematic *, QMouseEvent *)
MouseActions::MMoveWire2 Paint wire as it is being drawn with mouse.
QAction * formerAction
void MPressSelect(Schematic *, QMouseEvent *, float, float)
void MMoveZoomIn(Schematic *, QMouseEvent *)
MouseActions::MMoveZoomIn Paints symbol beside the mouse to show the "Zoom in" modus.
void MReleaseResizeDiagram(Schematic *, QMouseEvent *)
void MPressZoomIn(Schematic *, QMouseEvent *, float, float)