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
14 #pragma implementation
18 #include "ControlSearch.h"
22 #include "QSearchDialog.h"
25 #include <qpushbutton.h>
26 #include <qcheckbox.h>
27 #include <qcombobox.h>
30 typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
34 : base_class(_("Search"))
39 void QSearch::build_dialog()
41 dialog_.reset(new QSearchDialog(this));
43 bc().setCancel(dialog_->closePB);
44 bc().addReadOnly(dialog_->replaceCO);
45 bc().addReadOnly(dialog_->replacePB);
46 bc().addReadOnly(dialog_->replaceallPB);
47 bc().addReadOnly(dialog_->caseCB);
48 bc().addReadOnly(dialog_->wordsCB);
49 bc().addReadOnly(dialog_->backwardsCB);
51 dialog_->replacePB->setEnabled(false);
52 dialog_->replaceallPB->setEnabled(false);
56 void QSearch::find(string const & str, bool casesens,
57 bool words, bool backwards)
59 controller().find(str, casesens, words, !backwards);
63 void QSearch::replace(string const & findstr, string const & replacestr,
64 bool casesens, bool words, bool all)
66 controller().replace(findstr, replacestr, casesens, words, all);