3#include <cgv/gui/property_string.h>
4#include <cgv/gui/provider.h>
66 return mode_ == Mode::kOpen;
71 return mode_ == Mode::kSave;
121 void create_gui(
const std::string& label,
const std::string& extra_options =
"") {
129 options.
add(
"", extra_options);
std::string path_
The default path used for the file system dialog.
provider * provider_ptr_
The pointer to the gui provider for the control.
void set_directory_name(const std::string &directory_name)
Set the current directory name.
bool is_save_action() const
Check whether a save action was performed.
const std::string & get_default_path() const
Get the default path.
Mode mode_
Operating mode of the control that controls the visibility of open and save buttons....
void set_title(const std::string &title)
Set the title.
bool can_open() const
Return true if this directory_helper supports opening files, false otherwise.
directory_helper(provider *p, const std::string &title, Mode mode)
Construct with arguments.
bool can_save() const
Return true if this directory_helper supports saving files, false otherwise.
std::string directory_name
The current directory name This member is public to make it accessible to the GUI control flow.
directory_helper()
Construct with default parameters.
void set_default_path(const std::string &path)
Set the default path.
const std::string & get_title() const
Get the title.
void create_gui(const std::string &label, const std::string &extra_options="")
Create the gui control for the directoy input.
std::string title_
The title shown in the file system dialog.
A convenience class for compiling strings of delimited key-value pairs useful for defining GUI contro...
void add(const std::string &key, T value)
Add key-value pair to end of content, converting value to string.
void add_bracketed(const std::string &key, const T value, char bracket='\'')
See add.
derive from this class to provide a gui to the current viewer
namespace that holds the abstract gui interface
this header is dependency free