ImGuiFileDialog is a file selection dialog built for (and using only) Dear ImGui

Overview

ImGuiFileDialog

Purpose

ImGuiFileDialog is a file selection dialog built for (and using only) Dear ImGui.

My primary goal was to have a custom pane with widgets according to file extension. This was not possible using other solutions.

ImGui Supported Version

ImGuiFileDialog follow the master and docking branch of ImGui . currently ImGui 1.87 WIP

Structure

This library is designed to be dropped into your source code rather than compiled separately.

From your project directory:

mkdir lib    
   
    
cd lib
git clone https://github.com/aiekick/ImGuiFileDialog.git
git checkout Lib_Only

   

These commands create a lib directory where you can store any third-party dependencies used in your project, downloads the ImGuiFileDialog git repository and checks out the Lib_Only branch where the actual library code is located.

Add lib/ImGuiFileDialog/ImGuiFileDialog.cpp to your build system and include lib/ImGuiFileDialog/ImGuiFileDialog.h in your source code. ImGuiFileLib will compile with and be included directly in your executable file.

If, for example, your project uses cmake, look for a line like add_executable(my_project_name main.cpp) and change it to add_executable(my_project_name lib/ImGuiFileDialog/ImGuiFileDialog.cpp main.cpp). This tells the compiler where to find the source code declared in ImGuiFileDialog.h which you included in your own source code.

Requirements:

You must also, of course, have added Dear ImGui to your project for this to work at all.

dirent v1.23 is required to use ImGuiFileDialog under Windows. It is included in the Lib_Only branch for your convenience.

Features

  • Separate system for call and display
    • Can have many function calls with different parameters for one display function, for example
  • Can create a custom pane with any widgets via function binding
    • This pane can block the validation of the dialog
    • Can also display different things according to current filter and UserDatas
  • Advanced file style for file/dir/link coloring / icons / font
  • Multi-selection (ctrl/shift + click) :
    • 0 => Infinite
    • 1 => One file (default)
    • n => n files
  • Compatible with MacOs, Linux, Windows
    • Windows version can list drives
  • Supports modal or standard dialog types
  • Select files or directories
  • Filter groups and custom filter names
  • Keyboard navigation (arrows, backspace, enter)
  • Exploring by entering characters (case insensitive)
  • Directory bookmarks
  • Directory manual entry (right click on any path element)
  • Optional 'Confirm to Overwrite" dialog if file exists
  • Thumbnails Display (agnostic way for compatibility with any backend, sucessfully tested with OpenGl and Vulkan)
  • C Api (succesfully tested with CimGui)

Singleton Pattern vs. Multiple Instances

Single Dialog :

If you only need to display one file dialog at a time, use ImGuiFileDialog's singleton pattern to avoid explicitly declaring an object:

ImGuiFileDialog::Instance()->method_of_your_choice();

Multiple Dialogs :

If you need to have multiple file dialogs open at once, declare each dialog explicity:

ImGuiFileDialog instance_a;
instance_a.method_of_your_choice();
ImGuiFileDialog instance_b;
instance_b.method_of_your_choice();

Simple Dialog :

OpenDialog("ChooseFileDlgKey", "Choose File", ".cpp,.h,.hpp", "."); // display if (ImGuiFileDialog::Instance()->Display("ChooseFileDlgKey")) { // action if OK if (ImGuiFileDialog::Instance()->IsOk()) { std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName(); std::string filePath = ImGuiFileDialog::Instance()->GetCurrentPath(); // action } // close ImGuiFileDialog::Instance()->Close(); } }">
void drawGui()
{ 
  // open Dialog Simple
  if (ImGui::Button("Open File Dialog"))
    ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose File", ".cpp,.h,.hpp", ".");

  // display
  if (ImGuiFileDialog::Instance()->Display("ChooseFileDlgKey")) 
  {
    // action if OK
    if (ImGuiFileDialog::Instance()->IsOk())
    {
      std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName();
      std::string filePath = ImGuiFileDialog::Instance()->GetCurrentPath();
      // action
    }
    
    // close
    ImGuiFileDialog::Instance()->Close();
  }
}

alt text

Directory Chooser :

To have a directory chooser, set the file extension filter to nullptr:

ImGuiFileDialog::Instance()->OpenDialog("ChooseDirDlgKey", "Choose a Directory", nullptr, ".");

In this mode you can select any directory with one click and open a directory with a double-click.

directoryChooser

Dialog with Custom Pane :

The signature of the custom pane callback is:

for C++ :

void(const char *vFilter, IGFDUserDatas vUserDatas, bool *vCantContinue)

for C :

void(const char *vFilter, void* vUserDatas, bool *vCantContinue)

Example :

OpenDialog("ChooseFileDlgKey", "Choose File", ".cpp,.h,.hpp", ".", "", std::bind(&InfosPane, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), 350, 1, UserDatas("InfosPane")); // display and action if ok if (ImGuiFileDialog::Instance()->Display("ChooseFileDlgKey")) { if (ImGuiFileDialog::Instance()->IsOk()) { std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName(); std::string filePath = ImGuiFileDialog::Instance()->GetCurrentPath(); std::string filter = ImGuiFileDialog::Instance()->GetCurrentFilter(); // here convert from string because a string was passed as a userDatas, but it can be what you want std::string userDatas; if (ImGuiFileDialog::Instance()->GetUserDatas()) userDatas = std::string((const char*)ImGuiFileDialog::Instance()->GetUserDatas()); auto selection = ImGuiFileDialog::Instance()->GetSelection(); // multiselection // action } // close ImGuiFileDialog::Instance()->Close(); } }">
static bool canValidateDialog = false;
inline void InfosPane(cosnt char *vFilter, IGFDUserDatas vUserDatas, bool *vCantContinue) // if vCantContinue is false, the user cant validate the dialog
{
    ImGui::TextColored(ImVec4(0, 1, 1, 1), "Infos Pane");
    ImGui::Text("Selected Filter : %s", vFilter.c_str());
    if (vUserDatas)
        ImGui::Text("UserDatas : %s", vUserDatas);
    ImGui::Checkbox("if not checked you cant validate the dialog", &canValidateDialog);
    if (vCantContinue)
        *vCantContinue = canValidateDialog;
}

void drawGui()
{
  // open Dialog with Pane
  if (ImGui::Button("Open File Dialog with a custom pane"))
    ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose File", ".cpp,.h,.hpp",
            ".", "", std::bind(&InfosPane, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), 350, 1, UserDatas("InfosPane"));

  // display and action if ok
  if (ImGuiFileDialog::Instance()->Display("ChooseFileDlgKey")) 
  {
    if (ImGuiFileDialog::Instance()->IsOk())
    {
        std::string filePathName = ImGuiFileDialog::Instance()->GetFilePathName();
        std::string filePath = ImGuiFileDialog::Instance()->GetCurrentPath();
        std::string filter = ImGuiFileDialog::Instance()->GetCurrentFilter();
        // here convert from string because a string was passed as a userDatas, but it can be what you want
        std::string userDatas;
        if (ImGuiFileDialog::Instance()->GetUserDatas())
            userDatas = std::string((const char*)ImGuiFileDialog::Instance()->GetUserDatas()); 
        auto selection = ImGuiFileDialog::Instance()->GetSelection(); // multiselection

        // action
    }
    // close
    ImGuiFileDialog::Instance()->Close();
  }
}

alt text

File Style : Custom icons and colors by extension

You can define style for files/dirs/links in many ways :

the style can be colors, icons and fonts

the general form is :

ImGuiFileDialog::Instance()->SetFileStyle(styleType, criteria, color, icon, font);

styleType can be thoses :

IGFD_FileStyleByTypeFile				// define style for all files
IGFD_FileStyleByTypeDir					// define style for all dir
IGFD_FileStyleByTypeLink				// define style for all link
IGFD_FileStyleByExtention				// define style by extention, for files or links
IGFD_FileStyleByFullName				// define style for particular file/dir/link full name (filename + extention)
IGFD_FileStyleByContainedInFullName		// define style for file/dir/link when criteria is contained in full name

ImGuiFileDialog accepts icon font macros as well as text tags for file types.

ImGuIFontStudio is useful here. I wrote it to make it easy to create custom icon sets for use with Dear ImGui.

It is inspired by IconFontCppHeaders, which can also be used with ImGuiFileDialog.

samples :

