kchart

kchartParameterPolarConfigPage.cpp
1/* This file is part of the KDE project
2 Copyright (C) 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 "kchartParameterPolarConfigPage.h"
21
22#include "kchartParameterPolarConfigPage.moc"
23
24#include <tdeapplication.h>
25#include <tdelocale.h>
26#include <kdebug.h>
27#include <kdialog.h>
28
29#include <tqlayout.h>
30#include <tqlabel.h>
31#include <tqbuttongroup.h>
32#include <tqcheckbox.h>
33#include <tqlineedit.h>
34#include <tqradiobutton.h>
35#include <tqspinbox.h>
36#include <tqvbuttongroup.h>
37#include <tqwhatsthis.h>
38
39#include "kchart_params.h"
40
41namespace KChart
42{
43
44KChartParameterPolarConfigPage::KChartParameterPolarConfigPage( KChartParams* params,
45 TQWidget* parent ) :
46 TQWidget( parent ),_params( params )
47{
48 TQVBoxLayout *grid1 = new TQVBoxLayout(this);
49 TQVButtonGroup* gb = new TQVButtonGroup( i18n( "Parameter" ), this );
50 grid1->addWidget(gb);
51
52 polarMarker=new TQCheckBox(i18n("Polar marker"), gb);
53 TQWhatsThis::add(polarMarker, i18n("If this is checked, the polar markers are shown; otherwise they are not."));
54 showCircularLabel = new TQCheckBox(i18n("Show circular label"), gb);
55 TQWhatsThis::add(showCircularLabel, i18n("Toggle the circular label display."));
56
57 TQLabel *label = new TQLabel( i18n( "Zero degree position:" ), gb );
58 angle = new TQSpinBox(-359, 359, 1, gb);
59 TQWhatsThis::add(angle, i18n("Set the position for the X axis (horizontal) from -359 to 359. Default is 0."));
60
61 label=new TQLabel(i18n("Line width:"), gb);
62 lineWidth=new TQSpinBox(gb);
63 TQWhatsThis::add(lineWidth, i18n("Set the width for the chart lines. 0 is default and is the thinnest."));
64
65 grid1->activate();
66}
67
68
69void KChartParameterPolarConfigPage::init()
70{
71 polarMarker->setChecked(_params->polarMarker());
72 angle->setValue( _params->polarZeroDegreePos() );
73 showCircularLabel->setChecked(_params->polarRotateCircularLabels());
74 lineWidth->setValue(_params->polarLineWidth());
75}
76
77
78void KChartParameterPolarConfigPage::apply()
79{
80 _params->setPolarZeroDegreePos(angle->value());
81 _params->setPolarMarker(polarMarker->isChecked());
82 _params->setPolarRotateCircularLabels(showCircularLabel->isChecked());
83 _params->setPolarLineWidth(lineWidth->value());
84}
85
86} //KChart namespace