#include <filechooser.hpp>
Public Member Functions | |
file_dialog (CVideo &video, const std::string &file_path, const std::string &title, const std::string &default_file_name, bool show_directory_buttons) | |
virtual gui::dialog::dimension_measurements | layout (int xloc=-1, int yloc=-1) |
std::string | get_choice () const |
Return the chosen file. More... | |
void | select_file (const std::string &file) |
void | set_autocomplete (bool value) |
Public Member Functions inherited from gui::dialog | |
dialog (CVideo &video, const std::string &title="", const std::string &message="", const DIALOG_TYPE type=MESSAGE, const style &dialog_style=default_style) | |
virtual | ~dialog () |
void | set_image (dialog_image *const img) |
void | set_image (surface surf, const std::string &caption="") |
void | set_menu (menu *const m) |
void | set_menu (const std::vector< std::string > &menu_items, menu::sorter *sorter=nullptr) |
void | set_menu_items (const std::vector< std::string > &menu_items, bool keep_selection=false) |
Changes (or sets, if not previously set) the dialog's menu items to the provided list. More... | |
void | add_pane (preview_pane *const pp) |
void | set_panes (std::vector< preview_pane * > panes) |
void | set_textbox (dialog_textbox *const box) |
void | set_textbox (const std::string &text_widget_label="", const std::string &text_widget_text="", const int text_widget_max_chars=256, const unsigned int text_box_width=font::relative_size(350)) |
void | add_button (dialog_button *const btn, BUTTON_LOCATION loc) |
void | add_button (dialog_button_info btn_info, BUTTON_LOCATION loc=BUTTON_EXTRA) |
void | add_option (const std::string &label, bool checked=false, BUTTON_LOCATION loc=BUTTON_CHECKBOX, const std::string &help_string="") |
void | set_layout (dimension_measurements &new_dim) |
dimension_measurements | get_layout () const |
dialog_frame & | get_frame () |
void | set_basic_behavior (DIALOG_TYPE type) |
int | show (int xloc, int yloc) |
int | show () |
int | result () const |
menu & | get_menu () |
bool | done () const |
std::string | textbox_text () const |
dialog_textbox & | get_textbox () const |
bool | option_checked (unsigned int option_index=0) |
CVideo & | get_video () |
Protected Member Functions | |
void | action (gui::dialog_process_info &dp_info) |
void | set_save_text (const std::string &filename) |
std::string | unformat_filename (const std::string &filename) const |
std::string | format_filename (const std::string &filename) const |
std::string | format_dirname (const std::string &dirname) const |
Protected Member Functions inherited from gui::dialog | |
void | set_result (const int result) |
void | refresh () |
label & | get_message () const |
Private Attributes | |
bool | show_directory_buttons_ |
gui::file_menu * | files_list_ |
int | last_selection_ |
std::string | last_textbox_text_ |
std::string | chosen_file_ |
std::string | default_file_name_ |
bool | autocomplete_ |
Additional Inherited Members | |
Public Types inherited from gui::dialog | |
enum | BUTTON_LOCATION { BUTTON_STANDARD, BUTTON_EXTRA, BUTTON_EXTRA_LEFT, BUTTON_CHECKBOX, BUTTON_CHECKBOX_LEFT, BUTTON_HELP, BUTTON_TOP } |
typedef dialog_frame::style | style |
Static Public Member Functions inherited from gui::dialog | |
static void | delete_empty_menu () |
Explicit freeing of class static resources. More... | |
Static Public Attributes inherited from gui::dialog | |
static const style & | default_style = dialog_frame::default_style |
static const style & | message_style = dialog_frame::message_style |
static const style | hotkeys_style |
static const int | message_font_size = font::SIZE_PLUS |
static const int | caption_font_size = font::SIZE_LARGE |
static const int | max_menu_width = -1 |
static const size_t | left_padding = font::relative_size(10) |
static const size_t | right_padding = font::relative_size(10) |
static const size_t | image_h_pad = font::relative_size( 10) |
static const size_t | top_padding = font::relative_size(10) |
static const size_t | bottom_padding = font::relative_size(10) |
Definition at line 30 of file filechooser.hpp.
dialogs::file_dialog::file_dialog | ( | CVideo & | video, |
const std::string & | file_path, | ||
const std::string & | title, | ||
const std::string & | default_file_name, | ||
bool | show_directory_buttons | ||
) |
Definition at line 61 of file filechooser.cpp.
References _(), gui::dialog::add_button(), gui::CREATE_ITEM, default_file_name_, gui::DELETE_ITEM, files_list_, format_dirname(), format_filename(), gui::file_menu::get_directory(), gui::dialog::get_message(), CVideo::gety(), gui::menu::set_max_height(), gui::widget::set_measurements(), gui::dialog::set_menu(), gui::label::set_text(), gui::dialog::set_textbox(), show_directory_buttons_, gui::button::TYPE_PRESS, and gui::widget::width().
|
protectedvirtual |
Reimplemented from gui::dialog.
Definition at line 196 of file filechooser.cpp.
References _(), autocomplete_, gui::file_menu::change_directory(), chosen_file_, gui::dialog_process_info::clear_buttons(), gui::CLOSE_DIALOG, gui::CONTINUE_DIALOG, gui::CREATE_ITEM, gui::file_menu::delete_chosen_file(), gui::DELETE_ITEM, gui::dialog_process_info::double_clicked, gui2::tfolder_create::execute(), files_list_, gui::dialog_process_info::first_time, format_dirname(), format_filename(), gui::file_menu::get_choice(), gui::file_menu::get_directory(), gui::dialog::get_message(), gui::dialog::get_textbox(), gui::dialog::get_video(), gui::file_menu::is_directory(), last_selection_, last_textbox_text_, gui::file_menu::make_directory(), gui::dialog_process_info::new_left_button, gui::file_menu::reset_type_a_head(), gui::dialog::result(), gui::file_menu::select_file(), gui::dialog_process_info::selection, gui::dialog::set_result(), set_save_text(), gui::label::set_text(), gui::textbox::set_text(), gui2::show_transient_error_message(), gui::dialog::textbox_text(), gui::file_menu::type_a_head(), and unformat_filename().
|
protected |
Definition at line 147 of file filechooser.cpp.
References files_list_, font::line_width(), pos, font::SIZE_NORMAL, and gui::file_menu::strip_last_delim().
Referenced by action(), and file_dialog().
|
protected |
Definition at line 128 of file filechooser.cpp.
References default_file_name_, files_list_, gui::file_menu::is_directory(), and gui::file_menu::path_delim.
Referenced by action(), file_dialog(), select_file(), and set_save_text().
|
inline |
Return the chosen file.
Definition at line 37 of file filechooser.hpp.
References chosen_file_.
Referenced by dialogs::show_file_chooser_dialog(), and dialogs::show_file_chooser_dialog_save().
|
virtual |
Reimplemented from gui::dialog.
Definition at line 90 of file filechooser.cpp.
References gui::dialog::dimension_measurements::buttons, gui::dialog_textbox::get_label(), gui::dialog::get_menu(), gui::dialog::get_textbox(), gui::widget::height(), i, gui::dialog::dimension_measurements::label_y, gui::dialog::dimension_measurements::menu_y, gui::dialog::set_layout(), show_directory_buttons_, and gui::dialog::dimension_measurements::textbox.
void dialogs::file_dialog::select_file | ( | const std::string & | file | ) |
Definition at line 140 of file filechooser.cpp.
References chosen_file_, files_list_, format_filename(), gui::dialog::get_textbox(), gui::file_menu::select_file(), and gui::textbox::set_text().
Referenced by dialogs::show_file_chooser_dialog(), and dialogs::show_file_chooser_dialog_save().
|
inline |
Definition at line 41 of file filechooser.hpp.
References autocomplete_.
Referenced by dialogs::show_file_chooser_dialog_save().
|
protected |
Definition at line 187 of file filechooser.cpp.
References format_filename(), gui::dialog::get_textbox(), gui::textbox::set_cursor_pos(), gui::textbox::set_selection(), and gui::textbox::set_text().
Referenced by action().
|
protected |
Definition at line 123 of file filechooser.cpp.
References gui::file_menu::add_path(), files_list_, and gui::file_menu::get_directory().
Referenced by action().
|
private |
Definition at line 57 of file filechooser.hpp.
Referenced by action(), and set_autocomplete().
|
private |
Definition at line 55 of file filechooser.hpp.
Referenced by action(), get_choice(), and select_file().
|
private |
Definition at line 56 of file filechooser.hpp.
Referenced by file_dialog(), and format_filename().
|
private |
Definition at line 52 of file filechooser.hpp.
Referenced by action(), file_dialog(), format_dirname(), format_filename(), select_file(), and unformat_filename().
|
private |
Definition at line 53 of file filechooser.hpp.
Referenced by action().
|
private |
Definition at line 54 of file filechooser.hpp.
Referenced by action().
|
private |
Definition at line 51 of file filechooser.hpp.
Referenced by file_dialog(), and layout().