]> Shamusworld >> Repos - architektonas/commitdiff
Check in prior to mucking around with preview/snapper rendering...
authorShamus Hammons <jlhamm@acm.org>
Fri, 2 Jul 2010 02:13:27 +0000 (02:13 +0000)
committerShamus Hammons <jlhamm@acm.org>
Fri, 2 Jul 2010 02:13:27 +0000 (02:13 +0000)
17 files changed:
architektonas.pro
src/actions/rs_actiondrawline.cpp
src/base/rs_actioninterface.cpp
src/base/rs_actioninterface.h
src/base/rs_previewactioninterface.cpp
src/base/rs_previewactioninterface.h
src/base/rs_snapper.cpp
src/base/rs_snapper.h
src/base/rs_staticgraphicview.cpp
src/mainapp/graphicview.cpp
src/mainapp/qc_dialogfactory.cpp
src/widgets/qg_actionhandler.h
src/widgets/qg_blockwidget.cpp
src/widgets/qg_graphicview.cpp
src/widgets/qg_graphicview.h
src/widgets/qg_scrollbar.cpp [deleted file]
src/widgets/qg_scrollbar.h [deleted file]

index b7636d3f144c5da43c9abad14a140c474420772b..85fe482c95c280399166c122323dbce285af52ae 100644 (file)
@@ -488,7 +488,6 @@ HEADERS += \
        src/widgets/qg_patternbox.h \
        src/widgets/qg_pentoolbar.h \
        src/widgets/recentfiles.h \
-       src/widgets/qg_scrollbar.h \
        src/widgets/qg_widthbox.h
 
 SOURCES += \
@@ -577,7 +576,6 @@ SOURCES += \
        src/widgets/qg_patternbox.cpp \
        src/widgets/qg_pentoolbar.cpp \
        src/widgets/recentfiles.cpp \
-       src/widgets/qg_scrollbar.cpp \
        src/widgets/qg_widthbox.cpp
 
 FORMS = \
index ce6ccdf8fdbe9078bb531800404ce9ab4d7ed41e..c52fc44ed1c6bb782e5ab1b2ca3408cacc58e54e 100644 (file)
@@ -25,8 +25,6 @@ RS_ActionDrawLine::RS_ActionDrawLine(RS_EntityContainer & container, GraphicView
 {
        RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine");
        reset();
-//[DONE]#warning "!!! Need to port setAutoDelete() behaviour from Qt3 to Qt4 !!!"
-//     history.setAutoDelete(true);
        RS_DEBUG->print("RS_ActionDrawLine::RS_ActionDrawLine: OK");
 }
 
@@ -45,7 +43,6 @@ void RS_ActionDrawLine::reset()
        RS_DEBUG->print("RS_ActionDrawLine::reset");
        data = RS_LineData(Vector(false), Vector(false));
        start = Vector(false);
-//     history.clear();
        ClearHistory();
        RS_DEBUG->print("RS_ActionDrawLine::reset: OK");
 }
@@ -54,14 +51,13 @@ void RS_ActionDrawLine::init(int status)
 {
        RS_DEBUG->print("RS_ActionDrawLine::init");
        RS_PreviewActionInterface::init(status);
-
        reset();
        RS_DEBUG->print("RS_ActionDrawLine::init: OK");
 }
 
 void RS_ActionDrawLine::trigger()
 {
-       RS_PreviewActionInterface::trigger();
+       RS_PreviewActionInterface::trigger();   // XOR off screen, delete entities in container
 
        RS_Line * line = new RS_Line(container, data);
        line->setLayerToActive();
@@ -74,20 +70,20 @@ void RS_ActionDrawLine::trigger()
 //std::cout << *container;
 
        // Update undo list:
-       if (document != NULL)
+       if (document)
        {
                document->startUndoCycle();
                document->addUndoable(line);
                document->endUndoCycle();
        }
 
-       deleteSnapper();
+       deleteSnapper();                        // XOR off of screen
        graphicView->moveRelativeZero(Vector(0.0, 0.0));
 //This is unnecessary, because we added this to the container...
 //#warning "!!! Here's the trouble... Trying to draw direct !!!"
 //     graphicView->drawEntity(line);
        graphicView->moveRelativeZero(line->getEndpoint());
-       drawSnapper();
+       drawSnapper();                          // XOR on screen
        RS_DEBUG->print("RS_ActionDrawLine::trigger(): line added: %d", line->getId());
 }
 
