Newer
Older
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
module Fox
#
# File selection dialog
#
# Each pattern in the _patternList_ comprises an optional name, followed by
# a pattern in parentheses. The patterns are separated by newlines.
# For example,
#
# fileDialog.patternList = ["*",
# "*.cpp,*.cc",
# "*.hpp,*.hh,*.h"
# ]
#
# and
#
# fileDialog.patternList = ["All Files (*)",
# "C++ Sources (*.cpp,*.cc)",
# "C++ Headers (*.hpp,*.hh,*.h)"
# ]
#
# will set the same three patterns, but the former shows no pattern names.
#
# === Wildcard matching modes
#
# +FILEMATCH_FILE_NAME+:: No wildcard can ever match "/" (or "\","/" under Windows).
# +FILEMATCH_NOESCAPE+:: Backslashes don't quote special chars ("\" is treated as "\").
# +FILEMATCH_PERIOD+:: Leading "." is matched only explicitly (Useful to match hidden files on Unix).
# +FILEMATCH_LEADING_DIR+:: Ignore "/..." after a match.
# +FILEMATCH_CASEFOLD+:: Compare without regard to case.
#
# Note that under Windows, +FILEMATCH_NOESCAPE+ must be passed.
#
class FXFileDialog < FXDialogBox
# File name [String]
attr_accessor :filename
# List of selected filenames [Array]
attr_reader :filenames
# File pattern [String]
attr_accessor :pattern
# Current pattern number [Integer]
attr_accessor :currentPattern
# Directory [String]
attr_accessor :directory
# Inter-item spacing (in pixels) [Integer]
attr_accessor :itemSpace
# File list style [Integer]
attr_accessor :fileBoxStyle
# File selection mode [Integer]
attr_accessor :selectMode
# Wildcard matching mode [Integer]
attr_accessor :matchMode
# Image size for preview images [Integer]
attr_accessor :imageSize
# Construct a file dialog box
def initialize(owner, name, opts=0, x=0, y=0, width=500, height=300) # :yields: theFileDialog
end
#
# Change the list of file patterns shown in the file dialog.
# The _patterns_ argument is an array of strings, and each string
# represents a different file pattern. A pattern consists of an
# optional name, followed by a pattern in parentheses. For example,
# this code:
#
# patterns = [ "*", "*.cpp,*.cc", "*.hpp,*.hh,*.h" ]
# aFileSelector.setPatternList(patterns)
#
# and this code:
#
# patterns = [ "All Files (*)", "C++ Sources (*.cpp,*.cc)", "C++ Headers (*.hpp,*.hh,*.h)" ]
# aFileSelector.setPatternList(patterns)
#
# will both set the same three patterns, but the former shows no pattern names.
#
# For compatibility with the FOX C++ library API of the same name, #setPatternList
# also accepts a _patterns_ value that is a single string, with each pattern
# separated by newline characters, e.g.
#
# patterns = "All Files (*)\nC++ Sources (*.cpp,*.cc)\nC++ Headers (*.hpp,*.hh,*.h)"
# aFileSelector.setPatternList(patterns)
#
def setPatternList(patterns); end
#
# Returns the list of patterns (an Array of Strings).
#
def getPatternList(); end
# Get pattern text for given pattern number
def getPatternText(patno); end
# Change pattern text for pattern number
def setPatternText(patno, text); end
#
# Return number of patterns
#
def numPatterns; end
#
# Change whether this file dialog allows pattern entry or not.
#
def allowsPatternEntry=(allowed); end
#
# Return +true+ if this file dialog allows pattern entry
#
def allowsPatternEntry? ; end
# Set visibility of the read-only button, where _shown_ is either +true+ or +false+
def showReadOnly=(shown); end
# Return +true+ if read-only button is shown
def readOnlyShown?; end
# Return +true+ if showing hidden files and directories
def hiddenFilesShown?; end
#
# If _state_ is +true+, the file dialog will show hidden files and
# directories; otherwise, it won't.
#
def hiddenFilesShown=(state); end
#
# If _shown_ is +true+, the file dialog will show preview images;
# otherwise it won't.
#
def imagesShown=(shown); end
#
# Return +true+ if the file dialog is showing preview images.
#
def imagesShown? ; end
# Set initial state of read-only button, where _state_ is either +true+ or +false+
def readOnly=(state); end
# Return +true+ if read-only
def readOnly?; end
# Return +true+ if navigation allowed.
def navigationAllowed?; end
# Set navigation to allowed (+true+) or disallowed (+false+)
def navigationAllowed=(allowed); end
#
# Display a dialog box that allows the user to select a single existing file name
# for opening.
# Returns the selected file name (a String).
#
# ==== Parameters:
#
# +owner+:: the owner window for the dialog box [FXWindow]
# +caption+:: the caption for the dialog box [String]
# +path+:: the initial filename [String]
# +patterns+:: the pattern list [String]
# +initial+:: the initial pattern to be used (an index into the pattern list) [Integer]
#
def FXFileDialog.getOpenFilename(owner, caption, path, patterns="*", initial=0); end
#
# Display a dialog box that allows the user to select multiple existing file names
# for opening.
# Returns an array of the selected file names (an array of strings).
#
# ==== Parameters:
#
# +owner+:: the owner window for the dialog box [FXWindow]
# +caption+:: the caption for the dialog box [String]
# +path+:: the initial filename [String]
# +patterns+:: the pattern list [String]
# +initial+:: the initial pattern to be used (an index into the pattern list) [Integer]
#
def FXFileDialog.getOpenFilenames(owner, caption, path, patterns="*", initial=0); end
#
# Display a dialog box that allows the user to select an existing file name, or
# enter a new file name, for saving.
# Returns the save file name (a String).
#
# ==== Parameters:
#
# +owner+:: the owner window for the dialog box [FXWindow]
# +caption+:: the caption for the dialog box [String]
# +path+:: the initial filename [String]
# +patterns+:: the pattern list [String]
# +initial+:: the initial pattern to be used (an index into the pattern list) [Integer]
#
def FXFileDialog.getSaveFilename(owner, caption, path, patterns="*", initial=0); end
#
# Display a dialog box that allows the user to select a directory.
# Returns the directory name (a String).
#
# ==== Parameters:
#
# +owner+:: the owner window for the dialog box [FXWindow]
# +caption+:: the caption for the dialog box [String]
# +path+:: the initial directory path [String]
#
def FXFileDialog.getOpenDirectory(owner, caption, path); end
end
end