X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fapplicationwindow.cpp;h=66f9edc3b9a2a1845063b770d588c378c5ed8b5f;hb=9d5d4488ba75c407709556a7ed56b8d16e21834e;hp=36c256fb588fb789a7d968f39c84da871c34d8f0;hpb=4cb2b99e799d81dc8f589c54fb81fe20ef9ec2ad;p=architektonas diff --git a/src/applicationwindow.cpp b/src/applicationwindow.cpp index 36c256f..66f9edc 100644 --- a/src/applicationwindow.cpp +++ b/src/applicationwindow.cpp @@ -53,6 +53,8 @@ ApplicationWindow::ApplicationWindow(): settings("Underground Software", "Archit CreateToolbars(); // Create status bar + zoomIndicator = new QLabel("Zoom: 12.5%"); + statusBar()->addPermanentWidget(zoomIndicator); statusBar()->showMessage(tr("Ready")); ReadSettings(); @@ -120,6 +122,18 @@ void ApplicationWindow::AddCircleTool(void) SetInternalToolStates(); } +void ApplicationWindow::AddArcTool(void) +{ + ClearUIToolStatesExcept(addArcAct); + SetInternalToolStates(); +} + +void ApplicationWindow::AddPolygonTool(void) +{ + ClearUIToolStatesExcept(addPolygonAct); + SetInternalToolStates(); +} + void ApplicationWindow::ZoomInTool(void) { double zoomFactor = 2.0; @@ -148,6 +162,7 @@ when zooming in, new origin will be (xCenter - origin.x) / 2, (yCenter - origin. //printf("Zoom in... level going from %02f to ", Painter::zoom); // This just zooms leaving origin intact... should zoom in at the current center! [DONE] Painter::zoom *= zoomFactor; + zoomIndicator->setText(QString("Zoom: %1%").arg(Painter::zoom * 100.0 * SCREEN_ZOOM)); drawing->update(); } @@ -180,6 +195,7 @@ x 2 = (-426, -301) //printf("Zoom out...\n"); // This just zooms leaving origin intact... should zoom out at the current center! [DONE] Painter::zoom /= zoomFactor; + zoomIndicator->setText(QString("Zoom: %1%").arg(Painter::zoom * 100.0 * SCREEN_ZOOM)); drawing->update(); } @@ -261,8 +277,10 @@ void ApplicationWindow::CreateActions(void) connect(addCircleAct, SIGNAL(triggered()), this, SLOT(AddCircleTool())); addArcAct = CreateAction(tr("Add &Arc"), tr("Add Arc"), tr("Adds arcs to the drawing."), QIcon(":/res/add-arc-tool.png"), QKeySequence("A,A"), true); + connect(addArcAct, SIGNAL(triggered()), this, SLOT(AddArcTool())); addPolygonAct = CreateAction(tr("Add &Polygon"), tr("Add Polygon"), tr("Add polygons to the drawing."), QIcon(":/res/add-polygon-tool.png"), QKeySequence("A,P"), true); + connect(addPolygonAct, SIGNAL(triggered()), this, SLOT(AddPolygonTool())); aboutAct = CreateAction(tr("About &Architektonas"), tr("About Architektonas"), tr("Gives information about this program."), QIcon(":/res/generic-tool.png"), QKeySequence()); connect(aboutAct, SIGNAL(triggered()), this, SLOT(HelpAbout())); @@ -290,6 +308,7 @@ void ApplicationWindow::CreateActions(void) connect(settingsAct, SIGNAL(triggered()), this, SLOT(Settings())); //Hm. I think we'll have to have separate logic to do the "Radio Group Toolbar" thing... +// Yup, in order to turn them off, we'd have to have an "OFF" toolbar button. Ick. /* QActionGroup * group = new QActionGroup(this); group->addAction(deleteAct); group->addAction(addDimensionAct);