SetFileStyle(IGFD_FileStyleByExtention, ".gif", ImVec4(0.0f, 1.0f, 0.5f, 0.9f), "[GIF]"); // define style for all directories ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir, "", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FOLDER); // can be for a specific directory ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir, ".git", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FOLDER); // define style for all files ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile, "", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FILE); // can be for a specific file ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile, ".git", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FILE); // define style for all links ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeLink, "", ImVec4(0.5f, 1.0f, 0.9f, 0.9f)); // can be for a specific link ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeLink, "Readme.md", ImVec4(0.5f, 1.0f, 0.9f, 0.9f)); // define style for any files/dirs/links by fullname ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByFullName, "doc", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_FILE_PIC); // define style by file who are containing this string ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_BOOKMARK); all of theses can be miwed with IGFD_FileStyleByTypeDir / IGFD_FileStyleByTypeFile / IGFD_FileStyleByTypeLink like theses by ex : ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir | IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_BOOKMARK); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile | IGFD_FileStyleByFullName, "cmake", ImVec4(0.5f, 0.8f, 0.5f, 0.9f), ICON_IGFD_SAVE);">
// define style by file extention and Add an icon for .png files 
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".png", ImVec4(0.0f, 1.0f, 1.0f, 0.9f), ICON_IGFD_FILE_PIC, font1);
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".gif", ImVec4(0.0f, 1.0f, 0.5f, 0.9f), "[GIF]");

// define style for all directories
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir, "", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FOLDER);
// can be for a specific directory
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir, ".git", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FOLDER);

// define style for all files
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile, "", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FILE);
// can be for a specific file
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile, ".git", ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FILE);

// define style for all links
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeLink, "", ImVec4(0.5f, 1.0f, 0.9f, 0.9f));
// can be for a specific link
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeLink, "Readme.md", ImVec4(0.5f, 1.0f, 0.9f, 0.9f));

// define style for any files/dirs/links by fullname
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByFullName, "doc", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_FILE_PIC);

// define style by file who are containing this string
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_BOOKMARK);

all of theses can be miwed with IGFD_FileStyleByTypeDir / IGFD_FileStyleByTypeFile / IGFD_FileStyleByTypeLink
like theses by ex :
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir | IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_BOOKMARK);
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile | IGFD_FileStyleByFullName, "cmake", ImVec4(0.5f, 0.8f, 0.5f, 0.9f), ICON_IGFD_SAVE);

this sample code of master/main.cpp produce the picture above :

SetFileStyle(IGFD_FileStyleByExtention, ".h", ImVec4(0.0f, 1.0f, 0.0f, 0.9f)); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".hpp", ImVec4(0.0f, 0.0f, 1.0f, 0.9f)); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".md", ImVec4(1.0f, 0.0f, 1.0f, 0.9f)); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".png", ImVec4(0.0f, 1.0f, 1.0f, 0.9f), ICON_IGFD_FILE_PIC); // add an icon for the filter type ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".gif", ImVec4(0.0f, 1.0f, 0.5f, 0.9f), "[GIF]"); // add an text for a filter type ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir, nullptr, ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FOLDER); // for all dirs ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile, "CMakeLists.txt", ImVec4(0.1f, 0.5f, 0.5f, 0.9f), ICON_IGFD_ADD); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByFullName, "doc", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_FILE_PIC); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir | IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_BOOKMARK); ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile | IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.5f, 0.8f, 0.5f, 0.9f), ICON_IGFD_SAVE);">
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".cpp", ImVec4(1.0f, 1.0f, 0.0f, 0.9f));
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".h", ImVec4(0.0f, 1.0f, 0.0f, 0.9f));
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".hpp", ImVec4(0.0f, 0.0f, 1.0f, 0.9f));
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".md", ImVec4(1.0f, 0.0f, 1.0f, 0.9f));
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".png", ImVec4(0.0f, 1.0f, 1.0f, 0.9f), ICON_IGFD_FILE_PIC); // add an icon for the filter type
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention, ".gif", ImVec4(0.0f, 1.0f, 0.5f, 0.9f), "[GIF]"); // add an text for a filter type
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir, nullptr, ImVec4(0.5f, 1.0f, 0.9f, 0.9f), ICON_IGFD_FOLDER); // for all dirs
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile, "CMakeLists.txt", ImVec4(0.1f, 0.5f, 0.5f, 0.9f), ICON_IGFD_ADD);
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByFullName, "doc", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_FILE_PIC);
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeDir | IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.9f, 0.2f, 0.0f, 0.9f), ICON_IGFD_BOOKMARK);
ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByTypeFile | IGFD_FileStyleByContainedInFullName, ".git", ImVec4(0.5f, 0.8f, 0.5f, 0.9f), ICON_IGFD_SAVE);

alt text

Filter Collections

You can define a custom filter name that corresponds to a group of filters using this syntax:

custom_name1{filter1,filter2,filter3},custom_name2{filter1,filter2},filter1

When you select custom_name1, filters 1 to 3 will be applied. The characters { and } are reserved. Don't use them for filter names.

this code :

OpenDialog("ChooseFileDlgKey", ICON_IMFDLG_FOLDER_OPEN " Choose a File", filters, ".");">
const char *filters = "Source files (*.cpp *.h *.hpp){.cpp,.h,.hpp},Image files (*.png *.gif *.jpg *.jpeg){.png,.gif,.jpg,.jpeg},.md";
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", ICON_IMFDLG_FOLDER_OPEN " Choose a File", filters, ".");

will produce : alt text

Multi Selection

You can define in OpenDialog/OpenModal call the count file you want to select :

  • 0 => infinite
  • 1 => one file only (default)
  • n => n files only

See the define at the end of these funcs after path.

OpenDialog("ChooseFileDlgKey", "Choose 1 File", ".*,.cpp,.h,.hpp", ".", 1); ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose 5 File", ".*,.cpp,.h,.hpp", ".", 5); ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose many File", ".*,.cpp,.h,.hpp", ".", 0); ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose File", ".png,.jpg", ".", "", std::bind(&InfosPane, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), 350, 1, "SaveFile"); // 1 file">
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose File", ".*,.cpp,.h,.hpp", ".");
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose 1 File", ".*,.cpp,.h,.hpp", ".", 1);
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose 5 File", ".*,.cpp,.h,.hpp", ".", 5);
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose many File", ".*,.cpp,.h,.hpp", ".", 0);
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Choose File", ".png,.jpg",
   ".", "", std::bind(&InfosPane, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), 350, 1, "SaveFile"); // 1 file

alt text

File Dialog Constraints

You can set the minimum and/or maximum size of the dialog:

ImVec2 maxSize = ImVec2((float)display_w, (float)display_h);  // The full display area
ImVec2 minSize = maxSize * 0.5f;  // Half the display area
ImGuiFileDialog::Instance()->Display("ChooseFileDlgKey", ImGuiWindowFlags_NoCollapse, minSize, maxSize);

alt text

Detail View Mode

Dear ImGui just released an improved table API. If your downloaded version of Dear ImGui includes the beta version of table support (included for some time now) you can enable table support by uncommenting #define USE_IMGUI_TABLES in you custom config file (CustomImGuiFileDialogConfig.h)

If your version of Dear ImGui has finalized tables support, it will be enabled by default. alt text

Exploring by keys

You can activate this feature by uncommenting #define USE_EXPLORATION_BY_KEYS in your custom config file (CustomImGuiFileDialogConfig.h)

You can also uncomment the next lines to define navigation keys:

  • IGFD_KEY_UP => Up key for explore to the top
  • IGFD_KEY_DOWN => Down key for explore to the bottom
  • IGFD_KEY_ENTER => Enter key for open directory
  • IGFD_KEY_BACKSPACE => BackSpace for comming back to the last directory

You can also jump to a point in the file list by pressing the corresponding key of the first filename character.

alt text

As you see the current item is flashed by default for 1 second. You can define the flashing lifetime with the function

ImGuiFileDialog::Instance()->SetFlashingAttenuationInSeconds(1.0f);

Bookmarks

You can create/edit/call path bookmarks and load/save them.

Activate this feature by uncommenting: #define USE_BOOKMARK in your custom config file (CustomImGuiFileDialogConfig.h)

More customization options:

the text in the toggle button #define bookmarksButtonHelpString "Bookmark" => the helper text when mouse over the button #define addBookmarkButtonString "+" => the button for add a bookmark #define removeBookmarkButtonString "-" => the button for remove the selected bookmark">
#define bookmarkPaneWith 150.0f => width of the bookmark pane
#define IMGUI_TOGGLE_BUTTON ToggleButton => customize the Toggled button (button stamp must be : (const char* label, bool *toggle)
#define bookmarksButtonString "Bookmark" => the text in the toggle button
#define bookmarksButtonHelpString "Bookmark" => the helper text when mouse over the button
#define addBookmarkButtonString "+" => the button for add a bookmark
#define removeBookmarkButtonString "-" => the button for remove the selected bookmark
  • You can select each bookmark to edit the displayed name corresponding to a path
  • Double-click on the label to apply the bookmark

