Giter Club home page Giter Club logo

l2dfiledialog's Introduction

Lime2D File Dialog

A C++ file dialog using Dear ImGui.

Buy Me a Coffee at ko-fi.com

L2DFileDialog

Usage

Add L2DFileDialog.h to your C++ project and include it where you use ImGui. Then, set FileDialog::fileDialogOpen to true to set the open state. Finally, in your update method, check if FileDialog::fileDialogOpen == true and if so, call FileDialog::ShowFileDialog, passing in a char array as a buffer to store the chosen file/folder path.

Features

  • New folder
  • Delete folder
  • Sort by:
    • File
    • Size
    • Type
    • Last modified date

Example

You can see L2dFileDialog/src/main.cpp for a full example. Here is a very minimal sample:

...
static char* file_dialog_buffer = nullptr;
static char 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);
}
...

L2DFileDialogGif

License

This project is under the Apache License.

l2dfiledialog's People

Contributors

limeoats avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.