- Notifications
You must be signed in to change notification settings - Fork25
A C++ file dialog using Dear ImGui
License
NotificationsYou must be signed in to change notification settings
Limeoats/L2DFileDialog
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A C++ file dialog using Dear ImGui.
AddL2DFileDialog.h
to your C++ project and include it where you use ImGui. Then, setFileDialog::fileDialogOpen
totrue
to set the open state. Finally, in yourupdate
method, check ifFileDialog::fileDialogOpen == true
and if so, callFileDialog::ShowFileDialog
, passing in achar
array as a buffer to store the chosen file/folder path.
- New folder
- Delete folder
- Sort by:
- File
- Size
- Type
- Last modified date
You can seeL2dFileDialog/src/main.cpp
for a full example. Here is a very minimal sample:
...staticchar* file_dialog_buffer =nullptr;staticchar path[500] ="";ImGui::TextUnformatted("Path:");ImGui::InputText("##path", path,sizeof(path));ImGui::SameLine();if (ImGui::Button("Browse##path")) { file_dialog_buffer = path; FileDialog::file_dialog_open =true; FileDialog::file_dialog_open_type = FileDialog::FileDialogType::SelectFolder;}if (FileDialog::file_dialog_open) {FileDialog::ShowFileDialog(&FileDialog::file_dialog_open, file_dialog_buffer,sizeof(file_dialog_buffer), FileDialog::file_dialog_open_type);}...
This project is under theApache License.