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#include <wx/combobox.h>
41#include <wx/config.h>
42
45class FindReplacePane : public wxPanel
46{
47public:
48 virtual ~FindReplacePane();
49 class FindReplaceData: public wxFindReplaceData
50 {
51 public:
53 bool GetRegexSearch() const {return m_regexSearch;}
54 void SetRegexSearch(bool regexSearch) {m_regexSearch = regexSearch;}
55 private:
56 bool m_regexSearch;
57 };
58
59private:
61 FindReplaceData *m_findReplaceData;
63 static constexpr int m_historyLength = 15;
65 wxComboBox *m_searchText;
66 wxComboBox *m_replaceText;
69 void LoadHistory(wxComboBox *combo, const wxString &key);
72 void AddToHistory(wxComboBox *combo, const wxString &key, const wxString &value);
73 wxButton *m_searchButton;
74 wxButton *m_replaceButton;
75 wxButton *m_replaceAllButton;
76 wxRadioButton *m_forward;
77 wxRadioButton *m_backwards;
78 wxRadioButton *m_regexSearch;
79 wxRadioButton *m_simpleSearch;
80 wxCheckBox *m_matchCase;
81 wxCheckBox *m_searchInInput;
82 wxCheckBox *m_searchInOutput;
83public:
84 FindReplacePane(wxWindow *parent, FindReplaceData *data);
85
86 void SetFocus() override;
87
88 bool GetRegexSearch() const {return m_findReplaceData->GetRegexSearch();}
89
90 wxString GetFindString() const
91 { return m_findReplaceData->GetFindString(); }
92
93 void SetFindString(wxString strng);
94
95 wxFindReplaceData *GetData() const
96 { return m_findReplaceData; }
97
98 enum {
99 wxFR_SEARCH_IN_INPUT = 0x10,
100 wxFR_SEARCH_IN_OUTPUT = 0x20
101 };
102
103protected:
104 void OnSearch(wxCommandEvent &event);
105
106 void OnReplace(wxCommandEvent &event);
107
108 void OnReplaceAll(wxCommandEvent &event);
109
110 void OnReplaceStringChange(wxCommandEvent &event);
111
112 void OnFindStringChange(wxCommandEvent &event);
113
114 void OnDirectionChange(wxCommandEvent &event);
115
116 void OnRegexSimpleChange(wxCommandEvent &event);
117
118 void OnMatchCase(wxCommandEvent &event);
119
120 void OnSearchIn(wxCommandEvent &event);
121
122 void OnKeyDown(wxKeyEvent &event);
123};
124
125#endif // FINDREPLACEPANE_H
Definition: FindReplacePane.h:50
The find+replace pane.
Definition: FindReplacePane.h:46