bookmarks.gif

You can also serialize/deserialize bookmarks (for example to load/save from/to a file):

Load => ImGuiFileDialog::Instance()->DeserializeBookmarks(bookmarString);
Save => std::string bookmarkString = ImGuiFileDialog::Instance()->SerializeBookmarks();

(please see example code for details)

Path Edition :

Right clicking on any path element button allows the user to manually edit the path from that portion of the tree. Pressing the completion key (GLFW uses enter by default) validates the new path. Pressing the cancel key (GLFW usesescape by default) cancels the manual entry and restores the original path.

Here's the manual entry operation in action: inputPathEdition.gif

Confirm Overwrite Dialog :

If you want avoid overwriting files after selection, ImGuiFileDialog can show a dialog to confirm or cancel the operation.

To do so, define the flag ImGuiFileDialogFlags_ConfirmOverwrite in your call to OpenDialog/OpenModal.

By default this flag is not set since there is no pre-defined way to define if a dialog will be for Open or Save behavior. (by design! :) )

Example code For Standard Dialog :

ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey",
    ICON_IGFD_SAVE " Choose a File", filters,
    ".", "", 1, nullptr, ImGuiFileDialogFlags_ConfirmOverwrite);

Example code For Modal Dialog :

ImGuiFileDialog::Instance()->OpenModal("ChooseFileDlgKey",
    ICON_IGFD_SAVE " Choose a File", filters,
    ".", "", 1, nullptr, ImGuiFileDialogFlags_ConfirmOverwrite);

This dialog will only verify the file in the file field, not with GetSelection().

The confirmation dialog will be a non-movable modal (input blocking) dialog displayed in the middle of the current ImGuiFileDialog window.

As usual, you can customize the dialog in your custom config file (CustomImGuiFileDialogConfig.h in this example)

Uncomment these line for customization options:

//#define OverWriteDialogTitleString "The file Already Exist !"
//#define OverWriteDialogMessageString "Would you like to OverWrite it ?"
//#define OverWriteDialogConfirmButtonString "Confirm"
//#define OverWriteDialogCancelButtonString "Cancel"

See the result :

ConfirmToOverWrite.gif

Open / Save dialog Behavior :

ImGuiFileDialog uses the same code internally for Open and Save dialogs. To distinguish between them access the various data return functions depending on what the dialog is doing.

When selecting an existing file (for example, a Load or Open dialog), use

std::map 
   GetSelection(); 
   // Returns selection via a map
    
UserDatas 
   GetUserDatas();                          
   // Get user data provided by the Open dialog
  

To selecting a new file (for example, a Save As... dialog), use:

std::string GetFilePathName();                     // Returns the content of the selection field with current file extension and current path
std::string GetCurrentFileName();                  // Returns the content of the selection field with current file extension but no path
std::string GetCurrentPath();                      // Returns current path only
std::string GetCurrentFilter();                    // The file extension

Thumbnails Display

You can now, display thumbnails of pictures.

thumbnails.gif

The file resize use stb/image so the following files extentions are supported :

  • .png (tested sucessfully)
  • .bmp (tested sucessfully)
  • .tga (tested sucessfully)
  • .jpg (tested sucessfully)
  • .jpeg (tested sucessfully)
  • .gif (tested sucessfully_ but not animation just first frame)
  • .psd (not tested)
  • .pic (not tested)
  • .ppm (not tested)
  • .pgm (not tested)

Corresponding to your backend (ex : OpenGl) you need to define two callbacks :

  • the first is a callback who will be called by ImGuiFileDialog for create the backend texture
  • the second is a callback who will be called by ImGuiFileDialog for destroy the backend texture

After that you need to call the function who is responsible to create / destroy the textures. this function must be called in your GPU Rendering zone for avoid destroying of used texture. if you do that at the same place of your imgui code, some backend can crash your app, by ex with vulkan.

ex, for opengl :

// Create thumbnails texture
ImGuiFileDialog::Instance()->SetCreateThumbnailCallback([](IGFD_Thumbnail_Info *vThumbnail_Info) -> void
{
	if (vThumbnail_Info && 
		vThumbnail_Info->isReadyToUpload && 
		vThumbnail_Info->textureFileDatas)
	{
		GLuint textureId = 0;
		glGenTextures(1, &textureId);
		vThumbnail_Info->textureID = (void*)textureId;

		glBindTexture(GL_TEXTURE_2D, textureId);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
			(GLsizei)vThumbnail_Info->textureWidth, (GLsizei)vThumbnail_Info->textureHeight, 
			0, GL_RGBA, GL_UNSIGNED_BYTE, vThumbnail_Info->textureFileDatas);
		glFinish();
		glBindTexture(GL_TEXTURE_2D, 0);

		delete[] vThumbnail_Info->textureFileDatas;
		vThumbnail_Info->textureFileDatas = nullptr;

		vThumbnail_Info->isReadyToUpload = false;
		vThumbnail_Info->isReadyToDisplay = true;
	}
});
// Destroy thumbnails texture
ImGuiFileDialog::Instance()->SetDestroyThumbnailCallback([](IGFD_Thumbnail_Info* vThumbnail_Info)
{
	if (vThumbnail_Info)
	{
		GLuint texID = (GLuint)vThumbnail_Info->textureID;
		glDeleteTextures(1, &texID);
		glFinish();
	}
});
// GPU Rendering Zone // To call for Create/ Destroy Textures
ImGuiFileDialog::Instance()->ManageGPUThumbnails();

How to Integrate ImGuiFileDialog in your project

Customize ImGuiFileDialog :

You can customize many aspects of ImGuiFileDialog by overriding ImGuiFileDialogConfig.h.

To enable your customizations, define the preprocessor directive CUSTOM_IMGUIFILEDIALOG_CONFIG with the path of your custom config file. This path must be relative to the directory where you put the ImGuiFileDialog module.

This operation is demonstrated in CustomImGuiFileDialog.h in the example project to:

  • Have a custom icon font instead of labels for buttons or message titles
  • Customize the button text (the button call signature must be the same, by the way! :)

The custom icon font used in the example code (CustomFont.cpp and CustomFont.h) was made with ImGuiFontStudio, which I wrote. :)

ImGuiFontStudio uses ImGuiFileDialog! Check it out.

Api's C/C++ :

C++.

this is the base API :

static FileDialog* Instance()                      // Singleton for easier accces form anywhere but only one dialog at a time

FileDialog();                                      // ImGuiFileDialog Constructor. can be used for have many dialog at same tiem (not possible with singleton)

