1#include "kchartWizardSetupAxesPage.h"
2#include "kchart_view.h"
3#include "kchart_part.h"
12#include <tdefontdialog.h>
13#include <knumvalidator.h>
19#include <tqpushbutton.h>
22#include "kchart_params.h"
27KChartWizardSetupAxesPage::KChartWizardSetupAxesPage( TQWidget* parent,
34 TQGridLayout *grid1 =
new TQGridLayout(
this,2,2,KDialog::marginHint(), KDialog::spacingHint());
36 TQGroupBox* tmpTQGroupBox;
37 tmpTQGroupBox =
new TQGroupBox(
this,
"GroupBox_1" );
38 tmpTQGroupBox->setFrameStyle( 49 );
40 TQGridLayout *grid2 =
new TQGridLayout(tmpTQGroupBox,3,2,KDialog::marginHint(), KDialog::spacingHint());
44 new TQLabel( i18n(
"Grid Lines" ), tmpTQGroupBox );
45 gridX =
new TQCheckBox( i18n(
"X axis:" ), tmpTQGroupBox );
46 gridY =
new TQCheckBox( i18n(
"Y axis:" ), tmpTQGroupBox );
48 gridX->setChecked(_chart->params()->showGrid());
49 gridY->setChecked(_chart->params()->showGrid());
50 grid2->addWidget(gridX, 0, 0);
51 grid2->addWidget(gridY, 1, 0);
53 gridColor=
new KColorButton(tmpTQGroupBox);
56 gridColor->setColor( colorGrid );
57 grid2->addWidget(gridColor, 0, 1);
59 border =
new TQCheckBox( i18n(
"Border:" ), tmpTQGroupBox );
62 grid2->addWidget(border, 2, 0);
63 border->setEnabled(
false);
65 borderColor=
new KColorButton(tmpTQGroupBox);
68 borderColor->setColor( colorBorder );
69 grid2->addWidget(borderColor,2,1);
70 borderColor->setEnabled(
false);
72 grid1->addWidget(tmpTQGroupBox,0,0);
75 tmpTQGroupBox =
new TQGroupBox(
this,
"GroupBox_2" );
76 tmpTQGroupBox->setFrameStyle( 49 );
78 grid2 =
new TQGridLayout(tmpTQGroupBox,3,2,KDialog::marginHint(), KDialog::spacingHint());
81 tmpLabel=
new TQLabel(tmpTQGroupBox);
82 tmpLabel->setText(i18n(
"Angle 3D:"));
83 grid2->addWidget(tmpLabel,0,0);
84 angle =
new TQSpinBox(1, 90, 1,tmpTQGroupBox );
85 angle->setValue( _chart->params()->threeDBarAngle() );
86 grid2->addWidget(angle,0,1);
88 tmpLabel=
new TQLabel(tmpTQGroupBox);
89 tmpLabel->setText(i18n(
"Depth 3D:"));
90 grid2->addWidget(tmpLabel,1,0);
91 depth =
new TQSpinBox(1, 40, 1, tmpTQGroupBox);
92 depth->setValue(
static_cast<int>( _chart->params()->threeDBarDepth() ) );
93 grid2->addWidget(depth,1,1);
104 grid1->addWidget(tmpTQGroupBox,0,1);
106 tmpTQGroupBox =
new TQGroupBox(
this,
"GroupBox_3" );
107 tmpTQGroupBox->setFrameStyle( 49 );
109 grid2 =
new TQGridLayout(tmpTQGroupBox,3,2,KDialog::marginHint(), KDialog::spacingHint());
111 tmpLabel=
new TQLabel(tmpTQGroupBox);
112 tmpLabel->setText(i18n(
"Y interval:"));
113 grid2->addWidget(tmpLabel,0,0);
116 y_interval=
new TQLineEdit(tmpTQGroupBox);
117 y_interval->setValidator(
new KFloatValidator( y_interval));
118 grid2->addWidget(y_interval,0,1);
123 tmpLabel=
new TQLabel(tmpTQGroupBox);
124 tmpLabel->setText(i18n(
"Y min:"));
125 grid2->addWidget(tmpLabel,1,0);
126 y_min=
new TQLineEdit(tmpTQGroupBox);
127 y_min->setValidator(
new KFloatValidator( y_min));
128 grid2->addWidget(y_min,1,1);
133 tmpLabel=
new TQLabel(tmpTQGroupBox);
134 tmpLabel->setText(i18n(
"Y max:"));
135 grid2->addWidget(tmpLabel,2,0);
136 y_max=
new TQLineEdit(tmpTQGroupBox);
137 y_max->setValidator(
new KFloatValidator( y_max));
138 grid2->addWidget(y_max,2,1);
143 grid1->addWidget(tmpTQGroupBox,1,0);
144 tmpTQGroupBox->setEnabled(
false);
146 tmpTQGroupBox =
new TQGroupBox(
this,
"GroupBox_3" );
147 tmpTQGroupBox->setFrameStyle( 49 );
149 grid2 =
new TQGridLayout(tmpTQGroupBox,3,2,KDialog::marginHint(), KDialog::spacingHint());
151 tmpLabel=
new TQLabel(tmpTQGroupBox);
152 tmpLabel->setText(i18n(
"Y-label format:"));
153 grid2->addWidget(tmpLabel,0,0);
154 ylabel_fmt=
new TQLineEdit(tmpTQGroupBox);
155 grid2->addWidget(ylabel_fmt,0,1);
162 ylabelFont =
new TQPushButton( tmpTQGroupBox);
163 grid2->addWidget(ylabelFont,1,0);
164 ylabelFont->setText(i18n(
"Font..."));
168 ylabelColor=
new KColorButton(tmpTQGroupBox);
169 grid2->addWidget(ylabelColor,1,1);
172 ylabelColor->setColor( ycolor );
175 tmpLabel=
new TQLabel(tmpTQGroupBox);
176 tmpLabel->setText(i18n(
"Y-label 2 format:"));
177 grid2->addWidget(tmpLabel,2,0);
179 ylabel2_fmt=
new TQLineEdit(tmpTQGroupBox);
180 grid2->addWidget(ylabel2_fmt,2,1);
187 tmpTQGroupBox->setEnabled(
false);
188 grid1->addWidget(tmpTQGroupBox,1,1);
192 connect(ylabelFont,TQ_SIGNAL(clicked()),
this,TQ_SLOT(changeLabelFont()));
195 connect(ylabelColor,TQ_SIGNAL(changed(
const TQColor & )),
196 this,TQ_SLOT(changeLabelColor(
const TQColor &)));
197 connect(borderColor,TQ_SIGNAL(changed(
const TQColor & )),
198 this,TQ_SLOT(changeBorderColor(
const TQColor &)));
199 connect(gridColor,TQ_SIGNAL(changed(
const TQColor & )),
200 this,TQ_SLOT(changeGridColor(
const TQColor &)));
204KChartWizardSetupAxesPage::~KChartWizardSetupAxesPage()
209void KChartWizardSetupAxesPage::changeLabelColor(
const TQColor &_color)
214void KChartWizardSetupAxesPage::changeBorderColor(
const TQColor &_color)
219void KChartWizardSetupAxesPage::changeGridColor(
const TQColor &_color)
224void KChartWizardSetupAxesPage::changeLabelFont()
226 if( TDEFontDialog::getFont( ylabel,
false,
this ) == TQDialog::Rejected )
230void KChartWizardSetupAxesPage::paintEvent( TQPaintEvent *)
233 angle->setEnabled(
true);
234 depth->setEnabled(
true);
237 angle->setEnabled(
false);
238 depth->setEnabled(
false);
243void KChartWizardSetupAxesPage::apply()
245 _chart->params()->setAxisShowGrid(KDChartAxisParams::AxisPosLeft,gridY->isChecked() );
246 _chart->params()->setAxisShowGrid(KDChartAxisParams::AxisPosBottom,gridX->isChecked() );
249 leftparams = _chart->params()->axisParams( KDChartAxisParams::AxisPosLeft );
258 _chart->params()->setAxisParams( KDChartAxisParams::AxisPosLeft, leftparams );
277 _chart->params()->setThreeDBarAngle( angle->value() );
289 _chart->params()->setThreeDBarDepth( depth->value() );
301#include "kchartWizardSetupAxesPage.moc"
access the chart axis parameters.