wxMaxima
Loading...
Searching...
No Matches
FindReplacePane.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// (C) 2012-2013 Doug Ilijev <doug.ilijev@gmail.com>
5// (C) 2015 Gunter Königsmann <wxMaxima@physikbuch.de>
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation; either version 2 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21//
22// SPDX-License-Identifier: GPL-2.0+
23
30#ifndef FINDREPLACEPANE_H
31#define FINDREPLACEPANE_H
32
33#include "precomp.h"
34#include <wx/fdrepdlg.h>
35#include <wx/event.h>
36#include <wx/panel.h>
37#include <wx/radiobut.h>
38#include <wx/checkbox.h>
39#include <wx/textctrl.h>
40
43class FindReplacePane : public wxPanel
44{
45public:
46 virtual ~FindReplacePane();
47 class FindReplaceData: public wxFindReplaceData
48 {
49 public:
51 bool GetRegexSearch() const {return m_regexSearch;}
52 void SetRegexSearch(bool regexSearch) {m_regexSearch = regexSearch;}
53 private:
54 bool m_regexSearch;
55 };
56
57private:
59 FindReplaceData *m_findReplaceData;
60 wxTextCtrl *m_searchText;
61 wxTextCtrl *m_replaceText;
62 wxButton *m_searchButton;
63 wxButton *m_replaceButton;
64 wxButton *m_replaceAllButton;
65 wxRadioButton *m_forward;
66 wxRadioButton *m_backwards;
67 wxRadioButton *m_regexSearch;
68 wxRadioButton *m_simpleSearch;
69 wxCheckBox *m_matchCase;
70 wxCheckBox *m_searchInInput;
71 wxCheckBox *m_searchInOutput;
72public:
73 FindReplacePane(wxWindow *parent, FindReplaceData *data);
74
75 void SetFocus() override;
76
77 bool GetRegexSearch() const {return m_findReplaceData->GetRegexSearch();}
78
79 wxString GetFindString() const
80 { return m_findReplaceData->GetFindString(); }
81
82 void SetFindString(wxString strng);
83
84 wxFindReplaceData *GetData() const
85 { return m_findReplaceData; }
86
87 enum {
88 wxFR_SEARCH_IN_INPUT = 0x10,
89 wxFR_SEARCH_IN_OUTPUT = 0x20
90 };
91
92protected:
93 void OnSearch(wxCommandEvent &event);
94
95 void OnReplace(wxCommandEvent &event);
96
97 void OnReplaceAll(wxCommandEvent &event);
98
99 void OnReplaceStringChange(wxCommandEvent &event);
100
101 void OnFindStringChange(wxCommandEvent &event);
102
103 void OnDirectionChange(wxCommandEvent &event);
104
105 void OnRegexSimpleChange(wxCommandEvent &event);
106
107 void OnMatchCase(wxCommandEvent &event);
108
109 void OnSearchIn(wxCommandEvent &event);
110
111 void OnKeyDown(wxKeyEvent &event);
112};
113
114#endif // FINDREPLACEPANE_H
Definition: FindReplacePane.h:48
The find+replace pane.
Definition: FindReplacePane.h:44