diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2021-08-08 22:50:12 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2021-08-08 22:50:12 -0400 |
commit | 3da3e76f17912e1105c090b738edc1cf2a8ad861 (patch) | |
tree | ce97d33dd8a34193564f3b4c81448243d6996341 /source/file.cpp | |
parent | bf0a126e8a9d30b77007829166f4bf91a3900079 (diff) |
swap status bar for log view
Diffstat (limited to 'source/file.cpp')
-rw-r--r-- | source/file.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/file.cpp b/source/file.cpp index 355ab7b..3e5284e 100644 --- a/source/file.cpp +++ b/source/file.cpp @@ -26,7 +26,7 @@ #include <vector> extern TextEditor editor; -extern std::string statusMessage; +extern void log(const std::string& str); enum class FileAction { None, @@ -43,7 +43,7 @@ static void saveCurrentFile() if (std::ofstream ofs (fileCurrentPath, std::ios::binary); ofs.good()) { const auto& text = editor.GetText(); ofs.write(text.data(), text.size()); - statusMessage = "Saved."; + log("Saved."); } } @@ -70,7 +70,7 @@ void fileRenderMenu() // TODO modified? fileCurrentPath.clear(); editor.SetText(stmdsp::file_content); - statusMessage = "Ready."; + log("Ready."); } if (ImGui::MenuItem("Open")) { @@ -87,7 +87,7 @@ void fileRenderMenu() // Treat like new file. fileCurrentPath.clear(); - statusMessage = "Ready."; + log("Ready."); } } @@ -110,6 +110,7 @@ void fileRenderMenu() "ChooseFileDlgKey", "Choose File", ".cpp", "."); } + ImGui::Separator(); if (ImGui::MenuItem("Quit")) { extern bool done; done = true; @@ -131,7 +132,7 @@ void fileRenderDialog() case FileAction::Open: fileCurrentPath = filePathName; openCurrentFile(); - statusMessage = "Ready."; + log("Ready."); break; case FileAction::SaveAs: fileCurrentPath = filePathName; |