3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
13 #pragma implementation
16 #include <qpushbutton.h>
17 #include <qcheckbox.h>
18 #include <qcombobox.h>
20 #include "QSearchDialog.h"
25 #include "QtLyXView.h"
26 #include "ControlSearch.h"
28 typedef Qt2CB<ControlSearch, Qt2DB<QSearchDialog> > base_class;
30 QSearch::QSearch(ControlSearch & c)
31 : base_class(c, _("Search"))
36 void QSearch::build_dialog()
38 dialog_.reset(new QSearchDialog(this));
40 bc().setCancel(dialog_->closePB);
41 bc().addReadOnly(dialog_->replaceCO);
42 bc().addReadOnly(dialog_->replacePB);
43 bc().addReadOnly(dialog_->replaceallPB);
44 bc().addReadOnly(dialog_->caseCB);
45 bc().addReadOnly(dialog_->wordsCB);
46 bc().addReadOnly(dialog_->backwardsCB);
48 dialog_->replacePB->setEnabled(false);
49 dialog_->replaceallPB->setEnabled(false);
53 void QSearch::find(string const & str, bool casesens, bool words, bool backwards)
55 controller().find(str, casesens, words, !backwards);
59 void QSearch::replace(string const & findstr, string const & replacestr,
60 bool casesens, bool words, bool all)
62 controller().replace(findstr, replacestr, casesens, words, all);