Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef FILE_CHOOSER_H_INCLUDED
00016 #define FILE_CHOOSER_H_INCLUDED
00017
00018 class config;
00019 class display;
00020
00021 #include "construct_dialog.hpp"
00022
00023 namespace gui
00024 {
00025 class file_menu;
00026 }
00027
00028 namespace dialogs
00029 {
00030
00031 class file_dialog : public gui::dialog {
00032 public:
00033 file_dialog(display &disp, const std::string& file_path, const std::string& title, bool show_directory_buttons);
00034
00035 virtual gui::dialog::dimension_measurements layout(int xloc=-1, int yloc=-1);
00036
00037
00038 std::string get_choice() const { return chosen_file_; }
00039
00040 void select_file(const std::string& file);
00041
00042 void set_autocomplete(bool value) { autocomplete_ = value; }
00043
00044 protected:
00045 void action(gui::dialog_process_info &dp_info);
00046 std::string unformat_filename(const std::string& filename) const;
00047 std::string format_filename(const std::string& filename) const;
00048 std::string format_dirname(const std::string& dirname) const;
00049
00050 private:
00051 bool show_directory_buttons_;
00052 gui::file_menu *files_list_;
00053 int last_selection_;
00054 std::string last_textbox_text_;
00055 std::string chosen_file_;
00056 bool autocomplete_;
00057 };
00058
00059
00060
00061
00062
00063
00064 int show_file_chooser_dialog(display &displ, std::string &filename,
00065 std::string const &title, bool show_directory_buttons = true,
00066 const std::string& file_to_search = "",
00067 int xloc = -1, int yloc = -1);
00068
00069
00070
00071 int show_file_chooser_dialog_save(display &displ, std::string &filename,
00072 std::string const &title, bool show_directory_buttons = true,
00073 const std::string& file_to_search = "",
00074 int xloc = -1, int yloc = -1);
00075 }
00076
00077 #endif