|
|
@ -56,6 +56,12 @@ static void openCurrentFile()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void openNewFile()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
fileCurrentPath.clear();
|
|
|
|
|
|
|
|
editor.SetText(stmdsp::file_content);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void fileScanTemplates()
|
|
|
|
void fileScanTemplates()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto path = std::filesystem::current_path() / "templates";
|
|
|
|
auto path = std::filesystem::current_path() / "templates";
|
|
|
@ -68,8 +74,7 @@ void fileRenderMenu()
|
|
|
|
if (ImGui::BeginMenu("File")) {
|
|
|
|
if (ImGui::BeginMenu("File")) {
|
|
|
|
if (ImGui::MenuItem("New")) {
|
|
|
|
if (ImGui::MenuItem("New")) {
|
|
|
|
// TODO modified?
|
|
|
|
// TODO modified?
|
|
|
|
fileCurrentPath.clear();
|
|
|
|
openNewFile();
|
|
|
|
editor.SetText(stmdsp::file_content);
|
|
|
|
|
|
|
|
log("Ready.");
|
|
|
|
log("Ready.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -129,18 +134,13 @@ void fileRenderDialog()
|
|
|
|
if (ImGuiFileDialog::Instance()->IsOk()) {
|
|
|
|
if (ImGuiFileDialog::Instance()->IsOk()) {
|
|
|
|
std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName();
|
|
|
|
std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName();
|
|
|
|
|
|
|
|
|
|
|
|
switch (fileAction) {
|
|
|
|
if (fileAction == FileAction::Open) {
|
|
|
|
case FileAction::None:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileAction::Open:
|
|
|
|
|
|
|
|
fileCurrentPath = filePathName;
|
|
|
|
fileCurrentPath = filePathName;
|
|
|
|
openCurrentFile();
|
|
|
|
openCurrentFile();
|
|
|
|
log("Ready.");
|
|
|
|
log("Ready.");
|
|
|
|
break;
|
|
|
|
} else if (fileAction == FileAction::SaveAs) {
|
|
|
|
case FileAction::SaveAs:
|
|
|
|
|
|
|
|
fileCurrentPath = filePathName;
|
|
|
|
fileCurrentPath = filePathName;
|
|
|
|
saveCurrentFile();
|
|
|
|
saveCurrentFile();
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|