35 #include <wx/textctrl.h>
36 #include <wx/stattext.h>
60 createContents(
this,
true,
true);
62 matchCase_->SetValue(
false);
63 findPrevBtn_->Disable();
64 findNextBtn_->Disable();
85 wxString inputwxString =
opInput_->GetValue();
87 if (inputwxString.Length() > 2) {
90 bool found =
find(pattern);
98 wxT(
" matched lines"));
105 infoLabel_->SetLabel(wxT(
"Pattern not found"));
123 if (matchedSize == 0) {
145 if (matchedSize == 0) {
176 for (
int i = 0; i <
program.instructionCount(); i++) {
179 std::string instrString =
"";
181 for (
int j = 0; j < instruction.
moveCount(); j++) {
186 instrString.erase(remove_if(instrString.begin(), instrString.end(),
187 isspace), instrString.end());
188 pattern.erase(remove_if(pattern.begin(), pattern.end(),
189 isspace), pattern.end());
192 std::transform(instrString.begin(), instrString.end(),
193 instrString.begin(), ::tolower);
194 std::transform(pattern.begin(), pattern.end(), pattern.begin(),
198 found = instrString.find(pattern);
199 if (found != std::string::npos) {
212 wxWindow *parent,
bool call_fit,
bool set_sizer) {
214 wxBoxSizer *mainSizer =
new wxBoxSizer(wxVERTICAL);
215 wxBoxSizer *buttonSizer =
new wxBoxSizer(wxHORIZONTAL);
218 wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
219 mainSizer->Add(
opInput_, 0, wxALL|wxEXPAND, 5);
222 wxDefaultPosition, wxDefaultSize);
223 mainSizer->Add(
matchCase_, 0, wxALL|wxEXPAND, 5);
226 wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
227 mainSizer->Add(
infoLabel_, 0, wxALL|wxEXPAND, 5);
230 wxDefaultPosition, wxDefaultSize, 0);
232 wxDefaultPosition, wxDefaultSize, 0);
237 mainSizer->Add(buttonSizer, 0, wxALIGN_CENTER|wxALL, 5);
240 parent->SetSizer(mainSizer);
242 mainSizer->SetSizeHints(parent);