FLTK 1.3.2
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
Fl_File_Chooser.H
1
//
2
// "$Id: Fl_File_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
3
//
4
// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
5
//
6
// Copyright 1998-2011 by Bill Spitzak and others.
7
//
8
// This library is free software. Distribution and use rights are outlined in
9
// the file "COPYING" which should have been included with this file. If this
10
// file is missing or damaged, see the license at:
11
//
12
// http://www.fltk.org/COPYING.php
13
//
14
// Please report all bugs and problems on the following page:
15
//
16
// http://www.fltk.org/str.php
17
//
18
19
// generated by Fast Light User Interface Designer (fluid) version 1.0300
20
21
#ifndef Fl_File_Chooser_H
22
#define Fl_File_Chooser_H
23
#include <
FL/Fl.H
>
24
#include <FL/Fl_Double_Window.H>
25
#include <stdio.h>
26
#include <stdlib.h>
27
#include <string.h>
28
#include <FL/Fl_Group.H>
29
#include <FL/Fl_Choice.H>
30
#include <FL/Fl_Menu_Button.H>
31
#include <FL/Fl_Button.H>
32
#include <FL/Fl_Preferences.H>
33
#include <FL/Fl_Tile.H>
34
#include <FL/Fl_File_Browser.H>
35
#include <FL/Fl_Box.H>
36
#include <FL/Fl_Check_Button.H>
37
#include <FL/Fl_File_Input.H>
38
#include <FL/Fl_Return_Button.H>
39
#include <FL/fl_ask.H>
40
41
class
FL_EXPORT
Fl_File_Chooser
{
42
public
:
43
enum
{ SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };
44
private
:
45
static
Fl_Preferences
prefs_;
46
void (*callback_)(
Fl_File_Chooser
*,
void
*);
47
void
*data_;
48
char
directory_[
FL_PATH_MAX
];
49
char
pattern_[
FL_PATH_MAX
];
50
char
preview_text_[2048];
51
int
type_;
52
void
favoritesButtonCB();
53
void
favoritesCB(
Fl_Widget
*w);
54
void
fileListCB();
55
void
fileNameCB();
56
void
newdir();
57
static
void
previewCB(
Fl_File_Chooser
*fc);
58
void
showChoiceCB();
59
void
update_favorites();
60
void
update_preview();
61
public
:
62
Fl_File_Chooser
(
const
char
*d,
const
char
*p,
int
t,
const
char
*title);
63
private
:
64
Fl_Double_Window
*window;
65
void
cb_window_i(
Fl_Double_Window
*,
void
*);
66
static
void
cb_window(
Fl_Double_Window
*,
void
*);
67
Fl_Choice
*showChoice;
68
void
cb_showChoice_i(
Fl_Choice
*,
void
*);
69
static
void
cb_showChoice(
Fl_Choice
*,
void
*);
70
Fl_Menu_Button
*favoritesButton;
71
void
cb_favoritesButton_i(
Fl_Menu_Button
*,
void
*);
72
static
void
cb_favoritesButton(
Fl_Menu_Button
*,
void
*);
73
public
:
74
Fl_Button
*
newButton
;
75
private
:
76
void
cb_newButton_i(
Fl_Button
*,
void
*);
77
static
void
cb_newButton(
Fl_Button
*,
void
*);
78
void
cb__i(
Fl_Tile
*,
void
*);
79
static
void
cb_(
Fl_Tile
*,
void
*);
80
Fl_File_Browser
*fileList;
81
void
cb_fileList_i(
Fl_File_Browser
*,
void
*);
82
static
void
cb_fileList(
Fl_File_Browser
*,
void
*);
83
Fl_Box
*previewBox;
84
public
:
85
Fl_Check_Button
*
previewButton
;
86
private
:
87
void
cb_previewButton_i(
Fl_Check_Button
*,
void
*);
88
static
void
cb_previewButton(
Fl_Check_Button
*,
void
*);
89
public
:
90
Fl_Check_Button
*
showHiddenButton
;
91
private
:
92
void
cb_showHiddenButton_i(
Fl_Check_Button
*,
void
*);
93
static
void
cb_showHiddenButton(
Fl_Check_Button
*,
void
*);
94
Fl_File_Input
*fileName;
95
void
cb_fileName_i(
Fl_File_Input
*,
void
*);
96
static
void
cb_fileName(
Fl_File_Input
*,
void
*);
97
Fl_Return_Button
*okButton;
98
void
cb_okButton_i(
Fl_Return_Button
*,
void
*);
99
static
void
cb_okButton(
Fl_Return_Button
*,
void
*);
100
Fl_Button
*cancelButton;
101
void
cb_cancelButton_i(
Fl_Button
*,
void
*);
102
static
void
cb_cancelButton(
Fl_Button
*,
void
*);
103
Fl_Double_Window
*favWindow;
104
Fl_File_Browser
*favList;
105
void
cb_favList_i(
Fl_File_Browser
*,
void
*);
106
static
void
cb_favList(
Fl_File_Browser
*,
void
*);
107
Fl_Button
*favUpButton;
108
void
cb_favUpButton_i(
Fl_Button
*,
void
*);
109
static
void
cb_favUpButton(
Fl_Button
*,
void
*);
110
Fl_Button
*favDeleteButton;
111
void
cb_favDeleteButton_i(
Fl_Button
*,
void
*);
112
static
void
cb_favDeleteButton(
Fl_Button
*,
void
*);
113
Fl_Button
*favDownButton;
114
void
cb_favDownButton_i(
Fl_Button
*,
void
*);
115
static
void
cb_favDownButton(
Fl_Button
*,
void
*);
116
Fl_Button
*favCancelButton;
117
void
cb_favCancelButton_i(
Fl_Button
*,
void
*);
118
static
void
cb_favCancelButton(
Fl_Button
*,
void
*);
119
Fl_Return_Button
*favOkButton;
120
void
cb_favOkButton_i(
Fl_Return_Button
*,
void
*);
121
static
void
cb_favOkButton(
Fl_Return_Button
*,
void
*);
122
public
:
123
~
Fl_File_Chooser
();
124
void
callback(
void
(*cb)(
Fl_File_Chooser
*,
void
*),
void
*d = 0);
125
void
color(
Fl_Color
c);
126
Fl_Color
color();
127
int
count();
128
void
directory(
const
char
*d);
129
char
* directory();
130
void
filter(
const
char
*p);
131
const
char
* filter();
132
int
filter_value();
133
void
filter_value(
int
f);
134
void
hide();
135
void
iconsize(
uchar
s);
136
uchar
iconsize();
137
void
label(
const
char
*l);
138
const
char
* label();
139
void
ok_label(
const
char
*l);
140
const
char
* ok_label();
141
void
preview(
int
e);
142
int
preview
()
const
{
return
previewButton->value(); };
143
private
:
144
void
showHidden(
int
e);
145
void
remove_hidden_files();
146
public
:
147
void
rescan();
148
void
rescan_keep_filename();
149
void
show();
150
int
shown();
151
void
textcolor(
Fl_Color
c);
152
Fl_Color
textcolor();
153
void
textfont(
Fl_Font
f);
154
Fl_Font
textfont();
155
void
textsize(
Fl_Fontsize
s);
156
Fl_Fontsize
textsize();
157
void
type(
int
t);
158
int
type();
159
void
* user_data()
const
;
160
void
user_data(
void
*d);
161
const
char
*value(
int
f = 1);
162
void
value(
const
char
*filename);
163
int
visible();
167
static
const
char
*
add_favorites_label
;
171
static
const
char
*
all_files_label
;
175
static
const
char
*
custom_filter_label
;
179
static
const
char
*
existing_file_label
;
183
static
const
char
*
favorites_label
;
187
static
const
char
*
filename_label
;
191
static
const
char
*
filesystems_label
;
195
static
const
char
*
manage_favorites_label
;
199
static
const
char
*
new_directory_label
;
203
static
const
char
*
new_directory_tooltip
;
207
static
const
char
*
preview_label
;
211
static
const
char
*
save_label
;
215
static
const
char
*
show_label
;
219
static
const
char
*
hidden_label
;
224
static
Fl_File_Sort_F
*
sort
;
225
private
:
226
Fl_Widget
* ext_group;
227
public
:
228
Fl_Widget
* add_extra(
Fl_Widget
* gr);
229
};
230
FL_EXPORT
char
*
fl_dir_chooser
(
const
char
*message,
const
char
*fname,
int
relative=0);
231
FL_EXPORT
char
*
fl_file_chooser
(
const
char
*message,
const
char
*pat,
const
char
*fname,
int
relative=0);
232
FL_EXPORT
void
fl_file_chooser_callback
(
void
(*cb)(
const
char
*));
233
FL_EXPORT
void
fl_file_chooser_ok_label
(
const
char
*l);
234
#endif
235
236
//
237
// End of "$Id: Fl_File_Chooser.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
238
//
© 1998-2012 by Bill Spitzak and others.