Skip to content

Commit

Permalink
[FIX] : fix compilation of app
Browse files Browse the repository at this point in the history
  • Loading branch information
aiekick committed Nov 4, 2023
1 parent 9431254 commit 5a83b7e
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,53 +178,53 @@ class CustomDrawReadOnlyCheckBoxFileDialog : public ImGuiFileDialog {
}

protected:
bool prDrawFooter() override {
auto& fdFile = prFileDialogInternal.puFileManager;
bool m_DrawFooter() override {
auto& fdFile = m_FileDialogInternal.fileManager;

float posY = ImGui::GetCursorPos().y; // height of last bar calc
ImGui::AlignTextToFramePadding();
if (!fdFile.puDLGDirectoryMode)
if (!fdFile.dLGDirectoryMode)
ImGui::Text("File Name :");
else // directory chooser
ImGui::Text("Directory Path :");
ImGui::SameLine();

// Input file fields
float width = ImGui::GetContentRegionAvail().x;
if (!fdFile.puDLGDirectoryMode) {
if (!fdFile.dLGDirectoryMode) {
ImGuiContext& g = *GImGui;
width -= 150.0f + g.Style.ItemSpacing.x;
}

ImGui::PushItemWidth(width);
ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue;
if (prFileDialogInternal.puDLGflags & ImGuiFileDialogFlags_ReadOnlyFileNameField) {
if (m_FileDialogInternal.dLGflags & ImGuiFileDialogFlags_ReadOnlyFileNameField) {
flags |= ImGuiInputTextFlags_ReadOnly;
}
if (ImGui::InputText("##FileName", fdFile.puFileNameBuffer, MAX_FILE_DIALOG_NAME_BUFFER, flags)) {
prFileDialogInternal.puIsOk = true;
if (ImGui::InputText("##FileName", fdFile.fileNameBuffer, MAX_FILE_DIALOG_NAME_BUFFER, flags)) {
m_FileDialogInternal.isOk = true;
}
if (ImGui::GetItemID() == ImGui::GetActiveID()) prFileDialogInternal.puFileInputIsActive = true;
if (ImGui::GetItemID() == ImGui::GetActiveID()) m_FileDialogInternal.fileInputIsActive = true;
ImGui::PopItemWidth();

// combobox of filters
prFileDialogInternal.puFilterManager.DrawFilterComboBox(prFileDialogInternal);
m_FileDialogInternal.filterManager.DrawFilterComboBox(m_FileDialogInternal);

bool res = prDrawValidationButtons();
bool res = m_DrawValidationButtons();

ImGui::SameLine();

if (ImGui::Checkbox("Read-Only", &m_ReadOnly)) {
if (m_ReadOnly) {
// remove confirm overwirte check since we are read only
prFileDialogInternal.puDLGflags &= ~ImGuiFileDialogFlags_ConfirmOverwrite;
m_FileDialogInternal.dLGflags &= ~ImGuiFileDialogFlags_ConfirmOverwrite;
} else {
// add confirm overwirte since is what we want in our case
prFileDialogInternal.puDLGflags |= ImGuiFileDialogFlags_ConfirmOverwrite;
m_FileDialogInternal.dLGflags |= ImGuiFileDialogFlags_ConfirmOverwrite;
}
}

prFileDialogInternal.puFooterHeight = ImGui::GetCursorPosY() - posY;
m_FileDialogInternal.footerHeight = ImGui::GetCursorPosY() - posY;
return res;
}
};
Expand Down

0 comments on commit 5a83b7e

Please sign in to comment.