kchart

kchartLine3dConfigPage.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 2000,2001,2002,2003,2004 Laurent Montel <montel@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
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   // The 3D line on/off button.
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   // The line width label and input.
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   // The "Draw shadow color" checkbox
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   //it's not good but I don't know how
00103   //to reduce space
00104   //layout->addColSpacing(1,300);
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 }  //KChart namespace
KDE Home | KDE Accessibility Home | Description of Access Keys