kchart

kchartParameterPolarConfigPage.cc

00001 /* This file is part of the KDE project
00002    Copyright (C) 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 "kchartParameterPolarConfigPage.h"
00021 
00022 #include "kchartParameterPolarConfigPage.moc"
00023 
00024 #include <kapplication.h>
00025 #include <klocale.h>
00026 #include <kdebug.h>
00027 #include <kdialog.h>
00028 
00029 #include <qlayout.h>
00030 #include <qlabel.h>
00031 #include <qbuttongroup.h>
00032 #include <qcheckbox.h>
00033 #include <qlineedit.h>
00034 #include <qradiobutton.h>
00035 #include <qspinbox.h>
00036 #include <qvbuttongroup.h>
00037 #include <qwhatsthis.h>
00038 
00039 #include "kchart_params.h"
00040 
00041 namespace KChart
00042 {
00043 
00044 KChartParameterPolarConfigPage::KChartParameterPolarConfigPage( KChartParams* params,
00045                                                             QWidget* parent ) :
00046     QWidget( parent ),_params( params )
00047 {
00048     QVBoxLayout *grid1 = new QVBoxLayout(this);
00049     QVButtonGroup* gb = new QVButtonGroup( i18n( "Parameter" ), this );
00050     grid1->addWidget(gb);
00051 
00052     polarMarker=new QCheckBox(i18n("Polar marker"), gb);
00053     QWhatsThis::add(polarMarker, i18n("If this is checked, the polar markers are shown; otherwise they are not."));
00054     showCircularLabel = new QCheckBox(i18n("Show circular label"), gb);
00055     QWhatsThis::add(showCircularLabel, i18n("Toggle the circular label display."));
00056 
00057     QLabel *label = new QLabel( i18n( "Zero degree position:" ), gb );
00058     angle = new QSpinBox(-359, 359, 1, gb);
00059     QWhatsThis::add(angle, i18n("Set the position for the X axis (horizontal) from -359 to 359. Default is 0."));
00060 
00061     label=new QLabel(i18n("Line width:"), gb);
00062     lineWidth=new QSpinBox(gb);
00063     QWhatsThis::add(lineWidth, i18n("Set the width for the chart lines. 0 is default and is the thinnest."));
00064 
00065     grid1->activate();
00066 }
00067 
00068 
00069 void KChartParameterPolarConfigPage::init()
00070 {
00071     polarMarker->setChecked(_params->polarMarker());
00072     angle->setValue( _params->polarZeroDegreePos() );
00073     showCircularLabel->setChecked(_params->polarRotateCircularLabels());
00074     lineWidth->setValue(_params->polarLineWidth());
00075 }
00076 
00077 
00078 void KChartParameterPolarConfigPage::apply()
00079 {
00080     _params->setPolarZeroDegreePos(angle->value());
00081     _params->setPolarMarker(polarMarker->isChecked());
00082     _params->setPolarRotateCircularLabels(showCircularLabel->isChecked());
00083     _params->setPolarLineWidth(lineWidth->value());
00084 }
00085 
00086 }  //KChart namespace
KDE Home | KDE Accessibility Home | Description of Access Keys