// standard dialog
void OpenDialog(                                   // open simple dialog (path and fileName can be specified)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vPath,                      // path
    const std::string& vFileName,                  // defaut file name
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

void OpenDialog(                                   // open simple dialog (path and filename are obtained from filePathName)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vFilePathName,              // file path name (will be decompsoed in path and fileName)
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

// with pane
void OpenDialog(                                   // open dialog with custom right pane (path and fileName can be specified)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vPath,                      // path
    const std::string& vFileName,                  // defaut file name
    const PaneFun& vSidePane,                      // side pane
    const float& vSidePaneWidth = 250.0f,          // side pane width
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

void OpenDialog(                                   // open dialog with custom right pane (path and filename are obtained from filePathName)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vFilePathName,              // file path name (will be decompsoed in path and fileName)
    const PaneFun& vSidePane,                      // side pane
    const float& vSidePaneWidth = 250.0f,          // side pane width
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

// modal dialog
void OpenModal(                                    // open simple modal (path and fileName can be specified)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vPath,                      // path
    const std::string& vFileName,                  // defaut file name
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

void OpenModal(                                    // open simple modal (path and fielname are obtained from filePathName)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vFilePathName,              // file path name (will be decompsoed in path and fileName)
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

// with pane
void OpenModal(                                    // open modal with custom right pane (path and filename are obtained from filePathName)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vPath,                      // path
    const std::string& vFileName,                  // defaut file name
    const PaneFun& vSidePane,                      // side pane
    const float& vSidePaneWidth = 250.0f,                               // side pane width
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

void OpenModal(                                    // open modal with custom right pane (path and fielname are obtained from filePathName)
    const std::string& vKey,                       // key dialog
    const std::string& vTitle,                     // title
    const char* vFilters,                          // filters
    const std::string& vFilePathName,              // file path name (will be decompsoed in path and fileName)
    const PaneFun& vSidePane,                      // side pane
    const float& vSidePaneWidth = 250.0f,                               // side pane width
    const int& vCountSelectionMax = 1,             // count selection max
    UserDatas vUserDatas = nullptr,                // user datas (can be retrieved in pane)
    ImGuiFileDialogFlags vFlags = 0);              // ImGuiFileDialogFlags 

// Display / Close dialog form
bool Display(                                      // Display the dialog. return true if a result was obtained (Ok or not)
    const std::string& vKey,                       // key dialog to display (if not the same key as defined by OpenDialog/Modal => no opening)
    ImGuiWindowFlags vFlags = ImGuiWindowFlags_NoCollapse, // ImGuiWindowFlags
    ImVec2 vMinSize = ImVec2(0, 0),                // mininmal size contraint for the ImGuiWindow
    ImVec2 vMaxSize = ImVec2(FLT_MAX, FLT_MAX));   // maximal size contraint for the ImGuiWindow
void Close();                                      // close dialog

// queries
bool WasOpenedThisFrame(const std::string& vKey);  // say if the dialog key was already opened this frame
bool WasOpenedThisFrame();                         // say if the dialog was already opened this frame
bool IsOpened(const std::string& vKey);            // say if the key is opened
bool IsOpened();                                   // say if the dialog is opened somewhere    
std::string GetOpenedKey();                        // return the dialog key who is opened, return nothing if not opened

// get result
bool IsOk();                                       // true => Dialog Closed with Ok result / false : Dialog closed with cancel result
std::map 
   GetSelection(); 
   // Open File behavior : will return selection via a map
    
std::string 
   GetFilePathName();                     
   // Save File behavior : will always return the content of the field with current filter extention and current path
std::string 
   GetCurrentFileName();                  
   // Save File behavior : will always return the content of the field with current filter extention
std::string 
   GetCurrentPath();                      
   // will return current path
std::string 
   GetCurrentFilter();                    
   // will return selected filter
UserDatas 
   GetUserDatas();                          
   // will return user datas send with Open Dialog/Modal
        

   // extentions displaying

   void 
   SetExtentionInfos(                            
   // SetExtention datas for have custom display of particular file type
    
   const std::string& vFilter,                    
   // extention filter to tune
    
   const FileExtentionInfosStruct& vInfos);       
   // Filter Extention Struct who contain Color and Icon/Text for the display of the file with extention filter

   void 
   SetExtentionInfos(                            
   // SetExtention datas for have custom display of particular file type
    
   const std::string& vFilter,                    
   // extention filter to tune
    
   const ImVec4& vColor,                          
   // wanted color for the display of the file with extention filter
    
   const std::string& vIcon = 
   "");                
   // wanted text or icon of the file with extention filter

   bool 
   GetExtentionInfos(                            
   // GetExtention datas. return true is extention exist
    
   const std::string& vFilter,                    
   // extention filter (same as used in SetExtentionInfos)
    ImVec4 *vOutColor,                             
   // color to retrieve
    std::string* vOutIcon = 
   0);                    
   // icon or text to retrieve

   void 
   ClearExtentionInfos();                        
   // clear extentions setttings

feature : USE_EXPLORATION_BY_KEYS

   void 
   SetFlashingAttenuationInSeconds(              
   // set the flashing time of the line in file list when use exploration keys
    
   float vAttenValue);                            
   // set the attenuation (from flashed to not flashed) in seconds

feature : USE_BOOKMARK
std::string 
   SerializeBookmarks();                  
   // serialize bookmarks : return bookmark buffer to save in a file

   void 
   DeserializeBookmarks(                         
   // deserialize bookmarks : load bookmar buffer to load in the dialog (saved from previous use with SerializeBookmarks())
    
   const std::string& vBookmarks);                
   // bookmark buffer to load

feature : USE_THUMBNAILS

   void 
   SetCreateThumbnailCallback(
   const CreateThumbnailFun vCreateThumbnailFun);		
   // define the texture creation callback

   void 
   SetDestroyThumbnailCallback(
   const DestroyThumbnailFun vCreateThumbnailFun);	
   // define the texture destroy callback

   void 
   ManageGPUThumbnails();															
   // in gpu rendering zone, whill create or destroy textures
  

C Api

this api was sucessfully tested with CImGui

    struct IGFD_Selection_Pair
    {
        char* fileName;
        char* filePathName;
    };

    IMGUIFILEDIALOG_API IGFD_Selection_Pair IGFD_Selection_Pair_Get();  // return an initialized IGFD_Selection_Pair            
    IMGUIFILEDIALOG_API void IGFD_Selection_Pair_DestroyContent(
	    IGFD_Selection_Pair *vSelection_Pair);                          // destroy the content of a IGFD_Selection_Pair
    
    struct IGFD_Selection
    {
        IGFD_Selection_Pair* table;
        size_t count;
    };

    IMGUIFILEDIALOG_API IGFD_Selection IGFD_Selection_Get();            // return an initialized IGFD_Selection
    IMGUIFILEDIALOG_API void IGFD_Selection_DestroyContent(
	    IGFD_Selection* vSelection);                                    // destroy the content of a IGFD_Selection

    // constructor / destructor
    IMGUIFILEDIALOG_API ImGuiFileDialog* IGFD_Create(void);             // create the filedialog context
    IMGUIFILEDIALOG_API void IGFD_Destroy(ImGuiFileDialog *vContext);   // destroy the filedialog context

    typedef void (*IGFD_PaneFun)(const char*, void*, bool*);            // callback fucntion for display the pane
    
    IMGUIFILEDIALOG_API void IGFD_OpenDialog(                           // open a standard dialog
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vPath,                                              // path
        const char* vFileName,                                          // defaut file name
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 
    
    IMGUIFILEDIALOG_API void IGFD_OpenDialog2(                          // open a standard dialog
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vFilePathName,                                      // defaut file path name (path and filename witl be extracted from it)
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 

    IMGUIFILEDIALOG_API void IGFD_OpenPaneDialog(                       // open a standard dialog with pane
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vPath,                                              // path
        const char* vFileName,                                          // defaut file name
        const IGFD_PaneFun vSidePane,                                   // side pane
        const float vSidePaneWidth,                                     // side pane base width
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 

    IMGUIFILEDIALOG_API void IGFD_OpenPaneDialog2(                      // open a standard dialog with pane
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vFilePathName,                                      // defaut file name (path and filename witl be extracted from it)
        const IGFD_PaneFun vSidePane,                                   // side pane
        const float vSidePaneWidth,                                     // side pane base width
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 

    IMGUIFILEDIALOG_API void IGFD_OpenModal(                            // open a modal dialog
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vPath,                                              // path
        const char* vFileName,                                          // defaut file name
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 

    IMGUIFILEDIALOG_API void IGFD_OpenModal2(                           // open a modal dialog
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vFilePathName,                                      // defaut file name (path and filename witl be extracted from it)
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 

    IMGUIFILEDIALOG_API void IGFD_OpenPaneModal(                        // open a modal dialog with pane
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vPath,                                              // path
        const char* vFileName,                                          // defaut file name
        const IGFD_PaneFun vSidePane,                                   // side pane
        const float vSidePaneWidth,                                     // side pane base width
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 

    IMGUIFILEDIALOG_API void IGFD_OpenPaneModal2(                       // open a modal dialog with pane
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog
        const char* vTitle,                                             // title
        const char* vFilters,                                           // filters/filter collections. set it to null for directory mode 
        const char* vFilePathName,                                      // defaut file name (path and filename witl be extracted from it)
        const IGFD_PaneFun vSidePane,                                   // side pane
        const float vSidePaneWidth,                                     // side pane base width
        const int vCountSelectionMax,                                   // count selection max
        void* vUserDatas,                                               // user datas (can be retrieved in pane)
        ImGuiFileDialogFlags vFlags);                                   // ImGuiFileDialogFlags 

    IMGUIFILEDIALOG_API bool IGFD_DisplayDialog(                        // Display the dialog
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context
        const char* vKey,                                               // key dialog to display (if not the same key as defined by OpenDialog/Modal => no opening)
        ImGuiWindowFlags vFlags,                                        // ImGuiWindowFlags
        ImVec2 vMinSize,                                                // mininmal size contraint for the ImGuiWindow
        ImVec2 vMaxSize);                                               // maximal size contraint for the ImGuiWindow

    IMGUIFILEDIALOG_API void IGFD_CloseDialog(                          // Close the dialog
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context            

    IMGUIFILEDIALOG_API bool IGFD_IsOk(                                 // true => Dialog Closed with Ok result / false : Dialog closed with cancel result
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context        

    IMGUIFILEDIALOG_API bool IGFD_WasKeyOpenedThisFrame(                // say if the dialog key was already opened this frame
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context        
        const char* vKey);

    IMGUIFILEDIALOG_API bool IGFD_WasOpenedThisFrame(                   // say if the dialog was already opened this frame
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context    

    IMGUIFILEDIALOG_API bool IGFD_IsKeyOpened(                          // say if the dialog key is opened
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context        
        const char* vCurrentOpenedKey);                                 // the dialog key

    IMGUIFILEDIALOG_API bool IGFD_IsOpened(                             // say if the dialog is opened somewhere    
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context        
    
    IMGUIFILEDIALOG_API IGFD_Selection IGFD_GetSelection(               // Open File behavior : will return selection via a map
   
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context        

    IMGUIFILEDIALOG_API char* IGFD_GetFilePathName(                     // Save File behavior : will always return the content of the field with current filter extention and current path
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context                

    IMGUIFILEDIALOG_API char* IGFD_GetCurrentFileName(                  // Save File behavior : will always return the content of the field with current filter extention
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context                

    IMGUIFILEDIALOG_API char* IGFD_GetCurrentPath(                      // will return current path
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context                    

    IMGUIFILEDIALOG_API char* IGFD_GetCurrentFilter(                    // will return selected filter
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context                        

    IMGUIFILEDIALOG_API void* IGFD_GetUserDatas(                        // will return user datas send with Open Dialog/Modal
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context                                            

    IMGUIFILEDIALOG_API void IGFD_SetExtentionInfos(                    // SetExtention datas for have custom display of particular file type
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context 
        const char* vFilter,                                            // extention filter to tune
        ImVec4 vColor,                                                  // wanted color for the display of the file with extention filter
        const char* vIconText);                                         // wanted text or icon of the file with extention filter (can be sued with font icon)

    IMGUIFILEDIALOG_API void IGFD_SetExtentionInfos2(                   // SetExtention datas for have custom display of particular file type
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context 
        const char* vFilter,                                            // extention filter to tune
        float vR, float vG, float vB, float vA,                         // wanted color channels RGBA for the display of the file with extention filter
        const char* vIconText);                                         // wanted text or icon of the file with extention filter (can be sued with font icon)

    IMGUIFILEDIALOG_API bool IGFD_GetExtentionInfos(
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context 
        const char* vFilter,                                            // extention filter (same as used in SetExtentionInfos)
        ImVec4* vOutColor,                                              // color to retrieve
        char** vOutIconText);                                           // icon or text to retrieve

    IMGUIFILEDIALOG_API void IGFD_ClearExtentionInfos(                  // clear extentions setttings
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context

feature : USE_EXPLORATION_BY_KEYS
    IMGUIFILEDIALOG_API void IGFD_SetFlashingAttenuationInSeconds(      // set the flashing time of the line in file list when use exploration keys
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context 
        float vAttenValue);                                             // set the attenuation (from flashed to not flashed) in seconds

feature : USE_BOOKMARK
    IMGUIFILEDIALOG_API char* IGFD_SerializeBookmarks(                  // serialize bookmarks : return bookmark buffer to save in a file
        ImGuiFileDialog* vContext);                                     // ImGuiFileDialog context

    IMGUIFILEDIALOG_API void IGFD_DeserializeBookmarks(                 // deserialize bookmarks : load bookmar buffer to load in the dialog (saved from previous use with SerializeBookmarks())
        ImGuiFileDialog* vContext,                                      // ImGuiFileDialog context 
        const char* vBookmarks);                                        // bookmark buffer to load 

feature : USE_THUMBNAILS
	IMGUIFILEDIALOG_API void SetCreateThumbnailCallback(				// define the callback for create the thumbnails texture
		ImGuiFileDialog* vContext,										// ImGuiFileDialog context 
		const IGFD_CreateThumbnailFun vCreateThumbnailFun);				// the callback for create the thumbnails texture

	IMGUIFILEDIALOG_API void SetDestroyThumbnailCallback(				// define the callback for destroy the thumbnails texture
		ImGuiFileDialog* vContext,										// ImGuiFileDialog context 
		const IGFD_DestroyThumbnailFun vDestroyThumbnailFun);			// the callback for destroy the thumbnails texture

	IMGUIFILEDIALOG_API void ManageGPUThumbnails(						// must be call in gpu zone, possibly a thread, will call the callback for create / destroy the textures
		ImGuiFileDialog* vContext);										// ImGuiFileDialog context 

How to Build the sample App :

You need to use cMake. For the 3 Os (Win, Linux, MacOs), the cMake usage is exactly the same,

  1. Choose a build directory. (called here my_build_directory for instance) and
  2. Choose a Build Mode : "Release" / "MinSizeRel" / "RelWithDebInfo" / "Debug" (called here BuildMode for instance)
  3. Run cMake in console : (the first for generate cmake build files, the second for build the binary)
cmake -B my_build_directory -DCMAKE_BUILD_TYPE=BuildMode
cmake --build my_build_directory --config BuildMode

Some cMake version need Build mode define via the directive CMAKE_BUILD_TYPE or via --Config when we launch the build. This is why i put the boths possibilities

By the way you need before, to make sure, you have needed dependencies.

On Windows :

You need to have the opengl library installed

On Linux :

You need many lib : (X11, xrandr, xinerama, xcursor, mesa)

If you are on debian you can run :

sudo apt-get update 
sudo apt-get install libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev

On MacOs :

you need many lib : opengl and cocoa framework

Comments
  • Add partial UTF-8 Support

    Add partial UTF-8 Support

    • Corrects wstring_to_string and string_to_wstring so that they convert strings properly without losing many characters.
    • Fixes crashes / safety issue with using std::filesystem by preferring the noexcept versions of the std::filesystem functions.
    • Adds limited UTF-8 support for some areas of the lib; I didn't cover everything because too much of this code is broken.

    Demo executable: https://drive.google.com/file/d/1Lj_pNU5Ooki2BcHEg6PrmLoDrkMT7t1S/view?usp=sharing

    Usage example: "filedialog.exe" --get-save-filename-ext "Text(*.txt)|*.txt" "Untitled.txt" "%USERPROFILE%" "Save As"

    Source code: https://github.com/time-killer-games/ImGuiFileDialogCLI

    windows

    macintosh

    ubuntu

    freebsd

    It's important to note strncpy, strncpy_s, GetLogicalDriveStringsA, and similar functions do not support UTF-8 in any way on the Windows platform. You need to convert them to and from a wide string with string_to_wstring and wstring_to_string and then use functions like wcsncpy, wcsncpy_s, and GetLogicalDriveStringsW instead so that UTF-8 is not completely discarded.

    C++17 std::filesystem requires using std::filesystem::u8path and std::filesystem::path::u8string to support UTF-8 properly. Note that std::filesystem::u8path is deprecated in C++20 and will be removed in future versions of the C++ standard so this will need maintenance once you transition past C++17 to C++20 onwards. I didn't address adding UTF-8 for anything other than your wstring_to_string/string_to_wstring helper functions and the std::filesystem usage when enabled. The rest I don't have time for.

    I also changed the MSVC macro checks to WIN32 macro checks because regardless of whether you happen to use MSVC or MSYS2/MINGW it doesn't change the fact functions like strncpy and similar are deprecated and shouldn't be used on the Windows platform as a whole and are only there for backwards compatibility. Consider using functions with the safety suffix (i.e. *_s) instead and for UTF-8 support consider using the wide string versions of these functions like I mentioned earlier (such as wcsncpy_s, etc).

    opened by time-killer-games 31
  • Windows OS can't display Chinese filename, also can't select those file

    Windows OS can't display Chinese filename, also can't select those file

    OS: Windows 10 Chinese version ImGui 1.80 ImFileDialog git master Can NOT display Chinese file name(I already added Chinese fonts, and can show Chinese char will on other interface) Can NOT select Chinese file name or folder name.

    bug unicode 
    opened by DickyQi 21
  • Only for Windows.

    Only for Windows.

    This code is 100% only for Windows. Apart from the many many Windows specific bits, like using the \ character as a path separator, Microsoft have once again horribly bastardised a standard Posix function. The whole "dirent" family of functions are clearly very very different on Windows to any Posix system.

    Apart from that, thankyou for taking the time to write this. It will be much quicker for me to fix this than write my own from scratch.

    opened by AlastairGrowcott 14
  • Items Dissapear after Mouse Release

    Items Dissapear after Mouse Release

    Many thanks for making and sharing this library it has been very useful for my project.

    After the introduction of double clicking a couple of months ago noticed a graphical glitch. When single clicking an item in the list, after the mouse is released, the remaining items on the list are not rendered for one frame. It is not random and always happens. I managed to capture some screenshots by making a movie.

    What it looks like before mouse release: image

    One frame after releasing the mouse: image

    Then everything goes back to normal.

    Thanks for looking at this

    File list view visual bug 
    opened by jvannugteren 12
  • Segfault on manually editing the path

    Segfault on manually editing the path

    Sorry for opening two issues on the same day. I found that if you click the E to edit the path and then type in something nonsensical or make a typo in the path. The GUI will crash with a segfault after hitting enter. Thanks.

    image

    bug 
    opened by jvannugteren 10
  • Made column sort consistent with ImGui and across configuration options

    Made column sort consistent with ImGui and across configuration options

    After some more work with this great library, I found out that column sort was not consistent with the way ImGui does it and it was behaving differently depending on whether you use the compile time USE_CUSTOM_SORTING_ICON option or not. Here are the changes made:

    • Ascending (A-Z, 0-9) and descending (Z-A, 9-0) is now used consistently in all configuration options.
    • Changing the sort order is no longer performed in the SortFields member function (this caused strange behavior when USE_CUSTOM_SORTING_ICON was NOT selected).
    • Without USE_CUSTOM_SORTING_ICON, file lists show an "up triangle" for ascending and a "down triangle" for descending just like other ImGui tables.
    • With USE_CUSTOM_SORTING_ICON, file lists show the tableHeaderAscendingIcon (compile time configuration option) for ascending and tableHeaderDescendingIcon (compile time configuration option) for descending.
    • Default sort options can be specified for each column through the compile time configuration process.

    Note 1: Whether you like an up or down icon to represent ascending or descending is a matter of taste. With this pull request, this library becomes consistent with ImGui and a number of operating systems and libraries. The IT community is very divided on this subject as 56% prefers this way and 44% the other way (see https://hackernoon.com/sorting-arrow-confusion-in-data-tables-5a3117698fdf). If you are part of the 44% community, you can use the USE_CUSTOM_SORTING_ICON configuration option to have whatever you want. @aiekick: you need to check if the demo app is still the way you want it.

    Note 2: The prDrawFileListView and prDrawThumbnailsListView member functions are almost identical. Merging them would require some #ifdef ugliness but I think it would be easier to maintain the code. Even better would be to do away with the USE_THUMBNAILS compile time configuration option. It really doesn't bloat the library and a runtime configuration is already available to turn thumbnails modes on and off. if @aiekick wants it, I can make a pull request for this as well.

    opened by goossens 10
  • Problem with OVERWRITE DIALOG

    Problem with OVERWRITE DIALOG

    In the function bool IGFD::FileDialog::Confirm_Or_OpenOverWriteFileDialog_IfNeeded(bool vLastAction, ImGuiWindowFlags vFlags) GetFilePathName is used to get the file name. As you know GetFilePathName always return current file with selected extension, making the test to see if the file already exists, return an incorrect result. Thanks.

    bug 
    opened by ClaudeLx 10
  • Symlinks to directories are not listed as directories and cannot be browsed

    Symlinks to directories are not listed as directories and cannot be browsed

    Describe the bug Symlinks to directories are listed as "link" files, but not as directories. This means that we cannot follow symlinks to navigate the filesystem. Every file browsers I can think of would let users enter symlinks to directories as if they were directories, so unless I missed some option I think it's a bug.

    I could see rendering the symlinks to directories in italic or with a different style, but still listing them as directories.

    A quick fix I use locally is to check first for the directory type, and only after for the link type:

    if (file.is_directory())
        fileType = 'd';
    else if (file.is_symlink())
        fileType = 'l';
    

    This works because symlinks to directories return true to is_directory().

    To Reproduce I'm using the Lib_Only branch, commit 5d447f557 (March 1st, 2022) ln -s /tmp link-to-tmp -> Create an OpenDialog, you can't enter link-to-tmp. It'll be listed as a [Link] file if there is no filter, but selecting it will try to open it as a file.

    Expected behavior Follow the symlink and enter the directory.

    Desktop (please complete the following information):

    • OS: Linux, macOS, probably Windows with WSL
    bug enhancement 
    opened by nburrus 9
  • Double-click-to-open does not work under Directory Chooser mode.

    Double-click-to-open does not work under Directory Chooser mode.

    Describe the bug The folder selection mode does not work. According to the guide here, the Directory Chooser should allow single-click for choosing folder and double-click for opening one. But now the double-click-to-open is not working at all, the only thing I can do is choose one.

    To Reproduce

    • Use the exact example code.
    • Use the latest ImGui with no Viewport or Docking.
    • Using OpenGL 3 with GLFW.
    • With freetype and stb.
    • With ImGui config

    #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS #define IMGUI_USE_STB_SPRINTF #define IMGUI_ENABLE_FREETYPE

    • With ImGuiFileDialogConfig.h

    #define USE_STD_FILESYSTEM #define USE_EXPLORATION_BY_KEYS // this mapping by default is for GLFW but you can use another #include <GLFW/glfw3.h> // Up key for explore to the top #define IGFD_KEY_UP GLFW_KEY_UP // Down key for explore to the bottom #define IGFD_KEY_DOWN GLFW_KEY_DOWN // Enter key for open directory #define IGFD_KEY_ENTER GLFW_KEY_ENTER // BackSpace for comming back to the last directory #define IGFD_KEY_BACKSPACE GLFW_KEY_BACKSPACE

    • With Visual Studio 2022 and compiling option "/std:c++latest" (Hence C++20 or 23?)

    Expected behavior A clear double-clear can open a folder instead of selecting it.

    Screenshots Not applicable.

    Desktop (please complete the following information):

    • Windows 10 21H1

    Smartphone (please complete the following information):

    • None

    Additional context Add any other context about the problem here.

    bug 
    opened by xhsu 9
  • SetFileStyle not working in Windows

    SetFileStyle not working in Windows

    The SetFileStyle seems to have no effect when used in windows C++11 (so without std::filesystem). I'm using:

    ImGuiFileDialog::Instance()->SetFileStyle(IGFD_FileStyleByExtention,".json", ImVec4(0.0039216f,0.8f,0.4000000f,1.0f), "\xef\x81\xb6");
    

    but color doesn't change and the icon does not show up. I get no compile or runtime errors. In Linux the same line works fine.

    file style 
    opened by jvannugteren 8
  • Allow double click  and intro to select a file.

    Allow double click and intro to select a file.

    I can double-click to navigate into a folder, or use ~~intro~~ enter key when #def USE_EXPLORATION_BY_KEYS, however, I cannot double-click or press enter to select the file.

    Would it be possible to allow double-click/enter key to "press OK button" if the selected item is a file?

    enhancement 
    opened by phcerdan 8
  • Load system-provided platform icons for different file types (for native, non-emscripten platforms)

    Load system-provided platform icons for different file types (for native, non-emscripten platforms)

    Here's an example for how I do it in a ImFileDialog I forked: LINK. I think it would be a nice addition to have in your product as well. Mine tied to specific windowing and graphics system bindings making it less flexible than your solution so I find it would be cool to see both projects have this. Feel free to borrow logic from my code to get it working as you see fit.

    1. Windows uses standard Win32 - Preview.
    2. MacOS/Darwin needs Cocoa, AppKit - Preview.
    3. Linux/*BSD/SunOS PNG FreeDesktop icon themes need STBImage, GTK+, GLIB, GIO - Preview.
    4. Linux/*BSD/SunOS SVG FreeDesktop icon themes need LunaSVG, GTK+, GLIB, GIO - Preview.
    5. Android/iOS you're on your own with mobile if you want to support that - never worked with it.
    6. As the title suggests I believe doing this is not possible with emscripten.

    Keep in mind while most desktop environments use PNG icon themes, KDE's default Breeze Theme is very commonly used by KDE users and KDE is a very popular DE, making it ideally pretty necessary to add LunaSVG as a git submodule to support those users.


    As a separate note you may use this code to get bookmarks or recommended paths to have on a side pane: LINK. Although I don't find that worth having as its own ticket, as it's not that important, but will provide a way to do this which will grab system provided localization for these folders. Anyway, let me know what you think and I am happy to help some if I find time.

    enhancement 
    opened by time-killer-games 1
  • Add a way for validate a file selection

    Add a way for validate a file selection

    like with a cubemap files choosing. we need to to select 6 pictures fill with a special pattern.

    we could have a function callback to call wiht the file content for say ok or not for have the ok button on the dialog

    similar to the pane fucntion, but without the pane display

    enhancement 
    opened by aiekick 0
  • drag a file or a directory in the dialog for set the path or the file to it

    drag a file or a directory in the dialog for set the path or the file to it

    i tried a bit, but the issue was about how imgui detect drop files from outside of the app.

    in app its working like a charm, but from outside of the app, its problematic, so for the moment. no implementation

    enhancement 
    opened by aiekick 0
Releases(v0.6.4)
  • v0.6.4(Feb 18, 2022)

    little update for ImGui 1.87

    The dialog can be :

    • embedded in your imgui window now
    • can have ok and cancel button with different widths and placements
    • can disable with flags the display of the boobkmark
    • can display a popup of parallels directory with the path separator '' or '/' of the path composer

    R40y1mJixc

    see changes :

    [ADD] : add a / between path in the composer. when you clik left on it, you have a popup of paralle directory, you can select [ADD] : can invert the ok and cancel buttons (with the define invertOkAndCancelButtons) [ADD] : add a way for tune the width of validation buttons, ok and cancel (defines okButtonWidth and cancelButtonWidth) [ADD] : add a way for tune the position of the validations buttons. okCancelButtonAlignement is a ratio by ex 0.0 is left, 0.5 middle, 1.0 right, and other ratios [ADD] : add a way to disable the display of bookmark feature by the flag ImGuiFileDialogFlags_DisableBookmarkMode [ADD] : add a way for embbed the FIleDialog in a user imgui begin/end scope, let inetrgate the dialog in any windows. just need to use the flag ImGuiFileDialogFlags_NoDialog

    Source code(tar.gz)
    Source code(zip)
  • v0.6.3(Oct 26, 2021)

    add a new style system for file / dir / links

    • can be used for define color, icon, font
    • can be used for define global style for all files / dirs / links

    add IGFD_FileStyleFlags

    • IGFD_FileStyleByTypeFile mean define style for all files
    • IGFD_FileStyleByTypeDir mean define style for all dir
    • IGFD_FileStyleByTypeLink mean define style for all link
    • IGFD_FileStyleByExtention mean define style by extention, for files or links
    • IGFD_FileStyleByFullName mean define style for particular file/dir/link full name (filename + extention)
    • IGFD_FileStyleByContainedInFullName mean define style for file/dir/link when criteria is contained in full name

    BREAKING CHANGE :

    • IGFD::FileExtentionInfos become IGFD::FileStyle
    • CPP : ImGuiFileDialog::SetExtentionInfos become ImGuiFileDialog::SetFileStyle(IGFD_FileStyleByExtention,
    • CPP : ImGuiFileDialog::GetExtentionInfos become ImGuiFileDialog::GetFileStyle(IGFD_FileStyleByExtention,
    • CPP : ImGuiFileDialog::ClearExtentionInfos become ImGuiFileDialog::ClearFilesStyle
    • C : IGFD_SetExtentionInfos become IGFD_SetFileStyle
    • C : IGFD_GetExtentionInfos become IGFD_GetFileStyle
    • C : IGFD_ClearExtentionInfos become IGFD_ClearFilesStyle
    Source code(tar.gz)
    Source code(zip)
  • v0.6.2(Sep 30, 2021)

    Add the support of std::filesystem for replace dirent.h need c++17 btw.

    you just need to uncomment

    #define USE_STD_FILESYSTEM

    in the config file

    Source code(tar.gz)
    Source code(zip)
  • v0.6.1(Sep 22, 2021)

  • v0.6(Sep 20, 2021)

    Full rewrite of ImGuIFileDialog for Thumbnails display.

    The texture creation and destroy is made in a agnostic way. Successfully tested on OpenGl and Vulkan

    you can check the Readme and the sample app in master branch

    In test from 5 months on my softwares so i release it. hope will be ok for all :-)

    see a demo : thumbnails.gif

    Source code(tar.gz)
    Source code(zip)
  • v0.5.6(Sep 18, 2021)

  • v0.5.5(Jan 22, 2021)

    ImGuiFileDialog v0.5.5

    The main features are :

    • Adding of C Api (succesfully tested with CImGui)
    • Creation of a specific branch for Lib Only (with dirent included for win32)
    • Adding of a splitter for Bookmarks/Side Panes
    • ImGuITable is in base for ImGuiFileDialog. Since ImGuITable is merged in Master for last release of ImGui v1.80
    • Can customize the DataTime Format in Table Date field

    Some Function signature were changed by the way :

    • FileDialog() become Display()
    • CloseDialog() become Close, (no key needed for closing)
    • IsOk var become a func IsOk()
    • Pane callback signature become 'void(const char*, IGFDUserDatas, bool*)' was 'void(std::string, UserDatas, bool*)'
    • Replacement of igfd:ImGuIFileDialog by just ImGuIFileDialog
    • Replacement of igfd:UserDatas by IGFDUserDatas

    the mains draw parts function are virtual now, so you can customize according to your needs by derivation :

     * virtual void DrawHeader();                   // draw header part of the dialog (bookmark btn, dir creation, path composer, search bar)
     * virtual void DrawContent();                  // draw content part of the dialog (bookmark pane, file list, side pane)
     * virtual bool DrawFooter();                   // draw footer part of the dialog (file field, fitler combobox, ok/cancel btn's)
     * virtual void DrawDirectoryCreation();        // draw directory creation widget
     * virtual void DrawPathComposer();             // draw path composer widget
     * virtual void DrawSearchBar();                // draw search bar
     * virtual void DrawFileListView(ImVec2 vSize); // draw file list viexw
     * virtual void DrawSidePane(float vHeight);    // draw side pane
     * virtual void DrawBookMark();                 // draw bookmark button
    

    Add many's comment in all of the header file

    see other details :

    | Cat | Description | | :---: | --- | | [VER] | IMGUIFILEDIALOG_VERSION passed to v0.5.5 | | [ADD] | C Api available. succesfully tested with CImGui | | [ADD] | creation of a branch for have the Lib_Only / separation of sample app and lib | | [ADD] | two way are possible for call ImGuiFileDialog / Singleton or instance (for multi instance by ex) | | [ADD] | add a define 'DateTimeFormat' for customize the date field. see strftime func in for customize it. default is "%Y/%m/%d %H:%M:%S" who give 2021:01:22 11:47:10 | | [ADD] | add a splitter for resize the pane | | [ADD] | add a way for force the close of the dialog without knowing the key | | [ADD] | add a way for know if a dialog is opened and what is the related key | | [RMV] | the directive USE_IMGUI_TABLE is removed, so cant be disabled. since ImGui v1.80 is released with the support of ImGuiTable in master, now ImGuiTable is in base | | [UPD] | update ImGui version to v1.80 in sample APP (branch master) | | [UPD] | update ImGuiTable flags | | [FIX] | fix warnings with MSVC | | [FIX] | fix issue on UNIX. all files was displayed in lowercase, some problemes for open directory and all returned path could be invalids. (@jackm97, #41) | | [FIX] | fis issue with new flag renaming for ImGui Table | | [FIX] | fix compilation issue when USE_BOOKMARK is undefined #39 | | [FIX] | fix issue on drives list (buffer overflow), issue with maxi used instead of mini | | [RFR] | some refactor on #define #else #endif (add comments) | | [RFR] | refactor for readability | | [UPD] | update ImGui version to v1.80 in sample APP (branch master) | | [UPD] | update ImGuiTable flags | | [IMP] | improvement of stamps. separation of version with and without panes | | [IMP] | add comment for any methods | | [IMP] | remove messy function stamp for dialog calls. |

    Source code(tar.gz)
    Source code(zip)
  • v0.5.3.1(Jan 3, 2021)

    One New Feature :

    A 'confirm to OverWrite dialog' exist now for prevent overwrite if file exist

    My appologies : The last release v0.5.3 was deleted because of a big mistake on the repo. The content was not corresponding to the expected content

    See the rest of the changes :

    [FIX] : fix of display of ImGuiTable header [ADD] : add returns cases in demo app for see what we obtain after the file dialog is closed [FIX] : fix, when the file field is empty the ok button is hidden. before that the ok was not closing the dialog [issue #36] [FIX] : only one dialog can be, now, displayed per frame. (before, many dialog was appended, and many cotnrol was unusable due to same id) [ADD] : a func WasOpenedThisFrame for test if the dialog was opened during this frame [ADD] : add ifndef for IS_FLOAT_DIFFERENT and IS_FLOAT_EQUAL [ADD] : Add a 'confirm to OverWrite dialog' if file exist. just need to define the flag ImGuiFileDialogFlags_ConfirmOverwrite [IMP] : Improvement, Update readme doc for the 'confirm to OverWrite dialog' [IMP] : Improvement, the whole documentation added in the header code comment section. more convenient han the site but without gifs :) {IMP] : Improvement, new case added in sample App for the 'confirm to OverWrite dialog' [RFR] : Refactor, some func, vars, warnings fix [VER] : Version, IMGUIFILEDIALOG_VERSION passed to v0.5.3 [ACT] : Action, reactivation of Osx Action, since the github action server have fixed the issue now

    Source code(tar.gz)
    Source code(zip)
  • v0.5.2(Dec 16, 2020)

    fixed for last ImGui 1.80 WIP master (merge of table branch) fixed issue #33 some refactoring too obsolete imgui function disabled by default in sample app

    not stable for production, will wait the release of ImGui 1.80 was changed becayse the table branch was merged in ImGui 1.80 WIP

    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(Oct 21, 2020)

  • v0.5(Oct 21, 2020)

    [ADD] a input path edition mode :

    if you click right on one of any button of the path, you can input or modify the path pointed by this button. then press the validate key (Enter by default with GLFW) for validate the new path or press the escape key (Escape by default with GLFW) for quit the input path edition

    [FIX] : some fixs and refactoring

    Source code(tar.gz)
    Source code(zip)
  • v0.4(Jun 17, 2020)

    [ADD] a bookmark system for create/edit/apply paths bookmarks

    • You can customize it a bit with the custom config file
    • You can use a specific name for a bookmark. you can edit this name by selecting the bookmark
    • You can apply the bookmark with double click on it
    • you can also serialize/deserialize bookmarks to string (by ex for load/save from/to file)
    Source code(tar.gz)
    Source code(zip)
  • v0.3(Jun 16, 2020)

    [ADD] can explore file list and directories by keys :

    • You can select files/directory (depending of the mode) on top/bottom and open/close directories
    • you can alos customize used keys for your binding
    • the selected file/directory flash for 1 sec (by default), but can be customized too

    [ADD] can explore a file list via input character.

    [IMPROVMENT] better fps for the file list displaying

    • virtual list mode (better with big file list)
    • all filtering is done one time or after filtering change (like by search tag)
    Source code(tar.gz)
    Source code(zip)
  • v0.2(Jun 11, 2020)

    [ADD] The search is now case insensitive :

    • all search tags in lower case will result to display lower and upper case files and directories
    • all search tags in upper case will result to display only upper case files and directories

    [ADD] The file list sorting is now case insensitive

    [ADD] Support of custom filter names and filter collections (group of filter with custom filter group name)

    • breaking change : the filter format is changed : '\0' is replaced by ',' +> see README.md for infos
    Source code(tar.gz)
    Source code(zip)
  • v0.1(Jun 3, 2020)

    First release of ImGuiFileDialog. ready for production

    Features :

    • Separate system for call and display
    • Can use custom pane via function binding
    • Support of Filter Custom Coloring / Icons / text
    • Dialog size can be constraint by min / max size value
    • Multi File/Directory Selection (one file, N files, or infinite)
    • Support of Modal/Standard dialog Type
    • Can be a File Chooser or Directory Chooser
    • Can display table with file size/date by using ImGui Table branch (not merged in master at this moment)
    • Successfully compiled / tested on Win32, MacOs and Linux

    See Readme.md and sample app for more infos

    you can access binaries for all os/builds in github "actions" tab

    Source code(tar.gz)
    Source code(zip)
    ImGuiFileDialog_Linux.zip(702.73 KB)
    ImGuiFileDialog_Macos.zip(565.80 KB)
    ImGuiFileDialog_Win32.zip(355.21 KB)
Owner
Aiekick
Fascinated by programming and art under all theirs forms.
Aiekick
Markdown renderer for Dear ImGui using MD4C parser

imgui_md Markdown renderer for Dear ImGui using MD4C parser. C++11 or above imgui_md currently supports the following markdown functionality: Wrapped

Dmitry Mekhontsev 74 Dec 27, 2022
Minimal example of prototyping CLAP audio plugins using Dear ImGui as the user interface.

clap-imgui Minimal example of prototyping CLAP audio plugins using Dear ImGui as the user interface. This is intended as an example of presenting a UI

schwa 52 Dec 19, 2022
Example program for integrating Dear ImGui and GLFW into Source's App System

This is an example program for integrating Dear ImGui and GLFW into Source's app system, the same thing Source's tools use. Feel free to do with this

null 9 Apr 16, 2022
Dear IMGUI + Render + Window handling, amalgamation in two files ready to use

imgui-app Imgui-app is an amalgamation of two amazing projects Dear Imgui and Sokol libraries into two files to make it very easy to start working wit

PpluX 138 Jan 8, 2023
dear imgui + glfw framework

ImFrame ImFrame is a lightweight framework designed to provide you with a window and graphical backend for the Dear ImGui library. Unlike more traditi

null 62 Dec 25, 2022
A (very) simple notification wrapper for Dear ImGui

imgui-notify Is a header-only wrapper made to create notifications with Dear ImGui. As I couldn't find any library for this I just decided to create m

Patrick 212 Jan 2, 2023
X11 + GLFW + Dear ImGUI Overlay

Dear ImGUI Overlay X11 + GLFW + Dear ImGUI Overlay made by rdbo Based on https://github.com/rdbo/glfw-overlay How to use? In main.c, there is a window

Rdbo 6 Dec 25, 2022
o/ ImGui Builder is a graphical framework for assembling imgui codes in your interface easily

IMGUI BUILDER The project consists a gui editor of the Imgui framework EDITOR Menu Export 1 - Export cpp file 2 - Cpp file Credits Credits for Shadowy

Code Building 405 Dec 20, 2022
Generate Height map with Generator (OpenGL and imgui) and Construct Splat Map with generated height map using Algorithm

Generate Height map with Generator (OpenGL and imgui) and Construct Splat Map with generated height map using Algorithm(DPS, BFS, Gradient Descent ... etc) . At Renderer, with height map and blend map which are generated in front of this stage, render high quality terrain with OpenGL

Snowapril 35 Mar 22, 2022
A ImGui Application with Multi Viewports and Docking using D3D11

ImGui-Application Informations A ImGui Application with Multi Viewports and Docking using D3D11 Build You need the DirectX SDK, here the Download link

Argon Projects 12 Nov 13, 2022
A cross-platform wrapper for using SDL2 with ImGui

ImSDL2 ImSDL2 is an open source "wrapper" of imgui backends available for SDL2. It aims to provide a backend-independent yet simple interface for inte

terens 5 Feb 2, 2022
ZT is a zig-contained library that automatically compiles+links ImGui, OpenGL, and GLFW into typed packages.

ZT is a zig-contained library that automatically compiles+links ImGui, OpenGL, and GLFW into typed packages. By zig contained I mean that ZT is intend

null 90 Jan 1, 2023
Simpler ImGui Backend Implementation for VulkanHpp.

ImGui-VulkanHpp Simpler ImGui Backend Implementation for VulkanHpp.

takiyu 27 Dec 7, 2022
ImTricks is a collection of useful functions for expanding / improving the functionality of the ImGui.

ImTricks ImTricks is a collection of useful functions for expanding / improving the functionality of the ImGui. At the moment it has in itself: Functi

Alexander Pers0na2 22 Jun 13, 2022
Expose the ImGui framework to clasp

Expose the ImGui framework to clasp Installing in the clasp source tree cd clasp/extensions git clone https://github.com/clasp-developers/imgui-clasp

clasp 4 Oct 11, 2021
Growtopia android modmenu with ImGui

Growtopia Android ImGUI Growtopia android modmenu with ImGUI. Features Built with ImGUI. Coming Soon None Requirements The following dependencies are

ZTz 57 Jan 4, 2023
Partial source of the ImGui interfaces used in the Rocket League version of CodeRed.

CodeRed-ImGui Raw source of the ImGui interfaces used in the Rocket League version of CodeRed. About This repo is just part of the ImGui source used i

CodeRed 13 Jan 7, 2023
Sample project to use ImGui + GLFW + OpenGL3

About just a sample project to use ImGui ( https://github.com/ocornut/imgui ) Note Windows 11 Visual Studio 2019 + cmake-gui WSL2 on Windows 11 apt in

iwatake 4 Dec 23, 2021
Widgets for imgui

ImGuiAl Some widgets for imgui. Widgets Log: A complete logger, with different colors for different message priorities and filters. Fonts: Extra fonts

Andre Leiradella 184 Dec 31, 2022