[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Wed Oct 27 18:28:20 CEST 2004
CVS commit by staikos:
add ability to unzoom and toggle zoom with DCOP. points out another bug:
it's possible to zoom two plots at the same time.
M +2 -0 kstiface.h 1.29
M +44 -3 kstiface_impl.cpp 1.56
M +2 -0 kstiface_impl.h 1.28
M +1 -1 kstviewobject.h 1.79
--- kdeextragear-2/kst/kst/kstiface.h #1.28:1.29
@@ -138,4 +138,6 @@ k_dcop:
//zoom (maximize) plot
virtual bool maximizePlot(const QString& plotName) = 0;
+ virtual bool unmaximizePlot(const QString& plotName) = 0;
+ virtual bool toggleMaximizePlot(const QString& plotName) = 0;
//change plot axes
--- kdeextragear-2/kst/kst/kstiface_impl.cpp #1.55:1.56
@@ -1054,5 +1054,4 @@ bool KstIfaceImpl::positionWindow(int to
bool KstIfaceImpl::maximizePlot(const QString& plotName) {
- //find the plot
KstApp *app = KstApp::inst();
KMdiIterator<KMdiChildView*> *iter = app->createIterator();
@@ -1062,8 +1061,50 @@ bool KstIfaceImpl::maximizePlot(const QS
if (viewwindow) {
Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
- Kst2DPlotList::Iterator plot_iter=plotlist.findTag(plotName);
+ Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
if (plot_iter != plotlist.end()) {
app->deleteIterator(iter);
- (*plot_iter)->zoom(true); //zoom it
+ (*plot_iter)->zoom(true);
+ return true;
+ }
+ }
+ iter->next();
+ }
+ app->deleteIterator(iter);
+ return false;
+}
+
+bool KstIfaceImpl::unmaximizePlot(const QString& plotName) {
+ KstApp *app = KstApp::inst();
+ KMdiIterator<KMdiChildView*> *iter = app->createIterator();
+ while (iter->currentItem()) {
+ KMdiChildView *childview = iter->currentItem();
+ KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
+ if (viewwindow) {
+ Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
+ Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
+ if (plot_iter != plotlist.end()) {
+ app->deleteIterator(iter);
+ (*plot_iter)->zoom(false);
+ return true;
+ }
+ }
+ iter->next();
+ }
+ app->deleteIterator(iter);
+ return false;
+}
+
+bool KstIfaceImpl::toggleMaximizePlot(const QString& plotName) {
+ KstApp *app = KstApp::inst();
+ KMdiIterator<KMdiChildView*> *iter = app->createIterator();
+ while (iter->currentItem()) {
+ KMdiChildView *childview = iter->currentItem();
+ KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
+ if (viewwindow) {
+ Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
+ Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
+ if (plot_iter != plotlist.end()) {
+ app->deleteIterator(iter);
+ (*plot_iter)->zoomToggle();
return true;
}
--- kdeextragear-2/kst/kst/kstiface_impl.h #1.27:1.28
@@ -118,4 +118,6 @@ class KstIfaceImpl : virtual public KstI
virtual bool maximizePlot(const QString& plotName); //zoom (maximize) plot
+ virtual bool unmaximizePlot(const QString& plotName);
+ virtual bool toggleMaximizePlot(const QString& plotName);
virtual bool setPlotAxes(const QString& plotName,
--- kdeextragear-2/kst/kst/kstviewobject.h #1.78:1.79
@@ -185,4 +185,5 @@ class KstViewObject : public KstObject {
virtual void updateAspectPos();
virtual void updateAspect();
+ virtual void zoomToggle();
protected slots:
@@ -200,5 +201,4 @@ class KstViewObject : public KstObject {
virtual void moveTo(int);
virtual void rename();
- virtual void zoomToggle();
virtual void pauseToggle();
More information about the Kst
mailing list