aboutsummaryrefslogtreecommitdiffstats
path: root/gui/wxmain.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2020-10-18 21:20:00 -0400
committerClyne Sullivan <clyne@bitgloo.com>2020-10-18 21:20:00 -0400
commit241a089c39c77345e8e0a0c8a04301ba2271e432 (patch)
treeebce9026eed4bd0561f4422fcdc35149ba338487 /gui/wxmain.cpp
parent9c98bfb62c3d981eb95957186b3c85e735e0b2f5 (diff)
document/standardize; add compile log to gui
Diffstat (limited to 'gui/wxmain.cpp')
-rw-r--r--gui/wxmain.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/gui/wxmain.cpp b/gui/wxmain.cpp
index d4f4878..874f26e 100644
--- a/gui/wxmain.cpp
+++ b/gui/wxmain.cpp
@@ -63,9 +63,13 @@ MainFrame::MainFrame() : wxFrame(nullptr, -1, "stmdspgui", wxPoint(50, 50), wxSi
auto window = new wxBoxSizer(wxVERTICAL);
- m_text_editor = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(620, 700));
+ m_text_editor = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(620, 500));
prepareEditor();
- window->Add(m_text_editor, 1, wxEXPAND | wxALL, 10);
+ window->Add(m_text_editor, 2, wxEXPAND | wxALL, 10);
+
+ m_compile_output = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
+ wxTE_READONLY | wxTE_MULTILINE | wxHSCROLL);
+ window->Add(m_compile_output, 1, wxEXPAND | wxALL, 10);
SetSizerAndFit(window);
@@ -168,9 +172,15 @@ wxString MainFrame::compileEditorCode()
makefile.Write(make_text);
makefile.Close();
+ wxString make_output = temp_file_name + "make.log";
wxString make_command = wxString("make -C ") + temp_file_name.BeforeLast('/') +
- " -f " + temp_file_name + "make";
- if (system(make_command.ToAscii()) == 0) {
+ " -f " + temp_file_name + "make" +
+ " > " + make_output + " 2>&1";
+
+ int result = system(make_command.ToAscii());
+ m_compile_output->LoadFile(make_output);
+
+ if (result == 0) {
m_status_bar->SetStatusText("Compilation succeeded.");
return temp_file_name + ".o";
} else {