summaryrefslogtreecommitdiff
path: root/documentation/Fl_File_Chooser.html
blob: c349ea5bdc669a7ab747108c6a0db2eb2f64358e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<HTML>
<BODY>

<!-- NEW PAGE -->
<H2><A NAME="Fl_File_Chooser">class Fl_File_Chooser</A></H2>

<HR>

<H3>Class Hierarchy</H3>

<UL><PRE>
<A HREF="Fl_Group.html#Fl_Group">Fl_Group</A>
   |
   +----<B>Fl_File_Chooser</B>
</PRE></UL>

<H3>Include Files</H3>

<UL><PRE>
#include &lt;FL/Fl_File_Chooser.H>
</PRE></UL>

<H3>Description</H3>

<P>The <CODE>Fl_File_Chooser</CODE> widget displays a standard file selection
dialog that supports various selection modes.

<CENTER><IMG SRC="filechooser.gif" WIDTH="397" HEIGHT="322" ALT="Fl_File_Chooser widget"></CENTER>

<P>The <CODE>Fl_File_Chooser</CODE> class also exports several static values
that may be used to localize or customize the appearance of all file chooser
dialogs:

<UL>

	<LI><TT>const char
	*Fl_File_Chooser::directory_label</TT> <P>The label used
	for the directory chooser at the top of the file
	chooser. The default value is "Directory:".</P></LI>

	<LI><TT>const char *Fl_File_Chooser::filename_label</TT>
	<P>The label used for the filename field at the bottom
	of the file chooser. The default value is
	"Filename:".</P></LI>

	<LI><TT>const char *Fl_File_Chooser::filter_label</TT>
	<P>The label used for the filter text field. The default
	value is "Filter:".</P></LI>

	<LI><TT>Fl_File_Sort_F *Fl_File_Chooser::sort</TT>
	<P>The sort function used when loading the contents of a
	directory. The default value is <TT>fl_numericsort</TT>.
	Other values are described in the reference page for <A
	HREF="functions.html#fl_filename_list"><TT>fl_filename_list</TT></A></P></LI>

</UL>

<H3>Methods</H3>

<UL>

	<LI><A HREF="#Fl_File_Chooser.Fl_File_Chooser">Fl_File_Chooser</A>
	<LI><A HREF="#Fl_File_Chooser.~Fl_File_Chooser">~Fl_File_Chooser</A>
	<LI><A HREF="#Fl_File_Chooser.color">color</A>
	<LI><A HREF="#Fl_File_Chooser.count">count</A>
	<LI><A HREF="#Fl_File_Chooser.directory">directory</A>
	<LI><A HREF="#Fl_File_Chooser.filter">filter</A>
	<LI><A HREF="#Fl_File_Chooser.hide">hide</A>
	<LI><A HREF="#Fl_File_Chooser.iconsize">iconsize</A>
	<LI><A HREF="#Fl_File_Chooser.label">label</A>
	<LI><A HREF="#Fl_File_Chooser.rescan">rescan</A>
	<LI><A HREF="#Fl_File_Chooser.show">show</A>
	<LI><A HREF="#Fl_File_Chooser.textcolor">textcolor</A>
	<LI><A HREF="#Fl_File_Chooser.textfont">textfont</A>
	<LI><A HREF="#Fl_File_Chooser.textsize">textsize</A>
	<LI><A HREF="#Fl_File_Chooser.type">type</A>
	<LI><A HREF="#Fl_File_Chooser.value">value</A>
	<LI><A HREF="#Fl_File_Chooser.visible">visible</A>

</UL>

<H4><A NAME="Fl_File_Chooser.Fl_File_Chooser">Fl_File_Chooser(const char *pathname, const char *pattern,
int type, const char *title)</A></H4>

<P>The constructor creates the <CODE>Fl_File_Chooser</CODE> dialog pictured
above. The <CODE>pathname</CODE> argument can be a directory name or a
complete file name (in which case the corresponding file is highlighted
in the list and in the filename input field.)

