X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fwidgets%2Fqg_graphicview.cpp;h=40aaa7f07eae0cb583c1ba69bef7cb51c475a634;hb=1f0d096a7fc370ff02477f3860beae2669bf8903;hp=3c825c780fae70271f1b72ada736d0f31619bac1;hpb=468780dd17f8b0ebb35427a9fc43491721d44d69;p=architektonas diff --git a/src/widgets/qg_graphicview.cpp b/src/widgets/qg_graphicview.cpp index 3c825c7..40aaa7f 100644 --- a/src/widgets/qg_graphicview.cpp +++ b/src/widgets/qg_graphicview.cpp @@ -3,7 +3,9 @@ // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // @@ -14,22 +16,22 @@ #include "qg_graphicview.h" -#include "rs_actiondefault.h" -#include "rs_actionzoomin.h" -#include "rs_actionzoompan.h" -#include "rs_actionzoomscroll.h" -#include "rs_actionmodifydelete.h" -#include "rs_actionselectsingle.h" +#include "qg_dialogfactory.h" +#include "actiondefault.h" +#include "actionzoomin.h" +#include "actionzoompan.h" +#include "actionzoomscroll.h" +#include "actionmodifydelete.h" +#include "actionselectsingle.h" +#include "cadtoolbar.h" #include "rs_dialogfactory.h" +#include "drawing.h" #include "graphicview.h" +#include "rs_patternlist.h" +#include "paintinterface.h" #include "rs_preview.h" -#include "drawing.h" #include "settings.h" #include "rs_system.h" -#include "rs_patternlist.h" -#include "cadtoolbar.h" -#include "paintintf.h" -#include "qg_dialogfactory.h" #define QG_SCROLLMARGIN 400 @@ -65,7 +67,7 @@ QG_GraphicView::QG_GraphicView(RS_Document * doc, QWidget * parent) setBorders(10, 10, 10, 10); if (doc) - setDefaultAction(new RS_ActionDefault(*doc, *this)); + setDefaultAction(new ActionDefault(*doc, *this)); } void QG_GraphicView::CommonInitialization(void) @@ -402,7 +404,7 @@ void QG_GraphicView::mousePressEvent(QMouseEvent * e) { // pan zoom with middle mouse button if (e->button() == Qt::MidButton /*|| (e->state()==Qt::LeftButton|Qt::AltButton)*/) - setCurrentAction(new RS_ActionZoomPan(*container, *this)); + setCurrentAction(new ActionZoomPan(*container, *this)); GraphicView::mousePressEvent(e); QWidget::mousePressEvent(e); @@ -428,20 +430,8 @@ void QG_GraphicView::mouseReleaseEvent(QMouseEvent * e) void QG_GraphicView::mouseMoveEvent(QMouseEvent * e) { - //RS_DEBUG->print("QG_GraphicView::mouseMoveEvent begin"); - //QMouseEvent rsm = QG_Qt2Rs::mouseEvent(e); - GraphicView::mouseMoveEvent(e); QWidget::mouseMoveEvent(e); - -//What kind of cacamamie crap is this??? -//#ifdef Q_OS_WIN32 -// // make sure that we can still use hotkeys and the mouse wheel -// if (parent() != NULL) -// ((QWidget *)parent())->setFocus(); -//#endif - - //RS_DEBUG->print("QG_GraphicView::mouseMoveEvent end"); } /** @@ -459,7 +449,7 @@ void QG_GraphicView::tabletEvent(QTabletEvent * e) { if (container != NULL) { - RS_ActionSelectSingle * a = new RS_ActionSelectSingle(*container, *this); + ActionSelectSingle * a = new ActionSelectSingle(*container, *this); setCurrentAction(a); #warning "!!! !!!" // QMouseEvent ev(QEvent::MouseButtonRelease, e->pos(), Qt::LeftButton, Qt::LeftButton); @@ -467,7 +457,7 @@ void QG_GraphicView::tabletEvent(QTabletEvent * e) a->finish(); if (container->countSelected() > 0) - setCurrentAction(new RS_ActionModifyDelete(*container, *this)); + setCurrentAction(new ActionModifyDelete(*container, *this)); } } break; @@ -588,15 +578,15 @@ void QG_GraphicView::wheelEvent(QWheelEvent * e) } if (scroll) - setCurrentAction(new RS_ActionZoomScroll(direction, *container, *this)); + setCurrentAction(new ActionZoomScroll(direction, *container, *this)); // zoom in / out: // else if (e->state() == 0) else if (keyState == 0) { if (e->delta() > 0) - setCurrentAction(new RS_ActionZoomIn(*container, *this, RS2::In, RS2::Both, mouse)); + setCurrentAction(new ActionZoomIn(*container, *this, RS2::In, RS2::Both, mouse)); else - setCurrentAction(new RS_ActionZoomIn(*container, *this, RS2::Out, RS2::Both, mouse)); + setCurrentAction(new ActionZoomIn(*container, *this, RS2::Out, RS2::Both, mouse)); } e->accept(); @@ -634,7 +624,7 @@ void QG_GraphicView::keyPressEvent(QKeyEvent * e) } if (scroll) - setCurrentAction(new RS_ActionZoomScroll(direction, *container, *this)); + setCurrentAction(new ActionZoomScroll(direction, *container, *this)); GraphicView::keyPressEvent(e); } @@ -839,6 +829,7 @@ of VectorWorks & etc. as well... snapper.Draw(this, painter); if (preview.Visible()) +#if 0 { painter->setPen(RS_Pen(RS_Color(60, 255, 80), RS2::Width00, RS2::SolidLine)); painter->setOffset(preview.Offset()); @@ -853,6 +844,9 @@ of VectorWorks & etc. as well... painter->setOffset(Vector(0, 0)); } +#else + preview.Draw(this, painter); +#endif delete painter; painter = NULL;