Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/mouseactions.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                               mouseactions.h
00003                              ----------------
00004     begin                : Thu Aug 28 2003
00005     copyright            : (C) 2003 by Michael Margraf
00006     email                : michael.margraf@alumni.tu-berlin.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef MOUSEACTIONS_H
00019 #define MOUSEACTIONS_H
00020 
00021 #include "element.h"
00022 
00023 #include <Q3PtrList>
00024 
00025 class Wire;
00026 class Schematic;
00027 class QPainter;
00028 class QMenu;
00029 class QMouseEvent;
00030 class QucsApp;
00031 
00032 extern QAction *formerAction;
00033 
00034 
00035 class MouseActions {
00036 public:
00037   MouseActions(QucsApp*);
00038   virtual ~MouseActions();
00039 
00040   void setPainter(Schematic*);
00041   bool pasteElements(Schematic*);
00042   void editElement(Schematic*, QMouseEvent*);
00043   void editLabel(Schematic*, WireLabel*);
00044 
00045   bool drawn;  // indicates whether the scheme element was drawn last time
00046   Element *selElem;  // component/diagram/painting selected in IconView
00047   Element *focusElement;
00048   QMouseEvent *focusMEvent;
00049 
00050   int  MAx1, MAy1,MAx2, MAy2, MAx3, MAy3;  // cache for mouse movements
00051   Q3PtrList<Element> movingElements;
00052   int movingRotated;
00053 
00054   // menu appearing by right mouse button click on component
00055   QMenu *ComponentMenu;
00056 
00057 private:
00058   bool isMoveEqual;
00059   QucsApp* App;
00060 
00061   // -------------------------------------------------------------------
00062 public:
00063   void MMoveSelect(Schematic*, QMouseEvent*);
00064   void MMoveElement(Schematic*, QMouseEvent*);
00065   void MMoveWire1(Schematic*, QMouseEvent*);
00066   void MMoveWire2(Schematic*, QMouseEvent*);
00067   void MMoveMoving(Schematic*, QMouseEvent*);
00068   void MMoveMoving2(Schematic*, QMouseEvent*);
00069   void MMovePaste(Schematic*, QMouseEvent*);
00070   void MMoveDelete(Schematic*, QMouseEvent*);
00071   void MMoveLabel(Schematic*, QMouseEvent*);
00072   void MMoveMarker(Schematic*, QMouseEvent*);
00073   void MMoveMirrorY(Schematic*, QMouseEvent*);
00074   void MMoveMirrorX(Schematic*, QMouseEvent*);
00075   void MMoveRotate(Schematic*, QMouseEvent*);
00076   void MMoveActivate(Schematic*, QMouseEvent*);
00077   void MMoveOnGrid(Schematic*, QMouseEvent*);
00078   void MMoveResizePainting(Schematic*, QMouseEvent*);
00079   void MMoveMoveText(Schematic*, QMouseEvent*);
00080   void MMoveMoveTextB(Schematic*, QMouseEvent*);
00081   void MMoveZoomIn(Schematic*, QMouseEvent*);
00082   void MMoveScrollBar(Schematic*, QMouseEvent*);
00083 
00084   void MPressSelect(Schematic*, QMouseEvent*, float, float);
00085   void MPressDelete(Schematic*, QMouseEvent*, float, float);
00086   void MPressActivate(Schematic*, QMouseEvent*, float, float);
00087   void MPressMirrorX(Schematic*, QMouseEvent*, float, float);
00088   void MPressMirrorY(Schematic*, QMouseEvent*, float, float);
00089   void MPressRotate(Schematic*, QMouseEvent*, float, float);
00090   void MPressElement(Schematic*, QMouseEvent*, float, float);
00091   void MPressLabel(Schematic*, QMouseEvent*, float, float);
00092   void MPressWire1(Schematic*, QMouseEvent*, float, float);
00093   void MPressWire2(Schematic*, QMouseEvent*, float, float);
00094   void MPressPainting(Schematic*, QMouseEvent*, float, float);
00095   void MPressMarker(Schematic*, QMouseEvent*, float, float);
00096   void MPressOnGrid(Schematic*, QMouseEvent*, float, float);
00097   void MPressMoveText(Schematic*, QMouseEvent*, float, float);
00098   void MPressZoomIn(Schematic*, QMouseEvent*, float, float);
00099 
00100   void MDoubleClickSelect(Schematic*, QMouseEvent*);
00101   void MDoubleClickWire2(Schematic*, QMouseEvent*);
00102 
00103   void MReleaseSelect(Schematic*, QMouseEvent*);
00104   void MReleaseSelect2(Schematic*, QMouseEvent*);
00105   void MReleaseActivate(Schematic*, QMouseEvent*);
00106   void MReleaseMoving(Schematic*, QMouseEvent*);
00107   void MReleaseResizeDiagram(Schematic*, QMouseEvent*);
00108   void MReleasePaste(Schematic*, QMouseEvent*);
00109   void MReleaseResizePainting(Schematic*, QMouseEvent*);
00110   void MReleaseMoveText(Schematic*, QMouseEvent*);
00111   void MReleaseZoomIn(Schematic*, QMouseEvent*);
00112 
00113   void paintElementsScheme(Schematic*);
00114   void rotateElements(Schematic*, int&, int&);
00115   void moveElements(Schematic*, int&, int&);
00116   void moveElements(Q3PtrList<Element>*, int, int);
00117   void endElementMoving(Schematic*, Q3PtrList<Element>*);
00118   void rightPressMenu(Schematic*, QMouseEvent*, float, float);
00119 };
00120 
00121 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines