3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
15 #pragma implementation
19 #include "ControlSearch.h"
23 #include "QSearchDialog.h"
26 #include <qpushbutton.h>
27 #include <qcheckbox.h>
28 #include <qcombobox.h>
30 typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
33 : base_class(_("Search"))
38 void QSearch::build_dialog()
40 dialog_.reset(new QSearchDialog(this));
42 bc().setCancel(dialog_->closePB);
43 bc().addReadOnly(dialog_->replaceCO);
44 bc().addReadOnly(dialog_->replacePB);
45 bc().addReadOnly(dialog_->replaceallPB);
46 bc().addReadOnly(dialog_->caseCB);
47 bc().addReadOnly(dialog_->wordsCB);
48 bc().addReadOnly(dialog_->backwardsCB);
50 dialog_->replacePB->setEnabled(false);
51 dialog_->replaceallPB->setEnabled(false);
55 void QSearch::find(string const & str, bool casesens, bool words, bool backwards)
57 controller().find(str, casesens, words, !backwards);
61 void QSearch::replace(string const & findstr, string const & replacestr,
62 bool casesens, bool words, bool all)
64 controller().replace(findstr, replacestr, casesens, words, all);