#include "about.h"
#include "drawingview.h"
-#include "settingsdialog.h"
#include "generaltab.h"
+#include "painter.h"
+#include "settingsdialog.h"
ApplicationWindow::ApplicationWindow(): settings("Underground Software", "Architektonas")
drawing->SetRotateToolActive(rotateAct->isChecked());
}
+void ApplicationWindow::ZoomInTool(void)
+{
+//printf("Zoom in... level going from %02f to ", Painter::zoom);
+ // This just zooms leaving origin intact... should zoom in at the current center!
+// drawing->ZoomIn();
+ Painter::zoom *= 2.0;
+ drawing->update();
+}
+
+void ApplicationWindow::ZoomOutTool(void)
+{
+//printf("Zoom out...\n");
+ // This just zooms leaving origin intact... should zoom out at the current center!
+// drawing->ZoomOut();
+ Painter::zoom /= 2.0;
+ drawing->update();
+}
+
void ApplicationWindow::HelpAbout(void)
{
aboutWin->show();
rotateAct = CreateAction(tr("&Rotate Objects"), tr("Rotate"), tr("Rotate object(s) around an arbitrary center."), QIcon(":/res/generic-tool.png"), QKeySequence(tr("R,O")), true);
connect(rotateAct, SIGNAL(triggered()), this, SLOT(RotateTool()));
+ zoomInAct = CreateAction(tr("Zoom &In"), tr("Zoom In"), tr("Zoom in on the document."), QIcon(":/res/generic-tool.png"), QKeySequence(tr("=")));
+ connect(zoomInAct, SIGNAL(triggered()), this, SLOT(ZoomInTool()));
+
+ zoomOutAct = CreateAction(tr("Zoom &Out"), tr("Zoom Out"), tr("Zoom out of the document."), QIcon(":/res/generic-tool.png"), QKeySequence(tr("-")));
+ connect(zoomOutAct, SIGNAL(triggered()), this, SLOT(ZoomOutTool()));
+
fileNewAct = CreateAction(tr("&New Drawing"), tr("New Drawing"), tr("Creates a new drawing."), QIcon(":/res/generic-tool.png"), QKeySequence(tr("Ctrl+n")));
fileOpenAct = CreateAction(tr("&Open Drawing"), tr("Open Drawing"), tr("Opens an existing drawing from a file."), QIcon(":/res/generic-tool.png"), QKeySequence(tr("Ctrl+o")));
menu->addSeparator();
menu->addAction(exitAct);
+ menu = menuBar()->addMenu(tr("&View"));
+ menu->addAction(zoomInAct);
+ menu->addAction(zoomOutAct);
+
menu = menuBar()->addMenu(tr("&Edit"));
menu->addAction(fixAngleAct);
menu->addAction(fixLengthAct);
QToolBar * toolbar = addToolBar(tr("File"));
toolbar->addAction(exitAct);
+ toolbar = addToolBar(tr("View"));
+ toolbar->addAction(zoomInAct);
+ toolbar->addAction(zoomOutAct);
+
toolbar = addToolBar(tr("Edit"));
toolbar->addAction(fixAngleAct);
toolbar->addAction(fixLengthAct);