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

George Staikos staikos at kde.org
Mon May 28 19:37:13 CEST 2007


SVN commit 669164 by staikos:

add ellipse items


 M  +1 -0      CMakeLists.txt  
 A             ellipseitem.cpp   [License: GPL (v2+)]
 A             ellipseitem.h   [License: GPL (v2+)]
 M  +13 -1     kstmainwindow.cpp  
 M  +3 -0      kstmainwindow.h  


--- branches/work/kst/portto4/kst/src/libkstapp/CMakeLists.txt #669163:669164
@@ -6,6 +6,7 @@
    view.cpp
    viewitem.cpp
    boxitem.cpp
+   ellipseitem.cpp
    lineitem.cpp
    labelitem.cpp
    viewcommand.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/kstmainwindow.cpp #669163:669164
@@ -11,10 +11,11 @@
 
 #include "kstmainwindow.h"
 #include "kstapplication.h"
-#include "view.h"
 #include "boxitem.h"
+#include "ellipseitem.h"
 #include "labelitem.h"
 #include "lineitem.h"
+#include "view.h"
 
 #include <QtGui>
 
@@ -105,6 +106,12 @@
 }
 
 
+void KstMainWindow::createEllipse() {
+  CreateEllipseCommand *cmd = new CreateEllipseCommand;
+  cmd->createItem();
+}
+
+
 void KstMainWindow::createLabel() {
   CreateLabelCommand *cmd = new CreateLabelCommand;
   cmd->createItem();
@@ -131,6 +138,10 @@
   _createBoxAct->setStatusTip(tr("Create a box for the current view"));
   connect(_createBoxAct, SIGNAL(triggered()), this, SLOT(createBox()));
 
+  _createEllipseAct = new QAction(tr("&Create ellipse"), this);
+  _createEllipseAct->setStatusTip(tr("Create an ellipse for the current view"));
+  connect(_createEllipseAct, SIGNAL(triggered()), this, SLOT(createEllipse()));
+
   _createLineAct = new QAction(tr("&Create line"), this);
   _createLineAct->setStatusTip(tr("Create a line for the current view"));
   connect(_createLineAct, SIGNAL(triggered()), this, SLOT(createLine()));
@@ -161,6 +172,7 @@
   _plotMenu = menuBar()->addMenu(tr("&Plot"));
   _plotMenu->addAction(_createLabelAct);
   _plotMenu->addAction(_createBoxAct);
+  _plotMenu->addAction(_createEllipseAct);
   _plotMenu->addAction(_createLineAct);
 
   _settingsMenu = menuBar()->addMenu(tr("&Settings"));
--- branches/work/kst/portto4/kst/src/libkstapp/kstmainwindow.h #669163:669164
@@ -44,6 +44,7 @@
 
   void createLabel();
   void createBox();
+  void createEllipse();
   void createLine();
 
 private:
@@ -70,8 +71,10 @@
 
   QAction *_undoAct;
   QAction *_redoAct;
+  // FIXME: move these into each object, along with the creation slot?
   QAction *_createLabelAct;
   QAction *_createBoxAct;
+  QAction *_createEllipseAct;
   QAction *_createLineAct;
 
   QAction *_exitAct;


More information about the Kst mailing list