20#include "kchartLine3dConfigPage.h"
21#include "kchartLine3dConfigPage.moc"
23#include <tdeapplication.h>
28#include <tqcheckbox.h>
29#include <tqbuttongroup.h>
30#include <tqwhatsthis.h>
32#include "kchart_params.h"
37KChartLine3dConfigPage::KChartLine3dConfigPage( KChartParams* params,
39 TQWidget( parent ),_params( params )
41 TQGridLayout *grid1 =
new TQGridLayout(
this,8,3,KDialog::marginHint(), KDialog::spacingHint());
45 line3d=
new TQCheckBox(i18n(
"3D lines"),
this);
46 grid1->addWidget(line3d,1,0);
48 connect(line3d, TQ_SIGNAL(toggled (
bool )),
49 this, TQ_SLOT(slotChange3DParameter(
bool)));
53 TQLabel *tmpLabel =
new TQLabel( i18n(
"Line width:" ),
this );
54 grid1->addWidget(tmpLabel,2,0);
55 lineWidth=
new KIntNumInput(0,
this, 10);
56 TQWhatsThis::add(lineWidth, i18n(
"You can set here the line width for your chart. Default is 1."));
57 grid1->addWidget(lineWidth,2,1);
59 lineMarkers =
new TQCheckBox( i18n(
"Line markers" ),
this );
60 TQWhatsThis::add(lineMarkers, i18n(
"Check this option if you want to add dots on your chart as markers."));
61 grid1->addWidget(lineMarkers, 3, 0);
65 drawShadowColor=
new TQCheckBox(i18n(
"Draw shadow color"),
this);
66 grid1->addWidget(drawShadowColor,3,0);
68 tmpLabel =
new TQLabel( i18n(
"Rotation around the X-axis in degrees:" ),
70 tmpLabel->resize( tmpLabel->sizeHint() );
71 grid1->addWidget(tmpLabel,4,0);
73 angle3dX=
new KIntNumInput(0,
this, 10);
74 grid1->addWidget(angle3dX,4,1);
75 angle3dX->setRange(0, 90, 1);
77 tmpLabel =
new TQLabel( i18n(
"Rotation around the Y-axis in degrees:" ),
this );
78 tmpLabel->resize( tmpLabel->sizeHint() );
79 grid1->addWidget(tmpLabel,5,0);
81 angle3dY=
new KIntNumInput(0,
this, 10);
82 grid1->addWidget(angle3dY,5,1);
83 angle3dY->setRange(0, 90, 1);
86 tmpLabel =
new TQLabel( i18n(
"Depth:" ),
this );
87 tmpLabel->resize( tmpLabel->sizeHint() );
88 grid1->addWidget(tmpLabel,6,0);
90 depth=
new KDoubleNumInput(0,
this);
91 depth->resize(100,depth->sizeHint().height());
92 grid1->addWidget(depth,6,1);
93 depth->setRange(0,40, 0.1);
96 grid1->addColSpacing(0,depth->width());
97 grid1->addColSpacing(0,angle3dX->width());
99 grid1->setColStretch(2,1);
100 grid1->setRowStretch(7,1);
107void KChartLine3dConfigPage::slotChange3DParameter(
bool b)
110 angle3dX->setEnabled(b);
111 angle3dY->setEnabled(b);
112 depth->setEnabled(b);
113 drawShadowColor->setEnabled(b);
115 lineWidth->setEnabled(!b);
119void KChartLine3dConfigPage::init()
122 bool state=_params->threeDLines();
123 line3d->setChecked(state);
125 angle3dX->setValue( _params->threeDLineXRotation() );
126 angle3dY->setValue( _params->threeDLineYRotation() );
127 depth->setValue( _params->threeDLineDepth() );
128 drawShadowColor->setChecked(_params->threeDShadowColors());
130 lineWidth->setValue(_params->lineWidth());
131 lineMarkers->setChecked(_params->lineMarker());
133 slotChange3DParameter(state);
137void KChartLine3dConfigPage::apply()
140 _params->setThreeDLines(line3d->isChecked());
141 _params->setThreeDLineXRotation( angle3dX->value() );
142 _params->setThreeDLineYRotation( angle3dY->value() );
143 _params->setThreeDLineDepth(
static_cast<int>( depth->value() ) );
144 _params->setThreeDShadowColors( drawShadowColor->isChecked());
146 _params->setLineWidth( lineWidth->value() );
147 _params->setLineMarker(lineMarkers->isChecked());