30#ifndef Fl_File_Chooser_H
31#define Fl_File_Chooser_H
33#include <FL/Fl_Double_Window.H>
37#include <FL/Fl_Group.H>
38#include <FL/Fl_Choice.H>
39#include <FL/Fl_Menu_Button.H>
40#include <FL/Fl_Button.H>
41#include <FL/Fl_Preferences.H>
42#include <FL/Fl_Tile.H>
43#include <FL/Fl_File_Browser.H>
45#include <FL/Fl_Check_Button.H>
46#include <FL/Fl_File_Input.H>
47#include <FL/Fl_Return_Button.H>
52 enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };
59 char preview_text_[2048];
61 void favoritesButtonCB();
68 void update_favorites();
69 void update_preview();
71 Fl_File_Chooser(
const char *d,
const char *p,
int t,
const char *title);
78 static void cb_showChoice(
Fl_Choice*,
void*);
86 static void cb_newButton(
Fl_Button*,
void*);
88 static void cb_(
Fl_Tile*,
void*);
110 void cb_cancelButton_i(
Fl_Button*,
void*);
111 static void cb_cancelButton(
Fl_Button*,
void*);
117 void cb_favUpButton_i(
Fl_Button*,
void*);
118 static void cb_favUpButton(
Fl_Button*,
void*);
120 void cb_favDeleteButton_i(
Fl_Button*,
void*);
121 static void cb_favDeleteButton(
Fl_Button*,
void*);
123 void cb_favDownButton_i(
Fl_Button*,
void*);
124 static void cb_favDownButton(
Fl_Button*,
void*);
126 void cb_favCancelButton_i(
Fl_Button*,
void*);
127 static void cb_favCancelButton(
Fl_Button*,
void*);
139 void filter(
const char *p);
146 void label(
const char *l);
147 const char *
label();
153 void showHidden(
int e);
154 void remove_hidden_files();
157 void rescan_keep_filename();
168 void * user_data()
const;
169 void user_data(
void *d);
170 const char *value(
int f = 1);
171 void value(
const char *filename);
239FL_EXPORT
char *fl_dir_chooser(
const char *message,
const char *fname,
int relative=0);
240FL_EXPORT
char *fl_file_chooser(
const char *message,
const char *pat,
const char *fname,
int relative=0);
241FL_EXPORT
void fl_file_chooser_callback(
void (*cb)(
const char*));
242FL_EXPORT
void fl_file_chooser_ok_label(
const char*l);
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:707
unsigned int Fl_Color
an FLTK color value
Definition Enumerations.H:764
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:736
This widget simply draws its box, and possibly it's label.
Definition Fl_Box.H:43
A button that is used to pop up a menu.
Definition Fl_Choice.H:85
The Fl_Double_Window provides a double-buffered window.
Definition Fl_Double_Window.H:49
The Fl_File_Browser widget displays a list of filenames, optionally with file-specific icons.
Definition Fl_File_Browser.H:48
static const char * preview_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:216
Fl_Widget * add_extra(Fl_Widget *gr)
Adds extra widget at the bottom of Fl_File_Chooser window.
Definition Fl_File_Chooser.cxx:446
static const char * favorites_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:192
void callback(void(*cb)(Fl_File_Chooser *, void *), void *d=0)
Sets the file chooser callback cb and associated data d.
Definition Fl_File_Chooser.cxx:323
static const char * hidden_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:228
int filter_value()
Gets the current filename filter selection.
Definition Fl_File_Chooser.cxx:344
static const char * manage_favorites_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:204
int preview() const
Returns the current state of the preview box.
Definition Fl_File_Chooser.H:151
static const char * new_directory_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:208
static const char * add_favorites_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:176
void color(Fl_Color c)
Sets the background color of the Fl_File_Browser list.
Definition Fl_File_Chooser.cxx:328
static const char * all_files_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:180
static const char * filesystems_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:200
void ok_label(const char *l)
Sets the label for the "ok" button in the Fl_File_Chooser.
Definition Fl_File_Chooser.cxx:373
static const char * filename_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:196
static const char * show_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:224
void iconsize(uchar s)
Sets the size of the icons in the Fl_File_Browser.
Definition Fl_File_Chooser.cxx:357
Fl_File_Chooser(const char *d, const char *p, int t, const char *title)
The constructor creates the Fl_File_Chooser dialog shown.
Definition Fl_File_Chooser.cxx:168
static const char * custom_filter_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:184
void hide()
Hides the Fl_File_Chooser window.
Definition Fl_File_Chooser.cxx:353
void directory(const char *d)
Sets the current directory.
Definition Fl_File_Chooser2.cxx:455
Fl_Check_Button * previewButton
The "preview" button is exported so that application developers can control the appearance and use.
Definition Fl_File_Chooser.H:94
int count()
Returns the number of selected files.
Definition Fl_File_Chooser2.cxx:418
static Fl_File_Sort_F * sort
the sort function that is used when loading the contents of a directory.
Definition Fl_File_Chooser.H:233
Fl_Button * newButton
The "new directory" button is exported so that application developers can control the appearance and ...
Definition Fl_File_Chooser.H:83
void filter(const char *p)
Sets or gets the current filename filter patterns.
Definition Fl_File_Chooser2.cxx:1004
static const char * new_directory_tooltip
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:212
static const char * existing_file_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:188
void preview(int e)
Enable or disable the preview tile.
Definition Fl_File_Chooser2.cxx:1091
static const char * save_label
[standard text may be customized at run-time]
Definition Fl_File_Chooser.H:220
void label(const char *l)
Sets the title bar text for the Fl_File_Chooser.
Definition Fl_File_Chooser.cxx:365
Fl_Preferences provides methods to store user settings between application starts.
Definition Fl_Preferences.H:69
The Fl_Tile class lets you resize the children by dragging the border between them:
Definition Fl_Tile.H:79
unsigned char uchar
unsigned char
Definition fl_types.h:39
#define FL_PATH_MAX
all path buffers should use this length
Definition filename.H:44
int Fl_File_Sort_F(struct dirent **, struct dirent **)
File sorting function.
Definition filename.H:122