kchart

kchartComboConfigPage.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 "kchartComboConfigPage.h"
21#include "kchartComboConfigPage.moc"
22
23#include <tdeapplication.h>
24#include <tdelocale.h>
25#include <kdebug.h>
26#include <kdialog.h>
27#include <tqlayout.h>
28#include <tqlabel.h>
29#include <tqradiobutton.h>
30#include <tqbuttongroup.h>
31
32#include "kchart_params.h"
33
34namespace KChart
35{
36
37KChartComboPage::KChartComboPage( KChartParams* params,
38 TQWidget* parent ) :
39 TQWidget( parent ),_params( params )
40{
41 //TQVBoxLayout* toplevel = new TQVBoxLayout( this, 10 );
42
43 TQGridLayout* layout = new TQGridLayout(this, 2, 2,KDialog::marginHint(), KDialog::spacingHint() );
44 //toplevel->addLayout( layout );
45 TQButtonGroup* gb = new TQButtonGroup( i18n("HLC Style"), this );
46 TQGridLayout *grid1 = new TQGridLayout(gb,7,1,KDialog::marginHint(), KDialog::spacingHint());
47 layout->addWidget(gb,0,0);
48
49 diamond=new TQRadioButton( i18n("Diamond"), gb ); ;
50 grid1->addWidget(diamond,0,0);
51 closeconnected=new TQRadioButton( i18n("Close connected"), gb );
52 grid1->addWidget(closeconnected,1,0);
53 connecting=new TQRadioButton( i18n("Connecting"), gb );
54 grid1->addWidget(connecting,2,0);
55 icap=new TQRadioButton( i18n("Icap"), gb );
56 grid1->addWidget(icap,3,0);
57 gb->setAlignment(TQt::AlignLeft);
58 grid1->addColSpacing(0,diamond->width());
59 grid1->addColSpacing(0,closeconnected->width());
60 grid1->addColSpacing(0,connecting->width());
61 grid1->addColSpacing(0,icap->width());
62 grid1->setColStretch(0,1);
63 grid1->activate();
64 //it's not good but I don't know how
65 //to reduce space
66 layout->addColSpacing(1,300);
67}
68
69void KChartComboPage::init()
70{
71 tqDebug( "Sorry, not implemented: KChartComboPage::init()" );
72#ifdef __GNUC__
73#warning Put back in
74#endif
75#ifdef K
76 switch((int)_params->hlc_style)
77 {
78 case (int)KCHARTHLCSTYLE_DIAMOND:
79 {
80 diamond->setChecked(true);
81 break;
82 }
83 case (int)KCHARTHLCSTYLE_CLOSECONNECTED:
84 {
85 closeconnected->setChecked(true);
86 break;
87 }
88 case (int)KCHARTHLCSTYLE_CONNECTING:
89 {
90 connecting->setChecked(true);
91 break;
92 }
93 case (int)KCHARTHLCSTYLE_ICAP:
94 {
95 icap->setChecked(true);
96 break;
97 }
98 default:
99 {
100 kdDebug(35001)<<"Error in hlc_style\n";
101 break;
102 }
103 }
104#endif
105}
106
107void KChartComboPage::apply()
108{
109 tqDebug( "Sorry, not implemented: KChartComboPage::apply()" );
110#ifdef __GNUC__
111#warning Put back in
112#endif
113#ifdef K
114 if(diamond->isChecked())
115 {
116 _params->hlc_style = KCHARTHLCSTYLE_DIAMOND;
117 }
118 else if(closeconnected->isChecked())
119 {
120 _params->hlc_style = KCHARTHLCSTYLE_CLOSECONNECTED;
121 }
122 else if(connecting->isChecked())
123 {
124 _params->hlc_style = KCHARTHLCSTYLE_CONNECTING;
125 }
126 else if(icap->isChecked())
127 {
128 _params->hlc_style = KCHARTHLCSTYLE_ICAP;
129 }
130 else
131 {
132 kdDebug(35001)<<"Error in groupbutton\n";
133 }
134#endif
135}
136
137} //KChart namespace