00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kchartLine3dConfigPage.h"
00021 #include "kchartLine3dConfigPage.moc"
00022
00023 #include <kapplication.h>
00024 #include <klocale.h>
00025 #include <kdialog.h>
00026 #include <qlayout.h>
00027 #include <qlabel.h>
00028 #include <qcheckbox.h>
00029 #include <qbuttongroup.h>
00030 #include <qwhatsthis.h>
00031
00032 #include "kchart_params.h"
00033
00034 namespace KChart
00035 {
00036
00037 KChartLine3dConfigPage::KChartLine3dConfigPage( KChartParams* params,
00038 QWidget* parent ) :
00039 QWidget( parent ),_params( params )
00040 {
00041 QGridLayout *grid1 = new QGridLayout(this,8,3,KDialog::marginHint(), KDialog::spacingHint());
00042
00043 #if 0
00044
00045 line3d=new QCheckBox(i18n("3D lines"),this);
00046 grid1->addWidget(line3d,1,0);
00047
00048 connect(line3d, SIGNAL(toggled ( bool )),
00049 this, SLOT(slotChange3DParameter(bool)));
00050 #endif
00051
00052
00053 QLabel *tmpLabel = new QLabel( i18n( "Line width:" ), this );
00054 grid1->addWidget(tmpLabel,2,0);
00055 lineWidth=new KIntNumInput(0, this, 10);
00056 QWhatsThis::add(lineWidth, i18n("You can set here the line width for your chart. Default is 1."));
00057 grid1->addWidget(lineWidth,2,1);
00058
00059 lineMarkers = new QCheckBox( i18n( "Line markers" ), this );
00060 QWhatsThis::add(lineMarkers, i18n("Check this option if you want to add dots on your chart as markers."));
00061 grid1->addWidget(lineMarkers, 3, 0);
00062
00063 #if 0
00064
00065 drawShadowColor=new QCheckBox(i18n("Draw shadow color"),this);
00066 grid1->addWidget(drawShadowColor,3,0);
00067
00068 tmpLabel = new QLabel( i18n( "Rotation around the X-axis in degrees:" ),
00069 this );
00070 tmpLabel->resize( tmpLabel->sizeHint() );
00071 grid1->addWidget(tmpLabel,4,0);
00072
00073 angle3dX=new KIntNumInput(0, this, 10);
00074 grid1->addWidget(angle3dX,4,1);
00075 angle3dX->setRange(0, 90, 1);
00076
00077 tmpLabel = new QLabel( i18n( "Rotation around the Y-axis in degrees:" ), this );
00078 tmpLabel->resize( tmpLabel->sizeHint() );
00079 grid1->addWidget(tmpLabel,5,0);
00080
00081 angle3dY=new KIntNumInput(0, this, 10);
00082 grid1->addWidget(angle3dY,5,1);
00083 angle3dY->setRange(0, 90, 1);
00084
00085
00086 tmpLabel = new QLabel( i18n( "Depth:" ), this );
00087 tmpLabel->resize( tmpLabel->sizeHint() );
00088 grid1->addWidget(tmpLabel,6,0);
00089
00090 depth=new KDoubleNumInput(0, this);
00091 depth->resize(100,depth->sizeHint().height());
00092 grid1->addWidget(depth,6,1);
00093 depth->setRange(0,40, 0.1);
00094 #endif
00095 #if 0
00096 grid1->addColSpacing(0,depth->width());
00097 grid1->addColSpacing(0,angle3dX->width());
00098 #endif
00099 grid1->setColStretch(2,1);
00100 grid1->setRowStretch(7,1);
00101 grid1->activate();
00102
00103
00104
00105 }
00106
00107 void KChartLine3dConfigPage::slotChange3DParameter(bool b)
00108 {
00109 #if 0
00110 angle3dX->setEnabled(b);
00111 angle3dY->setEnabled(b);
00112 depth->setEnabled(b);
00113 drawShadowColor->setEnabled(b);
00114 #endif
00115 lineWidth->setEnabled(!b);
00116 }
00117
00118
00119 void KChartLine3dConfigPage::init()
00120 {
00121 #if 0
00122 bool state=_params->threeDLines();
00123 line3d->setChecked(state);
00124
00125 angle3dX->setValue( _params->threeDLineXRotation() );
00126 angle3dY->setValue( _params->threeDLineYRotation() );
00127 depth->setValue( _params->threeDLineDepth() );
00128 drawShadowColor->setChecked(_params->threeDShadowColors());
00129 #endif
00130 lineWidth->setValue(_params->lineWidth());
00131 lineMarkers->setChecked(_params->lineMarker());
00132 #if 0
00133 slotChange3DParameter(state);
00134 #endif
00135 }
00136
00137 void KChartLine3dConfigPage::apply()
00138 {
00139 #if 0
00140 _params->setThreeDLines(line3d->isChecked());
00141 _params->setThreeDLineXRotation( angle3dX->value() );
00142 _params->setThreeDLineYRotation( angle3dY->value() );
00143 _params->setThreeDLineDepth( static_cast<int>( depth->value() ) );
00144 _params->setThreeDShadowColors( drawShadowColor->isChecked());
00145 #endif
00146 _params->setLineWidth( lineWidth->value() );
00147 _params->setLineMarker(lineMarkers->isChecked());
00148 }
00149
00150
00151 }