[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Fri Dec 19 03:11:13 CET 2003
CVS commit by arwalker:
In the Plot Dialog... Labels tab draw the sample labels to
the correct size, before the user makes some change to them.
M +51 -30 kstplotdialog_i.cpp 1.25
M +2 -1 kstplotdialog_i.h 1.10
--- kdeextragear-2/kst/kst/kstplotdialog_i.cpp #1.24:1.25
@@ -1,3 +1,4 @@
-/************************************************************************** kstplotdialog_i.cpp - plot dialog: inherits designer dialog
+/**************************************************************************
+ kstplotdialog_i.cpp - plot dialog: inherits designer dialog
-------------------
begin : 2000
@@ -27,4 +28,6 @@
#include <klistbox.h>
#include <qspinbox.h>
+#include <qmessagebox.h>
+#include <qtabwidget.h>
// include files for KDE
@@ -55,4 +58,5 @@ KstPlotDialogI::KstPlotDialogI(KstDoc *i
connect(Select, SIGNAL(activated(int)), this, SLOT(update(int)));
+ connect(TabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(newTab()));
connect(New, SIGNAL(clicked()), this, SLOT(new_I()));
connect(Edit, SIGNAL(clicked()), this, SLOT(edit_I()));
@@ -121,5 +125,8 @@ KstPlotDialogI::KstPlotDialogI(KstDoc *i
KstPlotDialogI::~KstPlotDialogI() {
+ if( SampleLabel != 0 )
+ {
delete SampleLabel;
+ }
SampleLabel = 0L;
}
@@ -131,4 +138,8 @@ void KstPlotDialogI::show_I() {
}
+void KstPlotDialogI::newTab( ) {
+ updateLabels();
+}
+
void KstPlotDialogI::update(int new_index) {
int index;
@@ -253,7 +264,5 @@ void KstPlotDialogI::update(int new_inde
FontComboBox->setCurrentFont(plot->TopLabel->fontName());
- updateSampXLabel();
- updateSampYLabel();
- updateSampNumLabel();
+ updateLabels();
} else {
for (KstBaseCurveList::iterator it = curves.begin(); it != curves.end(); it++) {
@@ -459,4 +468,6 @@ void KstPlotDialogI::updateSampNumLabel(
p.setPen(Colors->foreground());
+ if( SampleLabel != 0 )
+ {
SampleLabel->setFontName(FontComboBox->currentText());
SampleLabel->setSize(NumberFontSize->value());
@@ -464,4 +475,5 @@ void KstPlotDialogI::updateSampNumLabel(
SampleLabel->draw(p,SampleNumLabel->width()/2,
SampleNumLabel->height()/2,true);
+ }
SampleNumLabel->setPixmap(pix);
@@ -483,4 +495,6 @@ void KstPlotDialogI::updateSampTopLabel(
p.setPen(Colors->foreground());
+ if( SampleLabel != 0 )
+ {
SampleLabel->setFontName(FontComboBox->currentText());
SampleLabel->setSize(TopLabelFontSize->value());
@@ -488,4 +502,5 @@ void KstPlotDialogI::updateSampTopLabel(
SampleLabel->draw(p,SampleTopLabel->width()/2,
SampleTopLabel->height()/2,true);
+ }
SampleTopLabel->setPixmap(pix);
@@ -504,4 +519,6 @@ void KstPlotDialogI::updateSampXLabel()
p.setPen(Colors->foreground());
+ if( SampleLabel != 0 )
+ {
SampleLabel->setFontName(FontComboBox->currentText());
SampleLabel->setSize(XLabelFontSize->value());
@@ -509,4 +526,5 @@ void KstPlotDialogI::updateSampXLabel()
SampleLabel->draw(p,SampleXLabel->width()/2,
SampleXLabel->height()/2,true);
+ }
SampleXLabel->setPixmap(pix);
@@ -525,4 +543,6 @@ void KstPlotDialogI::updateSampYLabel()
p.setPen(Colors->foreground());
+ if( SampleLabel != 0 )
+ {
SampleLabel->setFontName(FontComboBox->currentText());
SampleLabel->setSize(YLabelFontSize->value());
@@ -530,4 +550,5 @@ void KstPlotDialogI::updateSampYLabel()
SampleLabel->draw(p,SampleYLabel->width()/2,
SampleYLabel->height()/2,true);
+ }
SampleYLabel->setPixmap(pix);
--- kdeextragear-2/kst/kst/kstplotdialog_i.h #1.9:1.10
@@ -42,4 +42,5 @@ public slots:
/** Update info in the plot dialog */
void update(int new_index = -1);
+ void newTab();
/** Calls update(), then shows/raises the dialog */
More information about the Kst
mailing list