kchart

kchartLine3dConfigPage.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2000,2001,2002,2003,2004 Laurent Montel <montel@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "kchartLine3dConfigPage.h"
21#include "kchartLine3dConfigPage.moc"
22
23#include <tdeapplication.h>
24#include <tdelocale.h>
25#include <kdialog.h>
26#include <tqlayout.h>
27#include <tqlabel.h>
28#include <tqcheckbox.h>
29#include <tqbuttongroup.h>
30#include <tqwhatsthis.h>
31
32#include "kchart_params.h"
33
34namespace KChart
35{
36
37KChartLine3dConfigPage::KChartLine3dConfigPage( KChartParams* params,
38 TQWidget* parent ) :
39 TQWidget( parent ),_params( params )
40{
41 TQGridLayout *grid1 = new TQGridLayout(this,8,3,KDialog::marginHint(), KDialog::spacingHint());
42
43#if 0
44 // The 3D line on/off button.
45 line3d=new TQCheckBox(i18n("3D lines"),this);
46 grid1->addWidget(line3d,1,0);
47
48 connect(line3d, TQ_SIGNAL(toggled ( bool )),
49 this, TQ_SLOT(slotChange3DParameter(bool)));
50#endif
51
52 // The line width label and input.
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);
58
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);
62
63#if 0
64 // The "Draw shadow color" checkbox
65 drawShadowColor=new TQCheckBox(i18n("Draw shadow color"),this);
66 grid1->addWidget(drawShadowColor,3,0);
67
68 tmpLabel = new TQLabel( i18n( "Rotation around the X-axis in degrees:" ),
69 this );
70 tmpLabel->resize( tmpLabel->sizeHint() );
71 grid1->addWidget(tmpLabel,4,0);
72
73 angle3dX=new KIntNumInput(0, this, 10);
74 grid1->addWidget(angle3dX,4,1);
75 angle3dX->setRange(0, 90, 1);
76
77 tmpLabel = new TQLabel( i18n( "Rotation around the Y-axis in degrees:" ), this );
78 tmpLabel->resize( tmpLabel->sizeHint() );
79 grid1->addWidget(tmpLabel,5,0);
80
81 angle3dY=new KIntNumInput(0, this, 10);
82 grid1->addWidget(angle3dY,5,1);
83 angle3dY->setRange(0, 90, 1);
84
85
86 tmpLabel = new TQLabel( i18n( "Depth:" ), this );
87 tmpLabel->resize( tmpLabel->sizeHint() );
88 grid1->addWidget(tmpLabel,6,0);
89
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);
94#endif
95#if 0
96 grid1->addColSpacing(0,depth->width());
97 grid1->addColSpacing(0,angle3dX->width());
98#endif
99 grid1->setColStretch(2,1);
100 grid1->setRowStretch(7,1);
101 grid1->activate();
102 //it's not good but I don't know how
103 //to reduce space
104 //layout->addColSpacing(1,300);
105}
106
107void KChartLine3dConfigPage::slotChange3DParameter(bool b)
108{
109#if 0
110 angle3dX->setEnabled(b);
111 angle3dY->setEnabled(b);
112 depth->setEnabled(b);
113 drawShadowColor->setEnabled(b);
114#endif
115 lineWidth->setEnabled(!b);
116}
117
118
119void KChartLine3dConfigPage::init()
120{
121#if 0
122 bool state=_params->threeDLines();
123 line3d->setChecked(state);
124
125 angle3dX->setValue( _params->threeDLineXRotation() );
126 angle3dY->setValue( _params->threeDLineYRotation() );
127 depth->setValue( _params->threeDLineDepth() );
128 drawShadowColor->setChecked(_params->threeDShadowColors());
129#endif
130 lineWidth->setValue(_params->lineWidth());
131 lineMarkers->setChecked(_params->lineMarker());
132#if 0
133 slotChange3DParameter(state);
134#endif
135}
136
137void KChartLine3dConfigPage::apply()
138{
139#if 0
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());
145#endif
146 _params->setLineWidth( lineWidth->value() );
147 _params->setLineMarker(lineMarkers->isChecked());
148}
149
150
151} //KChart namespace