]> Shamusworld >> Repos - architektonas/blobdiff - src/base/rs_graphicview.cpp
Start of bringing back missing forms/dialogs
[architektonas] / src / base / rs_graphicview.cpp
index 29ab3f4c5632d184c85835a766a3123a1cdd5002..73500e211f8d16baef514699fc55dfb4c9550519 100644 (file)
 
 #include <stdio.h>
 #include "rs_actioninterface.h"
-#include "rs_application.h"
 #include "rs_block.h"
+#include "rs_dialogfactory.h"
+#include "drawing.h"
 #include "rs_eventhandler.h"
-#include "rs_graphic.h"
 #include "rs_grid.h"
 #include "rs_insert.h"
 #include "rs_layer.h"
@@ -122,10 +122,10 @@ void RS_GraphicView::cleanUp()
  * connected to this view is a graphic and valid.
  * NULL otherwise.
  */
-RS_Graphic * RS_GraphicView::getGraphic()
+Drawing * RS_GraphicView::getGraphic()
 {
        if (container != NULL && container->rtti() == RS2::EntityGraphic)
-               return (RS_Graphic*)container;
+               return (Drawing*)container;
        else
                return NULL;
 }
@@ -395,7 +395,7 @@ bool RS_GraphicView::isGridOn()
 {
        if (container != NULL)
        {
-               RS_Graphic * g = container->getGraphic();
+               Drawing * g = container->getGraphic();
 
                if (g != NULL)
                        return g->isGridOn();
@@ -565,8 +565,7 @@ void RS_GraphicView::mouseReleaseEvent(QMouseEvent * e)
 
        if (eventHandler != NULL)
        {
-               if (RS2::qtToRsButtonState(e->button()) != RS2::RightButton
-                       || eventHandler->hasAction())
+               if (e->button() != Qt::RightButton || eventHandler->hasAction())
                {
                        eventHandler->mouseReleaseEvent(e);
                        //e->accept();
@@ -574,10 +573,7 @@ void RS_GraphicView::mouseReleaseEvent(QMouseEvent * e)
                else
                {
                        back();
-//#if QT_VERSION>=0x030000
                        e->accept();
-//#endif
-
                }
        }
 
@@ -592,10 +588,10 @@ void RS_GraphicView::mouseMoveEvent(QMouseEvent * e)
 {
        RS_DEBUG->print("RS_GraphicView::mouseMoveEvent begin");
 
-       RS_Graphic * graphic = NULL;
+       Drawing * graphic = NULL;
 
        if (container->rtti() == RS2::EntityGraphic)
-               graphic = (RS_Graphic *)container;
+               graphic = (Drawing *)container;
 
        RS_DEBUG->print("RS_GraphicView::mouseMoveEvent 001");
 
@@ -1157,7 +1153,7 @@ void RS_GraphicView::zoomPage()
        if (simulationRunning)
                return;
 
-       RS_Graphic * graphic = container->getGraphic();
+       Drawing * graphic = container->getGraphic();
 
        if (graphic == NULL)
                return;
@@ -1324,7 +1320,7 @@ void RS_GraphicView::setPenForEntity(RS_Entity * e)
                {
                        double uf = 1.0;  // unit factor
                        double wf = 1.0;  // width factor
-                       RS_Graphic * graphic = container->getGraphic();
+                       Drawing * graphic = container->getGraphic();
 
                        if (graphic != NULL)
                        {
@@ -2096,7 +2092,7 @@ void RS_GraphicView::drawPaper()
        if (container == NULL)
                return;
 
-       RS_Graphic * graphic = container->getGraphic();
+       Drawing * graphic = container->getGraphic();
 
        if (graphic == NULL)
                return;