[Kst] kdeextragear-2/kst/kst

Rick Chern rchern at interchange.ubc.ca
Thu Aug 5 00:49:40 CEST 2004


CVS commit by rchern: 

Plot labels for images


  M +38 -21    kst2dplot.cpp   1.201


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.200:1.201
@@ -2104,11 +2104,11 @@ static void EscapeSpecialChars(QString& 
 
 void Kst2DPlot::GenerateDefaultLabels() {
-  int n_curves, i_curve;
+  int n_curves, i_curve, n_images;
   QString xlabel, ylabel, toplabel;
 
   n_curves = Curves.count();
+  n_images = _images.count();
 
-  if (n_curves < 1) return;
-
+  if (n_curves > 0) {
   if (n_curves == 1) {
     xlabel = Curves[0]->getXLabel();
@@ -2135,4 +2135,21 @@ void Kst2DPlot::GenerateDefaultLabels() 
     }
   }
+  }
+
+  //labels for images
+  if (n_images > 0) {
+    int start;
+    if (n_curves < 1) {
+      xlabel = "X";
+      ylabel = "Y";
+      toplabel = _images[0]->tagName();
+      start = 1;
+    } else {
+      start = 0;
+    }
+    for (int i = start; i < n_images; i++) {
+      toplabel += QString(", ") + _images[i]->tagName();
+    }
+  }
 
   EscapeSpecialChars(xlabel);





More information about the Kst mailing list