Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // FileDialog.h
- //
- // Defines class for file dialog and its operations. Allows to show open/close file dialog and
- // return whether any file was selected, and if it was - then which file.
- //
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- #ifndef __FILE_DIALOG__H__
- #define __FILE_DIALOG__H__
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // Header section
- #include <Windows.h>
- #include "Engine.h"
- #include "Core/Log/Log.h"
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // Class & Structures definition
- namespace Engine
- {
- class ENGINE_API FileDialog
- {
- public:
- /// <summary>Specifies type of file dialog</summary>
- enum class Type
- {
- /// <summary>Open file dialog</summary>
- OPEN_FILE_DIALOG,
- /// <summary>Save file dialog</summary>
- SAVE_FILE_DIALOG
- };
- /// <summary>Open and show file dialog</summary>
- /// <param name="log">Log for storing errors</param>
- /// <param name="title">Title for dialog</param>
- /// <param name="filter">Filter for specific file formats (Windows format - e.g. Image\0*.bmp\0All Files\0*.*\0</param>
- /// <param name="type">Dialog type (Open, Save, ...)</param>
- /// <param name="filename">Resulting filename</param>
- /// <return>True if file selected, false otherwise</return>
- static bool Show(Log* log, const std::string& title, const char* filter, Type type, std::string& filename);
- };
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // EOH
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement