| 2623 | } |
| 2624 | |
| 2625 | void IGFD::FileManager::DrawDirectoryCreation(const FileDialogInternal& vFileDialogInternal) { |
| 2626 | if (vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_DisableCreateDirectoryButton) return; |
| 2627 | |
| 2628 | if (IMGUI_BUTTON(createDirButtonString)) { |
| 2629 | if (!m_CreateDirectoryMode) { |
| 2630 | m_CreateDirectoryMode = true; |
| 2631 | IGFD::Utils::ResetBuffer(directoryNameBuffer); |
| 2632 | } |
| 2633 | } |
| 2634 | if (ImGui::IsItemHovered()) ImGui::SetTooltip(buttonCreateDirString); |
| 2635 | |
| 2636 | if (m_CreateDirectoryMode) { |
| 2637 | ImGui::SameLine(); |
| 2638 | |
| 2639 | ImGui::PushItemWidth(100.0f); |
| 2640 | ImGui::InputText("##DirectoryFileName", directoryNameBuffer, MAX_FILE_DIALOG_NAME_BUFFER); |
| 2641 | ImGui::PopItemWidth(); |
| 2642 | |
| 2643 | ImGui::SameLine(); |
| 2644 | |
| 2645 | if (IMGUI_BUTTON(okButtonString)) { |
| 2646 | std::string newDir = std::string(directoryNameBuffer); |
| 2647 | if (CreateDir(newDir)) { |
| 2648 | SetCurrentPath(m_CurrentPath + IGFD::Utils::GetPathSeparator() + newDir); |
| 2649 | OpenCurrentPath(vFileDialogInternal); |
| 2650 | } |
| 2651 | |
| 2652 | m_CreateDirectoryMode = false; |
| 2653 | } |
| 2654 | |
| 2655 | ImGui::SameLine(); |
| 2656 | |
| 2657 | if (IMGUI_BUTTON(cancelButtonString)) { |
| 2658 | m_CreateDirectoryMode = false; |
| 2659 | } |
| 2660 | } |
| 2661 | |
| 2662 | ImGui::SameLine(); |
| 2663 | } |
| 2664 | |
| 2665 | void IGFD::FileManager::DrawPathComposer(const FileDialogInternal& vFileDialogInternal) { |
| 2666 | if (IMGUI_BUTTON(resetButtonString)) { |