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

Andrew Walker arwalker at sumusltd.com
Fri Oct 19 22:44:55 CEST 2007


SVN commit 727108 by arwalker:

BUG:151062 make plot resize/move immediate. Also add repaint method to force updates

 M  +0 -1      bind_datavector.cpp  
 M  +4 -5      bind_powerspectrum.cpp  
 M  +18 -4     bind_viewobject.cpp  
 M  +13 -2     bind_window.cpp  
 M  +5 -2      bind_window.h  


--- branches/work/kst/1.6/kst/src/extensions/js/bind_datavector.cpp #727107:727108
@@ -494,4 +494,3 @@
 
 #undef makeDataVector
 
-// vim: ts=2 sw=2 et
--- branches/work/kst/1.6/kst/src/extensions/js/bind_powerspectrum.cpp #727107:727108
@@ -77,10 +77,10 @@
   unsigned len = 16;
   bool apodize = true;
   bool removeMean = true;
-  int apodizeFxn = 0;
-  int output = 0;
-  QString vunits;
-  QString runits;
+  int apodizeFxn = WindowOriginal;
+  int output = PSDAmplitudeSpectralDensity;
+  QString vunits = "V";
+  QString runits = "Hz";
 
   KstVectorPtr v = extractVector(exec, args[0]);
 
@@ -522,4 +522,3 @@
 
 #undef makePSD
 
-// vim: ts=2 sw=2 et
--- branches/work/kst/1.6/kst/src/extensions/js/bind_viewobject.cpp #727107:727108
@@ -449,8 +449,16 @@
   if (d) {
     KstWriteLocker rl(d);
     d->resize(QSize(x, y));
+
+    KstViewObjectPtr vo = d->topLevelParent();
+    if (vo) {
+      KstTopLevelViewPtr tlv =  kst_cast<KstTopLevelView>(vo);
+      if (tlv) {
+        tlv->paint(KstPainter::P_PAINT);
+      }
+    }
   }
-  
+
   return KJS::Undefined();
 }
 
@@ -483,8 +491,16 @@
   if (d) {
     KstWriteLocker rl(d);
     d->move(QPoint(x, y));
+
+    KstViewObjectPtr vo = d->topLevelParent();
+    if (vo) {
+      KstTopLevelViewPtr tlv =  kst_cast<KstTopLevelView>(vo);
+      if (tlv) {
+        tlv->paint(KstPainter::P_PAINT);
+      }
+    }
   }
-  
+
   return KJS::Undefined();
 }
 
@@ -590,5 +606,3 @@
 
 #undef makeViewObject
 
-
-// vim: ts=2 sw=2 et
--- branches/work/kst/1.6/kst/src/extensions/js/bind_window.cpp #727107:727108
@@ -96,6 +96,7 @@
 
 static WindowBindings windowBindings[] = {
   { "close", &KstBindWindow::close },
+  { "repaint", &KstBindWindow::repaint },
   { 0L, 0L }
 };
 
@@ -214,6 +215,18 @@
 }
 
 
+KJS::Value KstBindWindow::repaint(KJS::ExecState *exec, const KJS::List& args) {
+  Q_UNUSED(args)
+  if (!_d) {
+    KJS::Object eobj = KJS::Error::create(exec, KJS::GeneralError);
+    exec->setException(eobj);
+    return KJS::Undefined();
+  }
+  _d->view()->paint(KstPainter::P_PAINT);
+  return KJS::Undefined();
+}
+
+
 KJS::Value KstBindWindow::close(KJS::ExecState *exec, const KJS::List& args) {
   Q_UNUSED(args)
   if (!_d) {
@@ -236,5 +249,3 @@
   return KJS::Object(KstBindViewObject::bind(exec, _d->view().data()));
 }
 
-
-// vim: ts=2 sw=2 et
--- branches/work/kst/1.6/kst/src/extensions/js/bind_window.h #727107:727108
@@ -46,6 +46,11 @@
     KJS::ReferenceList propList(KJS::ExecState *exec, bool recursive = true);
     bool hasProperty(KJS::ExecState *exec, const KJS::Identifier& propertyName) const;
 
+    /* @method repaint
+       @description Repaints the window.
+    */
+    KJS::Value repaint(KJS::ExecState *exec, const KJS::List& args);
+
     /* @method close
        @description Closes the window.
     */
@@ -77,5 +82,3 @@
 
 
 #endif
-
-// vim: ts=2 sw=2 et


More information about the Kst mailing list