20#include "kchartParameter3dConfigPage.h"
21#include "kchartParameter3dConfigPage.moc"
23#include <tdeapplication.h>
28#include <tqcheckbox.h>
29#include <tqbuttongroup.h>
30#include <tqwhatsthis.h>
32#include "kchart_params.h"
37KChartParameter3dConfigPage::KChartParameter3dConfigPage( KChartParams* params,
39 TQWidget( parent ),m_params( params )
41 TQGridLayout* layout =
new TQGridLayout(
this, 2, 2,KDialog::marginHint(),KDialog::spacingHint());
44 TQButtonGroup* gb =
new TQButtonGroup( 0, TQt::Vertical,
45 i18n(
"3D Parameters"),
this );
46 gb->layout()->setSpacing(KDialog::spacingHint());
47 gb->layout()->setMargin(KDialog::marginHint());
50 TQGridLayout *grid1 =
new TQGridLayout(gb->layout(), 5, 3);
51 layout->addWidget(gb,0,0);
54 bar3d=
new TQCheckBox(i18n(
"3D bar"),gb);
55 TQWhatsThis::add(bar3d, i18n(
"If checked, this will enable 3D mode for viewing the bars. You can then add a shadow and set the angle and depth for 3D."));
56 grid1->addWidget(bar3d,0,0);
58 connect(bar3d, TQ_SIGNAL(toggled (
bool )),
59 this, TQ_SLOT(slotChange3DParameter(
bool)));
62 drawShadowColor=
new TQCheckBox(i18n(
"Draw dark shadow"),gb);
63 TQWhatsThis::add(drawShadowColor, i18n(
"If checked, this will add a dark shadow on the 3D bars."));
64 grid1->addWidget(drawShadowColor,1,0);
66 TQLabel *tmpLabel =
new TQLabel( i18n(
"Angle:" ), gb );
67 tmpLabel->resize( tmpLabel->sizeHint() );
68 grid1->addWidget(tmpLabel,2,0);
70 angle3d=
new KIntNumInput(0, gb, 10);
71 TQWhatsThis::add(angle3d, i18n(
"You can set here the angle for the 3D effect from 0 to 90. 90 will give you flat bars without any 3D effect.\nDefault is 45."));
72 grid1->addWidget(angle3d,2,1);
73 angle3d->setRange(0, 90, 1);
75 tmpLabel =
new TQLabel( i18n(
"Depth:" ), gb );
76 tmpLabel->resize( tmpLabel->sizeHint() );
77 grid1->addWidget(tmpLabel,3,0);
79 depth=
new KDoubleNumInput(0, gb);
80 TQWhatsThis::add(depth, i18n(
"You can set here the depth of the 3D effect from 0 to 2. 0 will give you no depth at all.\nDefault is 1."));
81 depth->resize(100,depth->sizeHint().height());
82 grid1->addWidget(depth,3,1);
83 depth->setRange(0, 2.0, 0.1);
85 gb->setAlignment(TQt::AlignLeft);
86 grid1->addColSpacing(0,depth->width());
87 grid1->addColSpacing(0,angle3d->width());
88 grid1->setColStretch(2,1);
89 grid1->setRowStretch(4,1);
97void KChartParameter3dConfigPage::slotChange3DParameter(
bool b)
99 angle3d->setEnabled(b);
100 depth->setEnabled(b);
101 drawShadowColor->setEnabled(b);
105void KChartParameter3dConfigPage::init()
107 bool state=m_params->threeDBars();
108 bar3d->setChecked(state);
110 drawShadowColor->setChecked(m_params->threeDShadowColors());
111 angle3d->setValue( m_params->threeDBarAngle() );
112 depth->setValue( m_params->threeDBarDepth() );
113 slotChange3DParameter(state);
117void KChartParameter3dConfigPage::apply()
119 m_params->setThreeDBars(bar3d->isChecked());
120 m_params->setThreeDBarAngle( angle3d->value() );
121 m_params->setThreeDBarDepth( depth->value() );
122 m_params->setThreeDShadowColors( drawShadowColor->isChecked());