You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.0 KiB
114 lines
3.0 KiB
15 years ago
|
|
||
|
#include "kchartWizardSelectDataFormatPage.h"
|
||
|
#include "kchart_view.h"
|
||
|
#include "kchart_part.h"
|
||
|
|
||
14 years ago
|
#include <tqhbox.h>
|
||
|
#include <tqcheckbox.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
14 years ago
|
#include <tqlabel.h>
|
||
|
#include <tqlineedit.h>
|
||
|
#include <tqlistbox.h>
|
||
|
#include <tqbuttongroup.h>
|
||
|
#include <tqvbuttongroup.h>
|
||
|
#include <tqpushbutton.h>
|
||
|
#include <tqradiobutton.h>
|
||
|
#include <tqlineedit.h>
|
||
|
#include <tqpainter.h>
|
||
15 years ago
|
|
||
|
#include <kdebug.h>
|
||
|
#include <kiconloader.h>
|
||
12 years ago
|
#include <tdeglobal.h>
|
||
|
#include <tdelocale.h>
|
||
15 years ago
|
#include <kdialog.h>
|
||
|
|
||
|
#include "kchart_params.h"
|
||
|
|
||
|
namespace KChart
|
||
|
{
|
||
|
|
||
13 years ago
|
KChartWizardSelectDataFormatPage::KChartWizardSelectDataFormatPage( TQWidget* parent,
|
||
15 years ago
|
KChartPart* chart ) :
|
||
13 years ago
|
TQWidget( parent ),
|
||
15 years ago
|
m_chart( chart )
|
||
|
{
|
||
14 years ago
|
TQGridLayout *grid1 = new TQGridLayout(this, 6, 1, KDialog::marginHint(),
|
||
15 years ago
|
KDialog::spacingHint());
|
||
|
|
||
|
// The Data Area
|
||
14 years ago
|
TQButtonGroup *gb1 = new TQVButtonGroup( i18n( "Data Area" ), this );
|
||
15 years ago
|
|
||
14 years ago
|
TQHBox *hbox = new TQHBox( gb1 );
|
||
|
(void) new TQLabel( i18n("Area: "), hbox);
|
||
|
m_dataArea = new TQLineEdit( hbox );
|
||
15 years ago
|
grid1->addWidget(gb1, 0, 0);
|
||
|
|
||
|
// The row/column as label checkboxes.
|
||
14 years ago
|
m_firstRowAsLabel = new TQCheckBox( i18n( "First row as label" ), gb1);
|
||
|
m_firstColAsLabel = new TQCheckBox( i18n( "First column as label" ), gb1);
|
||
15 years ago
|
|
||
|
// The Data Format button group
|
||
14 years ago
|
TQButtonGroup *gb = new TQVButtonGroup( i18n( "Data Format" ), this );
|
||
15 years ago
|
|
||
14 years ago
|
m_rowMajor = new TQRadioButton( i18n( "Data in rows" ), gb );
|
||
13 years ago
|
m_rowMajor->resize( m_rowMajor->sizeHint() );
|
||
15 years ago
|
|
||
14 years ago
|
m_colMajor = new TQRadioButton( i18n( "Data in columns" ), gb );
|
||
13 years ago
|
m_colMajor->resize( m_colMajor->sizeHint() );
|
||
15 years ago
|
|
||
|
grid1->addWidget(gb, 3, 0);
|
||
|
|
||
14 years ago
|
TQLabel *lbl = new TQLabel( i18n(
|
||
15 years ago
|
"\n"
|
||
|
"If the selected data area does not match the data you want,\n"
|
||
|
"select the data now.\n"
|
||
|
"\n"
|
||
|
"Include cells that you want to use as row and column labels,\n"
|
||
|
"if you want them in the chart.\n"
|
||
|
), this);
|
||
|
grid1->addWidget(lbl, 4, 0);
|
||
|
|
||
|
grid1->setColStretch(5, 0);
|
||
|
|
||
|
grid1->activate();
|
||
|
|
||
|
// Enter the data into the widgets.
|
||
|
if ( m_chart->params()->dataDirection() == KChartParams::DataColumns)
|
||
|
m_colMajor->setChecked(true);
|
||
|
else
|
||
|
m_rowMajor->setChecked(true);
|
||
|
|
||
|
m_dataArea->setText( m_chart->params()->dataArea() );
|
||
|
}
|
||
|
|
||
|
|
||
14 years ago
|
TQString KChartWizardSelectDataFormatPage::dataArea() const
|
||
15 years ago
|
{
|
||
|
return m_dataArea->text();
|
||
|
}
|
||
|
|
||
14 years ago
|
void KChartWizardSelectDataFormatPage::setDataArea( const TQString &area )
|
||
15 years ago
|
{
|
||
|
m_dataArea->setText( area );
|
||
|
}
|
||
|
|
||
|
|
||
|
void KChartWizardSelectDataFormatPage::apply()
|
||
|
{
|
||
|
if (m_rowMajor->isChecked())
|
||
|
m_chart->params()->setDataDirection( KChartParams::DataRows );
|
||
|
else
|
||
|
m_chart->params()->setDataDirection( KChartParams::DataColumns );
|
||
|
|
||
|
m_chart->params()->setFirstRowAsLabel( m_firstRowAsLabel->isChecked() );
|
||
|
m_chart->params()->setFirstColAsLabel( m_firstColAsLabel->isChecked() );
|
||
|
|
||
|
m_chart->params()->setDataArea( m_dataArea->text() );
|
||
|
// FIXME: Actually take use the new data area.
|
||
|
}
|
||
|
|
||
|
|
||
|
} //KChart namespace
|
||
|
|
||
|
#include "kchartWizardSelectDataFormatPage.moc"
|