kchart

kchartComboConfigPage.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 "kchartComboConfigPage.h"
00021 #include "kchartComboConfigPage.moc"
00022 
00023 #include <kapplication.h>
00024 #include <klocale.h>
00025 #include <kdebug.h>
00026 #include <kdialog.h>
00027 #include <qlayout.h>
00028 #include <qlabel.h>
00029 #include <qradiobutton.h>
00030 #include <qbuttongroup.h>
00031 
00032 #include "kchart_params.h"
00033 
00034 namespace KChart
00035 {
00036 
00037 KChartComboPage::KChartComboPage( KChartParams* params,
00038                                   QWidget* parent ) :
00039     QWidget( parent ),_params( params )
00040 {
00041     //QVBoxLayout* toplevel = new QVBoxLayout( this, 10 );
00042 
00043     QGridLayout* layout = new QGridLayout(this, 2, 2,KDialog::marginHint(), KDialog::spacingHint() );
00044     //toplevel->addLayout( layout );
00045     QButtonGroup* gb = new QButtonGroup( i18n("HLC Style"), this );
00046     QGridLayout *grid1 = new QGridLayout(gb,7,1,KDialog::marginHint(), KDialog::spacingHint());
00047     layout->addWidget(gb,0,0);
00048 
00049     diamond=new QRadioButton( i18n("Diamond"), gb ); ;
00050     grid1->addWidget(diamond,0,0);
00051     closeconnected=new QRadioButton( i18n("Close connected"), gb );
00052     grid1->addWidget(closeconnected,1,0);
00053     connecting=new QRadioButton( i18n("Connecting"), gb );
00054     grid1->addWidget(connecting,2,0);
00055     icap=new QRadioButton( i18n("Icap"), gb );
00056     grid1->addWidget(icap,3,0);
00057     gb->setAlignment(Qt::AlignLeft);
00058     grid1->addColSpacing(0,diamond->width());
00059     grid1->addColSpacing(0,closeconnected->width());
00060     grid1->addColSpacing(0,connecting->width());
00061     grid1->addColSpacing(0,icap->width());
00062     grid1->setColStretch(0,1);
00063     grid1->activate();
00064     //it's not good but I don't know how
00065     //to reduce space
00066     layout->addColSpacing(1,300);
00067 }
00068 
00069 void KChartComboPage::init()
00070 {
00071     qDebug( "Sorry, not implemented: KChartComboPage::init()" );
00072 #ifdef __GNUC__
00073 #warning Put back in
00074 #endif
00075 #ifdef K
00076     switch((int)_params->hlc_style)
00077         {
00078         case (int)KCHARTHLCSTYLE_DIAMOND:
00079             {
00080                 diamond->setChecked(true);
00081                 break;
00082             }
00083         case (int)KCHARTHLCSTYLE_CLOSECONNECTED:
00084             {
00085                 closeconnected->setChecked(true);
00086                 break;
00087             }
00088         case (int)KCHARTHLCSTYLE_CONNECTING:
00089             {
00090                 connecting->setChecked(true);
00091                 break;
00092             }
00093         case (int)KCHARTHLCSTYLE_ICAP:
00094             {
00095                 icap->setChecked(true);
00096                 break;
00097             }
00098         default:
00099             {
00100                 kdDebug(35001)<<"Error in hlc_style\n";
00101                 break;
00102             }
00103         }
00104 #endif
00105 }
00106 
00107 void KChartComboPage::apply()
00108 {
00109     qDebug( "Sorry, not implemented: KChartComboPage::apply()" );
00110 #ifdef __GNUC__
00111 #warning Put back in
00112 #endif
00113 #ifdef K
00114     if(diamond->isChecked())
00115         {
00116             _params->hlc_style = KCHARTHLCSTYLE_DIAMOND;
00117         }
00118     else if(closeconnected->isChecked())
00119         {
00120             _params->hlc_style = KCHARTHLCSTYLE_CLOSECONNECTED;
00121         }
00122     else if(connecting->isChecked())
00123         {
00124             _params->hlc_style = KCHARTHLCSTYLE_CONNECTING;
00125         }
00126     else if(icap->isChecked())
00127         {
00128             _params->hlc_style = KCHARTHLCSTYLE_ICAP;
00129         }
00130     else
00131         {
00132             kdDebug(35001)<<"Error in groupbutton\n";
00133         }
00134 #endif
00135 }
00136 
00137 }  //KChart namespace
KDE Home | KDE Accessibility Home | Description of Access Keys