@@ -102,11 +98,14 @@ void RS_ActionDrawLine::mouseMoveEvent(QMouseEvent * e)
        if (getStatus() == SetEndpoint && data.startpoint.valid)
        {
                RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: update preview");
-               deletePreview();
-               clearPreview();
+//not needed, but without this, it doesn't draw... strange...
+//obviously we haven't gotten our rendering path correct...
+//             deletePreview();                // XOR off of screen
+               clearPreview();                 // Remove entities from the container
                preview->addEntity(new RS_Line(preview, RS_LineData(data.startpoint, mouse)));
                RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent: draw preview");
-               drawPreview();
+//             drawPreview();                  // XOR on screen
+               xorPreview();                   // XOR on screen
        }
 
        RS_DEBUG->print("RS_ActionDrawLine::mouseMoveEvent end");
@@ -121,9 +120,9 @@ void RS_ActionDrawLine::mouseReleaseEvent(QMouseEvent * e)
        }
        else if (e->button() == Qt::RightButton)
        {
-               deletePreview();
-               clearPreview();
-               deleteSnapper();
+               deletePreview();                // XOR off of screen
+               clearPreview();                 // Remove entities from the container
+               deleteSnapper();                // XOR off of screen
                init(getStatus() - 1);
        }
 }
@@ -132,7 +131,7 @@ void RS_ActionDrawLine::coordinateEvent(Vector * e)
 {
        RS_DEBUG->print("RS_ActionDrawLine::coordinateEvent");
 
-       if (e == NULL)
+       if (!e)
        {
                RS_DEBUG->print("RS_ActionDrawLine::coordinateEvent: event was NULL");
                return;
@@ -144,7 +143,6 @@ void RS_ActionDrawLine::coordinateEvent(Vector * e)
        {
        case SetStartpoint:
                data.startpoint = mouse;
-//             history.clear();
                ClearHistory();
                history.append(new Vector(mouse));
                start = data.startpoint;
@@ -273,7 +271,6 @@ void RS_ActionDrawLine::showOptions()
 {
        RS_DEBUG->print("RS_ActionDrawLine::showOptions");
        RS_ActionInterface::showOptions();
-
        RS_DIALOGFACTORY->requestOptions(this, true);
        RS_DEBUG->print("RS_ActionDrawLine::showOptions: OK");
 }
@@ -281,7 +278,6 @@ void RS_ActionDrawLine::showOptions()
 void RS_ActionDrawLine::hideOptions()
 {
        RS_ActionInterface::hideOptions();
-
        RS_DIALOGFACTORY->requestOptions(this, false);
 }
 
@@ -300,6 +296,8 @@ void RS_ActionDrawLine::updateToolBar()
 
 void RS_ActionDrawLine::close()
 {
+//NOTE: We should grey out the "close" button until the conditions for its use are satisfied.
+//      Though I can see how this would be called via cmd line... So I guess it's OK
        if (history.count() > 2 && start.valid)
        {
                data.endpoint = start;
@@ -313,11 +311,12 @@ void RS_ActionDrawLine::close()
 
 void RS_ActionDrawLine::undo()
 {
+//NOTE: We should grey out the "undo" button until the conditions for its use are satisfied.
        if (history.count() > 1)
        {
                history.removeLast();
-               deletePreview();
-               clearPreview();
+               deletePreview();                // XOR off of screen
+               clearPreview();                 // Delete entities in container
                graphicView->setCurrentAction(new RS_ActionEditUndo(true, *container, *graphicView));
                data.startpoint = *history.last();
                graphicView->moveRelativeZero(data.startpoint);
@@ -331,4 +330,3 @@ void RS_ActionDrawLine::ClearHistory(void)
        while (!history.isEmpty())
                delete history.takeFirst();
 }
-
index 7a885f8f85f770b40868d69497ce4737a2fcc35d..e6790280133d6f88e3c71879cade5f2087d3757e 100644 (file)
@@ -89,13 +89,13 @@ QString RS_ActionInterface::getName()
 }
 
 /**
- * Called to initiate an action. This funtcion is often
+ * Called to initiate an action. This function is often
  * overwritten by the implementing action.
  *
  * @param status The status on which to initiate this action.
  * default is 0 to begin the action.
  */
-void RS_ActionInterface::init(int status)
+void RS_ActionInterface::init(int status/*= 0*/)
 {
        RS_Snapper::init();
        setStatus(status);
@@ -280,10 +280,14 @@ void RS_ActionInterface::finish()
        graphicView->setMouseCursor(RS2::ArrowCursor);
        //graphicView->requestToolBar(RS2::ToolBarMain);
        updateToolBar();
+//Maybe change this to SnapperOff()?
 //jlh: deleteSnapper();
        hideOptions();
        finished = true;
-       RS_Snapper::finish();
+       RS_Snapper::finish();           // Sets RS_Snapper::finished = true
+       // I think this is where we want to update the screen...
+//     graphicView->update();
+       graphicView->redraw();
        RS_DEBUG->print("RS_ActionInterface::finish: OK");
 }
 
index c2daeb188d2e412db231691d8cbb950fb095d567..d9fd82881520157fd681e5811fbbd4ea68979290 100644 (file)
@@ -25,7 +25,8 @@ class RS_ActionInterface: public QObject, public RS_Snapper
 //huh? no slots/signals here...    Q_OBJECT
 //WHY derive from QObject???
 //for the TR macro???
-//mebbe...
+//mebbe... Well, that's what he says above. Though it would be just as easy to
+//prefix a QObject::tr in front of translated strings...
        public:
                RS_ActionInterface(const char * name, RS_EntityContainer & container,
                        GraphicView & graphicView);
index 1f59867c121052e5ae06ff65d95ce5b1952c8cbb..3301ac6e783cd80b16aca559d397b52844f2947a 100644 (file)
@@ -109,7 +109,8 @@ void RS_PreviewActionInterface::deletePreview()
  */
 void RS_PreviewActionInterface::xorPreview()
 {
-#warning "!!! xorPreview() not working AT ALL !!!"
+//not true anymore..
+//#warning "!!! xorPreview() not working AT ALL !!!"
 #if 0
        if (!preview->isEmpty())
        {
@@ -132,7 +133,6 @@ void RS_PreviewActionInterface::xorPreview()
 //This doesn't work, causes the thing to crash...
 //Now it works, just need to upgrade the rendering paths so that they aren't all
 //fucked up like QCad was...
-#if 1
        if (!preview->isEmpty())
        {
                graphicView->SetPreviewMode();
@@ -143,5 +143,4 @@ void RS_PreviewActionInterface::xorPreview()
 
        visible = !visible;
 #endif
-#endif
 }
index 529fb0c342e8391825f46dc3d969755db286b2bf..2b356dca48f766c37eb645860c3d551dd0232df5 100644 (file)
@@ -28,7 +28,8 @@ class RS_PreviewActionInterface: public RS_ActionInterface
                void drawPreview();
                void deletePreview();
 
-       private:
+//     private:
+       protected:
                void xorPreview();
 
        protected:
index 9505d6b3b8bc2993ebba465a7b2ca918a28d9082..13d76a92da0e4642819569af28793c790a753fcd 100644 (file)
@@ -183,7 +183,7 @@ Vector RS_Snapper::snapPoint(QMouseEvent * e)
 #warning "!!! THIS IS WHERE THE SNAPPER IS BEING DRAWN... !!!"
        drawSnapper();
 
-       if (RS_DIALOGFACTORY != NULL)
+       if (RS_DIALOGFACTORY)
                RS_DIALOGFACTORY->updateCoordinateWidget(snapCoord, snapCoord - graphicView->getRelativeZero());
 
        RS_DEBUG->print("RS_Snapper::snapPoint: OK");
@@ -409,10 +409,10 @@ RS_Entity * RS_Snapper::catchEntity(const Vector& pos, RS2::ResolveLevel level)
 
        int idx = -1;
 
-       if (entity != NULL && entity->getParent() != NULL)
+       if (entity && entity->getParent())
                idx = entity->getParent()->findEntity(entity);
 
-       if (entity != NULL && dist <= graphicView->toGraphDX(snapRange))
+       if (entity && dist <= graphicView->toGraphDX(snapRange))
        {
                // highlight:
                RS_DEBUG->print("RS_Snapper::catchEntity: found: %d", idx);
@@ -425,7 +425,7 @@ RS_Entity * RS_Snapper::catchEntity(const Vector& pos, RS2::ResolveLevel level)
        }
 
        RS_DEBUG->print("RS_Snapper::catchEntity: OK");
-       }
+}
 
 /**
  * Catches an entity which is close to the mouse cursor.
@@ -463,9 +463,8 @@ void RS_Snapper::resume()
  */
 void RS_Snapper::hideOptions()
 {
-       if (snapMode == RS2::SnapDist)
-               if (RS_DIALOGFACTORY != NULL)
-                       RS_DIALOGFACTORY->requestSnapDistOptions(distance, false);
+       if (snapMode == RS2::SnapDist && RS_DIALOGFACTORY)
+               RS_DIALOGFACTORY->requestSnapDistOptions(distance, false);
 }
 
 /**
@@ -473,9 +472,8 @@ void RS_Snapper::hideOptions()
  */
 void RS_Snapper::showOptions()
 {
-       if (snapMode == RS2::SnapDist)
-               if (RS_DIALOGFACTORY != NULL)
-                       RS_DIALOGFACTORY->requestSnapDistOptions(distance, true);
+       if (snapMode == RS2::SnapDist && RS_DIALOGFACTORY)
+               RS_DIALOGFACTORY->requestSnapDistOptions(distance, true);
 }
 
 /**
@@ -483,6 +481,7 @@ void RS_Snapper::showOptions()
  */
 void RS_Snapper::drawSnapper()
 {
+printf("RS_Snapper::drawSnapper(): Using DEPRECATED function!!!\n");
        if (!visible)
                xorSnapper();
 }
@@ -492,6 +491,7 @@ void RS_Snapper::drawSnapper()
  */
 void RS_Snapper::deleteSnapper()
 {
+printf("RS_Snapper::deleteSnapper(): Using DEPRECATED function!!!\n");
        if (visible)
        {
                xorSnapper();
@@ -556,3 +556,15 @@ void RS_Snapper::xorSnapper()
        visible = !visible;
 #endif
 }
+
+void RS_Snapper::SetSnapperVisible(bool visibility/*= true*/)
+{
+       graphicView->SetSnapperDraw(visibility);
+}
+
+//Hmm, not sure this is necessary...
+#warning "!!! Not sure this is necessary... !!!"
+void RS_Snapper::SetSnapperCoords(Vector snapCoord, Vector snapSpot)
+{
+       graphicView->SetSnapperVars(snapSpot, snapCoord, showCrosshairs);
+}
index 30e4a0cd0d55d0bef05efcf36cc7fcbc42093c03..3967d5e7f05ab031f0aa99395b0fbd626a744588 100644 (file)
@@ -48,8 +48,6 @@ class RS_Snapper
                Vector restrictHorizontal(Vector coord);
                Vector restrictVertical(Vector coord);
 
-               //RS_Entity* catchLeafEntity(const Vector& pos);
-               //RS_Entity* catchLeafEntity(QMouseEvent* e);
                RS_Entity * catchEntity(const Vector & pos, RS2::ResolveLevel level = RS2::ResolveNone);
                RS_Entity * catchEntity(QMouseEvent * e, RS2::ResolveLevel level = RS2::ResolveNone);
 
@@ -61,6 +59,36 @@ class RS_Snapper
                void drawSnapper();
                void deleteSnapper();
 
+/*
+How should we handle this? All rendering goes through the GraphicView (QG_GraphicView to be
+precise, soon to be merged in) as it should. So shouldn't we control the snapper through
+that class as well? Unfortunately, all actions derive from this class...
+
+Should they?
+
+Not 100% sure. It does seem to make more sense to have them be a part of the GraphicView,
+since snapping is a function of the grid and the entities contained in the view. (This would
+also hold for the preview as well.)
+
+On to the interface:
+
+For allowing the crosshairs to be drawn, we'd have
+void ShowSnapper(void)
+
+and
+void HideSnapper(void)
+
+to hide it. Maybe
+void SetSnapperCoords(Vector, Vector)
+
+for setting the coordinates?
+*/
+       protected:
+//             void ShowSnapper(void);
+//             void HideSnapper(void);
+               void SetSnapperVisible(bool visibility = true);
+               void SetSnapperCoords(Vector, Vector);
+
        private:
                void xorSnapper();
 
index 59b8b4c9d74f09a7ebe47534d96710bc16bfb941..ca6d1252bb5ebcc208fe0e7560a80df58de153ac 100644 (file)
 // JLH  06/15/2010  Moved implementation (however trivial) from header to here.
 //
 
+/*
+To me, this is yet another useless class. It seems to me that this could be
+easily replaced by putting a bitmap creation method in GraphicView. But that's
+just me. >:-)
+*/
+
 #include "rs_staticgraphicview.h"
 
 /**
index 69efb100c08b92ab542c0ebc79cdfd2067cd8977..90aa44eca6163c2fe568b91527fe4b94a6281760 100644 (file)
@@ -1992,8 +1992,21 @@ void GraphicView::drawAbsoluteZero()
  */
 void GraphicView::drawRelativeZero()
 {
+// PROBLEM: relativeZero IS NOT VALID!!!
        if (!relativeZero.valid || !painter)
+#if 1
                return;
+#else
+       {
+               if (!relativeZero.valid)
+                       printf("GraphicView::drawRelativeZero(): relativeZero is NOT valid!!!\n");
+
+               if (!painter)
+                       printf("GraphicView::drawRelativeZero(): painter is NOT valid!!!\n");
+
+               return;
+       }
+#endif
 
 //     RS_Pen p(Qt::red, RS2::Width00, RS2::SolidLine);
 //     p.setScreenWidth(0);
@@ -2319,14 +2332,15 @@ void GraphicView::setRelativeZero(const Vector & pos)
  */
 void GraphicView::moveRelativeZero(const Vector & pos)
 {
-#warning "!!! GraphicView::moveRelativeZero(): Bad render path !!!"
-       if (!painter)
-               return;
+//this is crap. we're taking this shit out.
+//#warning "!!! GraphicView::moveRelativeZero(): Bad render path !!!"
+//     if (!painter)
+//             return;
 
        //painter->setXORMode();
-       drawRelativeZero();
+//     drawRelativeZero();
        setRelativeZero(pos);
-       drawRelativeZero();
+//     drawRelativeZero();
 }
 
 RS_EventHandler * GraphicView::getEventHandler()
index 716b50c083bc8315adf8cec5d7c65c293a6047ec..d7f6eeb95dd0b22727d1f78d9fa1791993451dec 100644 (file)
@@ -35,21 +35,16 @@ void QC_DialogFactory::requestEditBlockWindow(RS_BlockList * blockList)
        ApplicationWindow * appWindow = ApplicationWindow::getAppWindow();
        MDIWindow * parent = appWindow->getMDIWindow();
 
-       if (parent != NULL)
+       if (parent && blockList)
        {
-               //RS_BlockList* blist = blockWidget->getBlockList();
-               if (blockList != NULL)
-               {
-                       RS_Block * blk = blockList->getActive();
+               RS_Block * block = blockList->getActive();
 
-                       if (blk != NULL)
-                       {
-                               MDIWindow * w = appWindow->slotFileNew(blk);
-                               // the parent needs a pointer to the block window and
-                               //   vice versa
-                               parent->addChildWindow(w);
-                               w->getGraphicView()->zoomAuto(false);
-                       }
+               if (block)
+               {
+                       MDIWindow * w = appWindow->slotFileNew(block);
+                       // the parent needs a pointer to the block window and vice versa
+                       parent->addChildWindow(w);
+                       w->getGraphicView()->zoomAuto(false);
                }
        }
 }
@@ -64,18 +59,18 @@ void QC_DialogFactory::closeEditBlockWindow(RS_Block * block)
        ApplicationWindow * appWindow = ApplicationWindow::getAppWindow();
        QMdiArea * workspace = appWindow->getWorkspace();
 
-       if (workspace != NULL)
+       if (workspace)
        {
                RS_DEBUG->print("QC_DialogFactory::closeEditBlockWindow: workspace found");
 
                QList<QMdiSubWindow *> windows = workspace->subWindowList();
 
-               for(int i=0; i<int(windows.count()); ++i)
+               for(int i=0; i<windows.count(); i++)
                {
                        RS_DEBUG->print("QC_DialogFactory::closeEditBlockWindow: window: %d", i);
                        MDIWindow * m = (MDIWindow *)windows.at(i);
 
-                       if (m != NULL)
+                       if (m)
                        {
                                RS_DEBUG->print("QC_DialogFactory::closeEditBlockWindow: got mdi");
 
index d5d68c234100a833d0029083a69af6bf3b57d6e9..3126a37818cbabfb811ee9f5ca0734067613be06 100644 (file)
@@ -205,7 +205,6 @@ class QG_ActionHandler: public QObject
                void setActionRestrictVertical(QAction * a);
                void setActionLockRelativeZero(QAction * a);
 
-//             void setCadToolBarSnap(QG_CadToolBarSnap * tb);
                void setCadToolBarSnap(CadToolBarSnap * tb);
 
        private:
index e5f67e08aa3dfb54a8c171d93dcf8024ac247fa3..e3ea1435161c88f2e291913f2ffab77426689d00 100644 (file)
@@ -324,7 +324,6 @@ void QG_BlockWidget::slotMouseButtonClicked(QListWidgetItem * item)
  */
 void QG_BlockWidget::contextMenuEvent(QContextMenuEvent * e)
 {
-#warning "Figure out how to port this crap (popup menu) to Qt4... !!! FIX !!!"
 #if 0
        //QListBoxItem* item = listBox->selectedItem();
        Q3PopupMenu * contextMenu = new Q3PopupMenu(this);
@@ -344,6 +343,8 @@ void QG_BlockWidget::contextMenuEvent(QContextMenuEvent * e)
        contextMenu->insertItem(tr("&Create New Block"), actionHandler, SLOT(slotBlocksCreate()), 0);
        contextMenu->exec(QCursor::pos());
        delete contextMenu;
+#else
+#warning "Figure out how to port this crap (popup menu) to Qt4... !!! FIX !!!"
 #endif
 
        e->accept();
index 4704f0a2cb8ec149f54fe19ac713c03da27541be..e306fa608d12511c0efba712c2e0e8f7f6a82a70 100644 (file)
@@ -94,7 +94,8 @@ Alignment is specified by alignment, which is a bitwise OR of Qt::AlignmentFlags
 A non-zero alignment indicates that the widget should not grow to fill the available space but should be sized according to sizeHint().
 */
        RS_DEBUG->print("--> Creating hScrollBar...");
-       hScrollBar = new QG_ScrollBar(Qt::Horizontal, this);
+//     hScrollBar = new QG_ScrollBar(Qt::Horizontal, this);
+       hScrollBar = new QScrollBar(Qt::Horizontal, this);
 //    hScrollBar->setLineStep(50);
        hScrollBar->setSingleStep(50);
 //    layout->addMultiCellWidget(hScrollBar, 1, 1, 0, 0);
@@ -103,7 +104,8 @@ A non-zero alignment indicates that the widget should not grow to fill the avail
        layout->addItem(new QSpacerItem(0, hScrollBar->sizeHint().height()), 1, 0);
 
        RS_DEBUG->print("--> Creating vScrollBar...");
-       vScrollBar = new QG_ScrollBar(Qt::Vertical, this);
+//     vScrollBar = new QG_ScrollBar(Qt::Vertical, this);
+       vScrollBar = new QScrollBar(Qt::Vertical, this);
 //    vScrollBar->setLineStep(50);
        vScrollBar->setSingleStep(50);
 //    layout->addMultiCellWidget(vScrollBar, 0, 0, 2, 2);
@@ -369,7 +371,10 @@ void QG_GraphicView::resizeEvent(QResizeEvent * /*e*/)
 /*
 This is retarded. There is absolutely no reason to have this shit in here.
 This could be easily called from whoever calls this crap.
+
+And so... We remove it.
 */
+#if 0
 // Next three methods from RS_LayerListListener Interface:
 void QG_GraphicView::layerEdited(RS_Layer *)
 {
@@ -385,6 +390,7 @@ void QG_GraphicView::layerToggled(RS_Layer *)
 {
        redraw();
 }
+#endif
 
 void QG_GraphicView::emulateMouseMoveEvent()
 {
index 2b3293b10f155df4603e74c5fbde84a53b83c23a..04d58a1ca0dc0c0e1e61de6b37018838c55045b7 100644 (file)
@@ -18,8 +18,8 @@ class RS_Preview;
  * Instances of this class can be linked to layer lists using
  * addLayerListListener().
  */
-class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview,
-       public RS_LayerListListener, public RS_BlockListListener
+class QG_GraphicView: public QWidget, public GraphicView//, //public Q3FilePreview,
+//     public RS_LayerListListener, public RS_BlockListListener
 {
        Q_OBJECT
 
@@ -37,10 +37,12 @@ class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview
                virtual void setMouseCursor(RS2::CursorType c);
                virtual void updateGridStatusWidget(const QString & text);
 
+// This is just crap. Why have a klunky listener interface when we have slots/signals???
+// That's what I thought!!!
                // Methods from RS_LayerListListener Interface:
-               virtual void layerEdited(RS_Layer *);
-               virtual void layerRemoved(RS_Layer *);
-               virtual void layerToggled(RS_Layer *);
+//             virtual void layerEdited(RS_Layer *);
+//             virtual void layerRemoved(RS_Layer *);
+//             virtual void layerToggled(RS_Layer *);
 
        protected:
                virtual void emulateMouseMoveEvent();
@@ -79,9 +81,11 @@ class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview
                int lastWidth;
                int lastHeight;
                //! Horizontal scrollbar.
-               QG_ScrollBar * hScrollBar;
+//             QG_ScrollBar * hScrollBar;
+               QScrollBar * hScrollBar;
                //! Vertical scrollbar.
-               QG_ScrollBar * vScrollBar;
+//             QG_ScrollBar * vScrollBar;
+               QScrollBar * vScrollBar;
                //! Layout used to fit in the view and the scrollbars.
                QGridLayout * layout;
                //! Label for grid spacing.
diff --git a/src/widgets/qg_scrollbar.cpp b/src/widgets/qg_scrollbar.cpp
deleted file mode 100644 (file)
index 646c64c..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-// qg_scrollbar.cpp
-//
-// Originally part of QCad Community Edition by Andrew Mustun
-// Extensively rewritten and refactored by James L. Hammons
-// (C) 2010 Underground Software
-//
-// JLH = James L. Hammons <jlhamm@acm.org>
-//
-// Who  When        What
-// ---  ----------  -----------------------------------------------------------
-// JLH  05/08/2010  Moved implementation from header to this file. :-)
-//
-
-// This class seems worse than useless to me; probably will end up removing it
-// at some point. :-P
-
-#include "qg_scrollbar.h"
-
-QG_ScrollBar::QG_ScrollBar(QWidget * parent/*= 0*/, const char */*name = 0*/):
-//     QScrollBar(parent, name)
-       QScrollBar(parent)
-{
-}
-
-QG_ScrollBar::QG_ScrollBar(Qt::Orientation orientation, QWidget * parent/*= 0*/, const char */*name = 0*/):
-//     QScrollBar(orientation, parent, name)
-       QScrollBar(orientation, parent)
-{
-}
-
-void QG_ScrollBar::slotWheelEvent(QWheelEvent * e)
-{
-       wheelEvent(e);
-}
diff --git a/src/widgets/qg_scrollbar.h b/src/widgets/qg_scrollbar.h
deleted file mode 100644 (file)
index 807d5cd..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifndef QG_SCROLLBAR_H
-#define QG_SCROLLBAR_H
-
-#include <QtGui>
-
-/**
- * A small wrapper for the Qt scrollbar. This class offers a slot
- * for scroll events.
- */
-class QG_ScrollBar: public QScrollBar
-{
-       Q_OBJECT
-
-       public:
-               QG_ScrollBar(QWidget * parent = 0, const char * name = 0);
-               QG_ScrollBar(Qt::Orientation orientation, QWidget * parent = 0, const char * name = 0);
-
-       public slots:
-               void slotWheelEvent(QWheelEvent * e);
-};
-
-#endif