<P>The <CODE>pattern</CODE> argument can be a <CODE>NULL</CODE>
string or <CODE>"*"</CODE> to list all files. See the FLTK
documentation on <A
HREF="functions.html#fl_filename_match"><CODE>fl_filename_match()</CODE></A>
for other kinds of patterns.

<P>The <CODE>type</CODE> argument can be one of the following:

<UL>
	<LI><CODE>SINGLE</CODE> - allows the user to select a
	single, existing file.
	<LI><CODE>MULTI</CODE> - allows the user to select one
	or more existing files.
	<LI><CODE>CREATE</CODE> - allows the user to select a
	single, existing file or specify a new filename.
	<LI><CODE>DIRECTORY</CODE> - allows the user to select a
	single, existing directory.
</UL>

<P>The <CODE>title</CODE> argument is used to set the title bar text for the
<CODE>Fl_File_Chooser</CODE> window.

<H4><A NAME="Fl_File_Chooser.~Fl_File_Chooser">~Fl_File_Chooser()</A></H4>

<P>Destroys the widget and frees all memory used by it.

<H4><A NAME="Fl_File_Chooser.color">void color(Fl_Color c)<BR>
Fl_Color color()</A></H4>

<P>Sets or gets the background color of the <CODE>Fl_File_Browser</CODE> list.

<H4><A NAME="Fl_File_Chooser.count">int count()</A></H4>

<P>Returns the number of selected files.

<H4><A NAME="Fl_File_Chooser.directory">void directory(const char *pathname)<BR>
const char *directory()</A></H4>

<P>Sets or gets the current directory.

<H4><A NAME="Fl_File_Chooser.filter">void filter(const char *pattern)<BR>
const char *filter()</A></H4>

<P>Sets or gets the current filename filter pattern.

<H4><A NAME="Fl_File_Chooser.hide">void hide()</A></H4>

<P>Hides the <CODE>Fl_File_Chooser</CODE> window.

<H4><A NAME="Fl_File_Chooser.iconsize">void iconsize(uchar s)<BR>
uchar iconsize()</A></H4>

<P>Sets or gets the size of the icons in the <CODE>Fl_File_Browser</CODE>.  By
default the icon size is set to 1.5 times the <CODE>textsize()</CODE>.

<H4><A NAME="Fl_File_Chooser.label">void label(const char *l)<BR>
const char *label()</A></H4>

<P>Sets or gets the title bar text for the <CODE>Fl_File_Chooser</CODE>.

<H4><A NAME="Fl_File_Chooser.rescan">void rescan()</A></H4>

<P>Reloads the current directory in the <CODE>Fl_File_Browser</CODE>.

<H4><A NAME="Fl_File_Chooser.show">void show()</A></H4>

<P>Shows the <CODE>Fl_File_Chooser</CODE> window.

<H4><A NAME="Fl_File_Chooser.textcolor">void textcolor(Fl_Color c)<BR>
Fl_Color textcolor()</A></H4>

<P>Sets or gets the current <CODE>Fl_File_Browser</CODE> text color.

<H4><A NAME="Fl_File_Chooser.textfont">void textfont(uchar f)<BR>
uchar textfont()</A></H4>

<P>Sets or gets the current <CODE>Fl_File_Browser</CODE> text font.

<H4><A NAME="Fl_File_Chooser.textsize">void textsize(uchar s)<BR>
uchar textsize()</A></H4>

<P>Sets or gets the current <CODE>Fl_File_Browser</CODE> text size.

<H4><A NAME="Fl_File_Chooser.type">void type(int t)<BR>
int type()</A></H4>

<P>Sets or gets the current type of <CODE>Fl_File_Chooser</CODE>.

<H4><A NAME="Fl_File_Chooser.value">const char *value(const char *pathname)<BR>
const char *value(int file)<BR>
const char *value()</A></H4>

<P>Sets or gets the current value of the selected file.

<H4><A NAME="Fl_File_Chooser.visible">int visible()</A></H4>

<P>Returns 1 if the <CODE>Fl_File_Chooser</CODE> window is visible.

<HR>


</BODY>
</HTML>