[Kst] branches/work/kst/portto4/kst/src/libkstapp

Mike Fenton mike at staikos.net
Wed Feb 20 22:51:14 CET 2008


SVN commit 777550 by fenton:

Add Arrow as ViewItem.


 A             arrowitem.cpp   [License: GPL (v2+)]
 A             arrowitem.h   [License: GPL (v2+)]
 M  +2 -0      libkstapp.pro  
 M  +16 -0     mainwindow.cpp  
 M  +2 -0      mainwindow.h  


--- branches/work/kst/portto4/kst/src/libkstapp/libkstapp.pro #777549:777550
@@ -23,6 +23,7 @@
     application.cpp \
     applicationsettings.cpp \
     applicationsettingsdialog.cpp \
+    arrowitem.cpp \
     axis.cpp \
     axistab.cpp \
     basicplugindialog.cpp \
@@ -106,6 +107,7 @@
     application.h \
     applicationsettings.h \
     applicationsettingsdialog.h \
+    arrowitem.h \
     axis.h \
     axistab.h \
     basicplugindialog.h \
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #777549:777550
@@ -21,6 +21,7 @@
 #include "debug.h"
 #include "labelitem.h"
 #include "lineitem.h"
+#include "arrowitem.h"
 #include "memorywidget.h"
 #include "objectstore.h"
 #include "pictureitem.h"
@@ -120,6 +121,7 @@
   _createBoxAct->setEnabled(layoutMode);
   _createEllipseAct->setEnabled(layoutMode);
   _createLineAct->setEnabled(layoutMode);
+  _createArrowAct->setEnabled(layoutMode);
   _createPictureAct->setEnabled(layoutMode);
   _createPlotAct->setEnabled(layoutMode);
   _createSvgAct->setEnabled(layoutMode);
@@ -371,6 +373,12 @@
 }
 
 
+void MainWindow::createArrow() {
+  CreateArrowCommand *cmd = new CreateArrowCommand;
+  cmd->createItem();
+}
+
+
 void MainWindow::createPicture() {
   CreatePictureCommand *cmd = new CreatePictureCommand;
   cmd->createItem();
@@ -476,6 +484,12 @@
   _createLineAct->setEnabled(false);
   connect(_createLineAct, SIGNAL(triggered()), this, SLOT(createLine()));
 
+  _createArrowAct = new QAction(tr("&Create arrow"), this);
+  _createArrowAct->setStatusTip(tr("Create a arrow for the current view"));
+  _createArrowAct->setIcon(QPixmap(":kst_gfx_arrow.png"));
+  _createArrowAct->setEnabled(false);
+  connect(_createArrowAct, SIGNAL(triggered()), this, SLOT(createArrow()));
+
   _createPictureAct = new QAction(tr("&Create picture"), this);
   _createPictureAct->setStatusTip(tr("Create a picture for the current view"));
   _createPictureAct->setIcon(QPixmap(":kst_gfx_picture.png"));
@@ -656,6 +670,7 @@
   _layoutMenu->addAction(_createBoxAct);
   _layoutMenu->addAction(_createEllipseAct);
   _layoutMenu->addAction(_createLineAct);
+  _layoutMenu->addAction(_createArrowAct);
   _layoutMenu->addAction(_createPictureAct);
   _layoutMenu->addAction(_createPlotAct);
   _layoutMenu->addAction(_createSvgAct);
@@ -704,6 +719,7 @@
   _layoutToolBar->addAction(_createBoxAct);
   _layoutToolBar->addAction(_createEllipseAct);
   _layoutToolBar->addAction(_createLineAct);
+  _layoutToolBar->addAction(_createArrowAct);
   _layoutToolBar->addAction(_createPictureAct);
   _layoutToolBar->addAction(_createPlotAct);
 //  _layoutToolBar->addAction(_createSvgAct); //no icon
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.h #777549:777550
@@ -79,6 +79,7 @@
     void createEllipse();
     void createLabel();
     void createLine();
+    void createArrow();
     void createPicture();
     void createPlot();
     void createSvg();
@@ -144,6 +145,7 @@
     QAction *_createBoxAct;
     QAction *_createEllipseAct;
     QAction *_createLineAct;
+    QAction *_createArrowAct;
     QAction *_createPictureAct;
     QAction *_createPlotAct;
     QAction *_createSvgAct;


More information about the Kst mailing list