Mantid
Loading...
Searching...
No Matches
FindReplaceDialog.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------
10// Includes
11//----------------------------------
12#include "DllOption.h"
14#include <QDialog>
15
16//----------------------------------
17// Forward declarations
18//----------------------------------
19class ScriptEditor;
20class QPushButton;
21class QCheckBox;
22class QComboBox;
23class QGridLayout;
24class QVBoxLayout;
25class QShowEvent;
26
32 Q_OBJECT
33
34public:
37
38protected:
40 void initLayout();
42 void addReplaceBox();
44 void addReplaceButtons();
45
46protected slots:
48 bool find(bool backwards = false);
50 void replace();
52 void replaceAll();
53
55 void findClicked();
57 void resetSearchFlags();
59 void findNotInProgress();
61 void clearEditorSelection();
62
63private:
65 void showEvent(QShowEvent *event) override;
66
70 QPushButton *buttonNext;
72 QPushButton *buttonReplace;
74 QPushButton *buttonReplaceAll;
76 QPushButton *buttonCancel;
77
79 QComboBox *boxFind;
81 QComboBox *boxReplace;
82
84 QCheckBox *boxCaseSensitive;
86 QCheckBox *boxWholeWords;
90 QCheckBox *boxWrapAround;
92 QCheckBox *boxRegex;
93
96
97 QGridLayout *m_topLayout;
98 QVBoxLayout *m_vb2;
99};
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
Raises a dialog allowing the user to find/replace text in the editor.
QCheckBox * boxCaseSensitive
Case-sensitive check box.
QComboBox * boxFind
Find box.
QCheckBox * boxWholeWords
Whole words check box.
QCheckBox * boxWrapAround
Wrap around.
QComboBox * boxReplace
Replace box.
QPushButton * buttonReplace
Replace text button.
QPushButton * buttonReplaceAll
Replace all text button.
QGridLayout * m_topLayout
QCheckBox * boxSearchBackwards
Search backwards.
QCheckBox * boxRegex
Treat as regular expressions.
bool m_findInProgress
If a find is in progress.
QPushButton * buttonNext
Find next match button.
ScriptEditor * m_editor
The text editor we are working on.
QVBoxLayout * m_vb2
QPushButton * buttonCancel
Cancel dialog button.
This class provides an area to write scripts.
Definition: ScriptEditor.h:37