21#include "kspread_dlg_find.h"
22#include <tqcheckbox.h>
25#include <tqpushbutton.h>
27#include <tqcombobox.h>
31FindOption::FindOption( TQWidget *parent)
33 TQVBoxLayout *layout =
new TQVBoxLayout(parent);
34 m_moreOptions =
new TQPushButton( i18n(
"More Options" ), parent );
35 layout->addWidget( m_moreOptions );
37 connect( m_moreOptions, TQ_SIGNAL( clicked () ),
this, TQ_SLOT( slotMoreOptions() ) );
39 m_findExtension =
new TQWidget( parent );
40 layout->addWidget( m_findExtension );
41 TQVBoxLayout *layout1 =
new TQVBoxLayout( m_findExtension );
42 m_searchInAllSheet =
new TQCheckBox( i18n(
"Search entire sheet" ),m_findExtension );
43 layout1->addWidget( m_searchInAllSheet );
45 TQHBoxLayout *comboLayout =
new TQHBoxLayout( m_findExtension );
46 TQLabel *label =
new TQLabel( i18n(
"Search in:" ), m_findExtension );
47 comboLayout->addWidget( label );
49 m_searchIn =
new TQComboBox( m_findExtension );
50 comboLayout->addWidget( m_searchIn );
51 layout1->addLayout( comboLayout );
54 lst << i18n(
"Cell Values" );
55 lst << i18n(
"Comments" );
56 m_searchIn->insertStringList( lst );
58 comboLayout =
new TQHBoxLayout( m_findExtension );
59 label =
new TQLabel( i18n(
"Search direction:" ), m_findExtension );
60 comboLayout->addWidget( label );
62 m_searchDirection =
new TQComboBox( m_findExtension );
63 comboLayout->addWidget( m_searchDirection );
64 layout1->addLayout( comboLayout );
67 lst << i18n(
"Across then Down" );
68 lst << i18n(
"Down then Across" );
69 m_searchDirection->insertStringList( lst );
71 m_findExtension->hide();
75FindOption::searchTypeValue FindOption::searchType()
const
77 int pos = m_searchIn->currentItem();
86FindOption::searchDirectionValue FindOption::searchDirection()
const
88 int pos = m_searchDirection->currentItem();
98void FindOption::slotMoreOptions()
100 if ( m_findExtension->isHidden() )
102 m_findExtension->show();
103 m_moreOptions->setText( i18n(
"Fewer Options" ));
107 m_findExtension->hide();
108 m_moreOptions->setText( i18n(
"More Options" ));
113bool FindOption::searchInAllSheet()
const
115 return m_searchInAllSheet->isChecked();
118FindDlg::FindDlg(TQWidget *parent,
const char *name,
long options,
const TQStringList &findStrings,
bool hasSelection )
119 : KFindDialog(parent,name,options,findStrings,hasSelection )
121 m_findOptions =
new FindOption( findExtension() );
122 connect( m_findOptions, TQ_SIGNAL( adjustSize() ), TQ_SLOT( slotAjustSize() ) );
123 setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum));
131void FindDlg::slotAjustSize()
136bool FindDlg::searchInAllSheet()
const
138 return m_findOptions->searchInAllSheet();
142SearchDlg::SearchDlg(TQWidget *parent,
const char *name,
long options,
const TQStringList &findStrings,
const TQStringList &replaceStrings,
bool hasSelection )
143 : KReplaceDialog(parent,name,options,findStrings,replaceStrings,hasSelection )
145 m_findOptions =
new FindOption( findExtension() );
146 connect( m_findOptions, TQ_SIGNAL( adjustSize() ), TQ_SLOT( slotAjustSize() ) );
147 setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum));
150SearchDlg::~SearchDlg()
155void SearchDlg::slotAjustSize()
158 setFixedSize(size());
161bool SearchDlg::searchInAllSheet()
const
163 return m_findOptions->searchInAllSheet();
167#include "kspread_dlg_find.moc"
Provides a wrapper for cell value.