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);
A convenience class that provides a directory input gui control.
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
bool add_gui(const std::string &label, T &value, const std::string &gui_type="", const std::string &options="")
Add a composed gui of the given gui_type for the given value.
virtual void update_member(void *member_ptr)
call this to update all views and controls of a member
void set_control_property(T &value, const std::string &property_name, const std::string &property_value)
Set the property value of all controls of a given class member.
static bool & ref_tree_node_visible_flag(const T &value)
return a reference to the boolean flag, that tells whether the tree node for the passed value is visi...