20#include "kchartParameterPieConfigPage.h"
22#include "kchartParameterPieConfigPage.moc"
24#include <tdeapplication.h>
31#include <tqbuttongroup.h>
32#include <tqcheckbox.h>
33#include <tqlineedit.h>
34#include <tqradiobutton.h>
36#include <tqvbuttongroup.h>
37#include <tqwhatsthis.h>
39#include "kchart_params.h"
44KChartParameterPieConfigPage::KChartParameterPieConfigPage( KChartParams* params,
46 TQWidget( parent ),_params( params )
48 TQVBoxLayout *toplevel =
new TQVBoxLayout(
this, 10 );
49 TQVBoxLayout *grid1 =
new TQVBoxLayout(
this);
50 toplevel->addLayout( grid1 );
52 TQVButtonGroup* gb =
new TQVButtonGroup( i18n(
"Parameter" ),
this );
55 pie3d =
new TQCheckBox(i18n(
"Pie 3D"), gb);
56 TQWhatsThis::add(pie3d, i18n(
"Uncheck this option if you do not want a 3D effect for your pie."));
57 drawShadowColor=
new TQCheckBox(i18n(
"Draw shadow color"), gb);
58 TQWhatsThis::add(drawShadowColor, i18n(
"Uncheck this option if you do not want a shadow color on a 3D pie."));
60 TQLabel *label =
new TQLabel( i18n(
"Explode factor (%):" ), gb );
61 explode =
new TQSpinBox(0, 100, 1, gb);
62 TQWhatsThis::add(explode, i18n(
"This will place gaps between the segments of your pie. Default is 0 which means the pie is a whole."));
64 label =
new TQLabel( i18n(
"Start angle:" ), gb );
65 angle =
new TQSpinBox(0, 90, 1, gb);
66 TQWhatsThis::add(angle, i18n(
"This will set the orientation of your pie. Default is 0."));
68 label =
new TQLabel( i18n(
"3D-depth:" ), gb );
69 depth =
new TQSpinBox(0, 40, 1, gb);
70 TQWhatsThis::add(depth, i18n(
"Set the depth from 0 to 40 of the 3D effect, if you have checked Pie 3D. Default is 20."));
74 connect(pie3d,TQ_SIGNAL(toggled (
bool )),
this, TQ_SLOT(active3DPie(
bool)));
77void KChartParameterPieConfigPage::active3DPie(
bool b)
79 drawShadowColor->setEnabled(b);
83void KChartParameterPieConfigPage::init()
85 bool state=_params->threeDPies();
86 pie3d->setChecked(state);
87 depth->setEnabled(state);
90 explode->setValue((
int)(_params->explodeFactor() * 100));
91 depth->setValue( _params->threeDPieHeight() );
92 drawShadowColor->setChecked(_params->threeDShadowColors());
93 angle->setValue( _params->pieStart() );
98void KChartParameterPieConfigPage::apply()
100 _params->setThreeDPies( pie3d->isChecked() );
101 if( _params->threeDPies() ) {
102 _params->setThreeDPieHeight( depth->value() );
104 _params->setThreeDShadowColors( drawShadowColor->isChecked());
105 _params->setExplodeFactor(((
double)(explode->value()))/100.0);
106 _params->setPieStart( angle->value() );