OpenASIP  2.0
FindWindow.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2017 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file FindWindow.hh
26  *
27  * Declaration of FindWindow class.
28  *
29  * @author Alex Hirvonen 2017 (alex.hirvonen-no.spam-gmail.com)
30  * @note rating: red
31  */
32 
33 
34 #ifndef TTA_FIND_WINDOW_HH
35 #define TTA_FIND_WINDOW_HH
36 
37 
38 #include <vector>
39 #include <string>
40 #include <wx/wx.h>
41 #include <wx/checkbox.h>
42 
43 #include "ProximSimulatorWindow.hh"
44 
45 
46 /**
47  * Window for searching text patterns in disassembly instructions.
48  */
50 public:
51  FindWindow(ProximMainFrame* parent, int id);
52  virtual ~FindWindow();
53  virtual void reset();
54 
55 private:
56  void onInputText(wxCommandEvent& event);
57  void onFindPrev(wxCommandEvent& event);
58  void onFindNext(wxCommandEvent& event);
59  bool find(std::string searchString);
60 
61  wxSizer* createContents(wxWindow *parent, bool call_fit, bool set_sizer);
62 
63  wxTextCtrl* opInput_;
64  wxCheckBox* matchCase_;
65  wxStaticText* infoLabel_;
66  wxButton* findPrevBtn_;
67  wxButton* findNextBtn_;
68 
69  /// List of code linenumbers where serached text was found
70  std::vector<int> matchedLines;
71  /// Currently displayed codeline index in matchedLines
73 
74  /// Widget IDs.
75  enum {
81  };
82  DECLARE_EVENT_TABLE()
83 };
84 #endif
ProximMainFrame
Definition: ProximMainFrame.hh:58
ProximSimulatorWindow.hh
FindWindow::matchedLines
std::vector< int > matchedLines
List of code linenumbers where serached text was found.
Definition: FindWindow.hh:70
FindWindow::findNextBtn_
wxButton * findNextBtn_
Definition: FindWindow.hh:67
FindWindow::matchedIndex
int matchedIndex
Currently displayed codeline index in matchedLines.
Definition: FindWindow.hh:72
FindWindow
Definition: FindWindow.hh:49
ProximSimulatorWindow
Definition: ProximSimulatorWindow.hh:47
FindWindow::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: FindWindow.cc:211
FindWindow::FindWindow
FindWindow(ProximMainFrame *parent, int id)
Definition: FindWindow.cc:57
FindWindow::onFindPrev
void onFindPrev(wxCommandEvent &event)
Definition: FindWindow.cc:120
FindWindow::ID_MATCH_CASE
@ ID_MATCH_CASE
Definition: FindWindow.hh:77
FindWindow::infoLabel_
wxStaticText * infoLabel_
Definition: FindWindow.hh:65
FindWindow::opInput_
wxTextCtrl * opInput_
Definition: FindWindow.hh:63
FindWindow::onFindNext
void onFindNext(wxCommandEvent &event)
Definition: FindWindow.cc:142
FindWindow::ID_FIND_NEXT
@ ID_FIND_NEXT
Definition: FindWindow.hh:80
FindWindow::onInputText
void onInputText(wxCommandEvent &event)
Definition: FindWindow.cc:84
FindWindow::reset
virtual void reset()
Definition: FindWindow.cc:76
FindWindow::ID_FIND_PREV
@ ID_FIND_PREV
Definition: FindWindow.hh:79
FindWindow::findPrevBtn_
wxButton * findPrevBtn_
Definition: FindWindow.hh:66
FindWindow::ID_OP_INPUT
@ ID_OP_INPUT
Definition: FindWindow.hh:76
FindWindow::find
bool find(std::string searchString)
Definition: FindWindow.cc:169
FindWindow::ID_INFO_LABEL
@ ID_INFO_LABEL
Definition: FindWindow.hh:78
FindWindow::matchCase_
wxCheckBox * matchCase_
Definition: FindWindow.hh:64
FindWindow::~FindWindow
virtual ~FindWindow()
Definition: FindWindow.cc:68