21#include <tqcheckbox.h>
24#include <kdialogbase.h>
27#include "kspread_sheet.h"
28#include "sheet_properties_base.h"
30#include "sheet_properties.h"
34SheetPropertiesDialog::SheetPropertiesDialog( TQWidget* parent ):
35 KDialogBase( parent,
"sheetPropertiesDialog", true,
36 i18n(
"Sheet Properties"),
37 KDialogBase::Ok|KDialogBase::Cancel|KDialogBase::Default )
39 TQVBox* mainWidget = makeVBoxMainWidget();
40 d =
new SheetPropertiesBase( mainWidget );
41 TQWidget* spacer =
new TQWidget( mainWidget );
42 spacer->setSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding );
43 enableButtonSeparator(
true );
46SheetPropertiesDialog::~SheetPropertiesDialog()
51void SheetPropertiesDialog::slotDefault()
53 setLayoutDirection( Sheet::LeftToRight );
56 setShowFormula(
false );
58 setShowFormulaIndicator(
true );
59 setShowCommentIndicator(
true );
60 setShowPageBorders(
false );
61 setColumnAsNumber(
false );
63 setCapitalizeFirstLetter(
false );
66Sheet::LayoutDirection SheetPropertiesDialog::layoutDirection()
const
68 if( d->directionComboBox->currentText() == i18n(
"Left to Right" ) )
69 return Sheet::LeftToRight;
71 if( d->directionComboBox->currentText() == i18n(
"Right to Left" ) )
72 return Sheet::RightToLeft;
75 return Sheet::LeftToRight;
78void SheetPropertiesDialog::setLayoutDirection( Sheet::LayoutDirection dir )
82 case Sheet::LeftToRight:
83 d->directionComboBox->setCurrentText( i18n(
"Left to Right" ) );
85 case Sheet::RightToLeft:
86 d->directionComboBox->setCurrentText( i18n(
"Right to Left" ) );
92bool SheetPropertiesDialog::autoCalc()
const
94 return d->autoCalcCheckBox->isChecked();
97void SheetPropertiesDialog::setAutoCalc(
bool b )
99 d->autoCalcCheckBox->setChecked( b );
102bool SheetPropertiesDialog::showGrid()
const
104 return d->showGridCheckBox->isChecked();
107void SheetPropertiesDialog::setShowGrid(
bool b )
109 d->showGridCheckBox->setChecked( b );
112bool SheetPropertiesDialog::showPageBorders()
const
114 return d->showPageBordersCheckBox->isChecked();
117void SheetPropertiesDialog::setShowPageBorders(
bool b )
119 d->showPageBordersCheckBox->setChecked( b );
122bool SheetPropertiesDialog::showFormula()
const
124 return d->showFormulaCheckBox->isChecked();
127void SheetPropertiesDialog::setShowFormula(
bool b )
129 d->showFormulaCheckBox->setChecked( b );
132bool SheetPropertiesDialog::hideZero()
const
134 return d->hideZeroCheckBox->isChecked();
137void SheetPropertiesDialog::setHideZero(
bool b )
139 d->hideZeroCheckBox->setChecked( b );
142bool SheetPropertiesDialog::showFormulaIndicator()
const
144 return d->showFormulaIndicatorCheckBox->isChecked();
147void SheetPropertiesDialog::setShowFormulaIndicator(
bool b )
149 d->showFormulaIndicatorCheckBox->setChecked( b );
152bool SheetPropertiesDialog::showCommentIndicator()
const
154 return d->showCommentIndicatorCheckBox->isChecked();
157void SheetPropertiesDialog::setShowCommentIndicator(
bool b )
159 d->showCommentIndicatorCheckBox->setChecked( b );
162bool SheetPropertiesDialog::columnAsNumber()
const
164 return d->showColumnAsNumbersCheckBox->isChecked();
167void SheetPropertiesDialog::setColumnAsNumber(
bool b )
169 d->showColumnAsNumbersCheckBox->setChecked( b );
172bool SheetPropertiesDialog::lcMode()
const
174 return d->useLCModeCheckBox->isChecked();
177void SheetPropertiesDialog::setLcMode(
bool b )
179 d->useLCModeCheckBox->setChecked( b );
182bool SheetPropertiesDialog::capitalizeFirstLetter()
const
184 return d->capitalizeFirstLetterCheckBox->isChecked();
187void SheetPropertiesDialog::setCapitalizeFirstLetter(
bool b )
189 d->capitalizeFirstLetterCheckBox->setChecked( b );
192#include "sheet_properties.moc"