[Kst] branches/work/kst/1.6/kst/src

Andrew Walker arwalker at sumusltd.com
Tue Dec 11 20:30:25 CET 2007


SVN commit 747354 by arwalker:

BUG:153659 allow user to add legend objects easily

 M  +1 -0      kst/kstui.rc  
 M  +1 -1      kst/pics/Makefile.am  
 AM            kst/pics/kst_gfx_legend.png  
 M  +1 -0      libkstapp/Makefile.am  
 M  +14 -1     libkstapp/kst.cpp  
 M  +1 -0      libkstapp/kst.h  
 A             libkstapp/kstgfxlegendmousehandler.cpp   [License: GPL (v2+)]
 A             libkstapp/kstgfxlegendmousehandler.h   [License: GPL (v2+)]
 M  +2 -3      libkstapp/kstviewlegend.cpp  


--- branches/work/kst/1.6/kst/src/kst/kstui.rc #747353:747354
@@ -66,6 +66,7 @@
       <Action name="arrow_action"/>
       <Action name="picture_action"/>
       <Action name="2dplot_action"/>
+      <Action name="legend_action"/>
     </Menu>
     <Separator/>
     <Action name="datamode_action"/>
--- branches/work/kst/1.6/kst/src/kst/pics/Makefile.am #747353:747354
@@ -17,7 +17,7 @@
 	kst_gfx_ellipse.png kst_gfx_polyline.png kst_gfx_polygon.png \
 	kst_gfx_arrow.png kst_gfx_picture.png kst_choosecolor.png \
 	kst_csdnew.png kst_differentiatecurves.png kst_viewmanager.png \
-	kst_newplot.png
+	kst_newplot.png kst_gfx_legend.png
 
 
 
** branches/work/kst/1.6/kst/src/kst/pics/kst_gfx_legend.png #property svn:mime-type
   + application/octet-stream
--- branches/work/kst/1.6/kst/src/libkstapp/Makefile.am #747353:747354
@@ -65,6 +65,7 @@
 	kstgfxpicturemousehandler.cpp \
 	kstgfxarrowmousehandler.cpp \
 	kstgfx2dplotmousehandler.cpp \
+	kstgfxlegendmousehandler.cpp \
 	kstgfxtlvmousehandler.cpp \
 	kstmetaplot.cpp \
 	kstdrag.cpp \
--- branches/work/kst/1.6/kst/src/libkstapp/kst.cpp #747353:747354
@@ -795,7 +795,7 @@
   _gfxPictureAction->setExclusiveGroup("gfx");
   _gfxPictureAction->setToolTip(i18n("Insert picture"));
   _gfxPictureAction->setWhatsThis(i18n("Insert picture"));
-  
+
   _gfx2DPlotAction = new KRadioAction(i18n("&Plot"), "kst_newplot",
                                    KShortcut(CTRL+Key_2),
                                    this, SLOT(toggleMouseMode()),
@@ -812,6 +812,14 @@
   _gfxArrowAction->setToolTip(i18n("Draw arrow"));
   _gfxArrowAction->setWhatsThis(i18n("Draw arrow"));
 
+  _gfxLegendAction = new KRadioAction(i18n("&Legend"), "kst_gfx_legend",
+                                   KShortcut(CTRL+Key_3),
+                                   this, SLOT(toggleMouseMode()),
+                                   actionCollection(), "legend_action");
+  _gfxLegendAction->setExclusiveGroup("gfx");
+  _gfxLegendAction->setToolTip(i18n("Insert Legend"));
+  _gfxLegendAction->setWhatsThis(i18n("Insert Legend"));
+
   _gfxLineAction = new KRadioAction(i18n("&Line"), "kst_gfx_line",
                                    KShortcut(Key_F10),
                                    this, SLOT(toggleMouseMode()),
@@ -854,6 +862,7 @@
   _gfxArrowAction->plug(mouseModeMenu);
   _gfxPictureAction->plug(mouseModeMenu);
   _gfx2DPlotAction->plug(mouseModeMenu);
+  _gfxLegendAction->plug(mouseModeMenu);
 
   toolBar()->insertButton("thumbnail", MODE_BUTTON_ID, mouseModeMenu, true, i18n("Select the desired mode"));
   toggleMouseMode();
@@ -1864,6 +1873,10 @@
     action = _gfxArrowAction;
     mode = KstTopLevelView::CreateMode;
     createType = "Arrow";
+  } else if (_gfxLegendAction->isChecked()) {
+    action = _gfxLegendAction;
+    mode = KstTopLevelView::CreateMode;
+    createType = "Legend";
   } else if (LayoutAction->isChecked()) {
     action = LayoutAction;
     mode = KstTopLevelView::LayoutMode;
--- branches/work/kst/1.6/kst/src/libkstapp/kst.h #747353:747354
@@ -565,6 +565,7 @@
     KRadioAction *_gfxPictureAction;
     KRadioAction *_gfx2DPlotAction;
     KRadioAction *_gfxArrowAction;
+    KRadioAction *_gfxLegendAction;
 
     StatusLabel *_readyBar;
     StatusLabel *_memoryBar;
--- branches/work/kst/1.6/kst/src/libkstapp/kstviewlegend.cpp #747353:747354
@@ -22,6 +22,7 @@
 #include "ksdebug.h"
 #include "kst2dplot.h"
 #include "kstdatacollection.h"
+#include "kstgfxlegendmousehandler.h"
 #include "kstdataobjectcollection.h"
 #include "kstlegenddefaults.h"
 #include "kst.h"
@@ -913,12 +914,10 @@
 
 
 KstGfxMouseHandler *handler_KstViewLegend() {
-  return 0L;
+  return new KstGfxLegendMouseHandler;
 }
 
 KST_REGISTER_VIEW_OBJECT(Legend, create_KstViewLegend, handler_KstViewLegend)
 }
 
-
 #include "kstviewlegend.moc"
-// vim: ts=2 sw=2 et


More information about the Kst mailing list