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
module Fox
#
# File selection widget
#
# === File selection modes
#
# +SELECTFILE_ANY+:: A single file, existing or not (to save to)
# +SELECTFILE_EXISTING+:: An existing file (to load)
# +SELECTFILE_MULTIPLE+:: Multiple existing files
# +SELECTFILE_MULTIPLE_ALL+:: Multiple existing files or directories, but not '.' and '..'
# +SELECTFILE_DIRECTORY+:: Existing directory, including '.' or '..'
#
# === 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.
#
# === Message identifiers
#
# +ID_FILEFILTER+:: x
# +ID_ACCEPT+:: x
# +ID_FILELIST+:: x
# +ID_DIRECTORY_UP+:: x
# +ID_DIRTREE+:: x
# +ID_NORMAL_SIZE+:: x
# +ID_MEDIUM_SIZE+:: x
# +ID_GIANT_SIZE+:: x
# +ID_HOME+:: x
# +ID_WORK+:: x
# +ID_BOOKMARK+:: x
# +ID_BOOKMENU+:: x
# +ID_VISIT+:: x
# +ID_NEW+:: x
# +ID_DELETE+:: x
# +ID_MOVE+:: x
# +ID_COPY+:: x
# +ID_LINK+:: x
#
class FXFileSelector < FXPacker
# The "Accept" button [FXButton]
attr_reader :acceptButton
# The "Cancel" button [FXButton]
attr_reader :cancelButton
# File name [String]
attr_accessor :filename
# File pattern [String]
attr_accessor :pattern
# Directory [String]
attr_accessor :directory
# Current pattern number [Integer]
attr_accessor :currentPattern
# Inter-item spacing (in pixels) [Integer]
attr_accessor :itemSpace
# Change file list style [Integer]
attr_accessor :fileBoxStyle
# Change file selection mode [Integer]
attr_accessor :selectMode
# Wildcard matching mode [Integer]
attr_accessor :matchMode
# Image size for preview images [Integer]
attr_accessor :imageSize
#
# Return an initialized FXFileSelector instance.
#
def initialize(p, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0) # :yields: theFileSelector
end
#
# Returns an array of the selected file names.
#
def filenames; end
#
# Change the list of file patterns shown in the file selector.
# 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
# Show read-only button.
def readOnlyShown=(shown); end
# Return +true+ if the read-only button is shown.
def readOnlyShown?; end
# Set state of read-only button.
def readOnly=(state); end
# Return +true+ if in read-only mode.
def readOnly?; end
# Return +true+ if showing hidden files and directories
def hiddenFilesShown?; end
#
# If _state_ is +true+, the file selector will show hidden files and
# directories; otherwise, it won't.
#
def hiddenFilesShown=(state); end
#
# If _shown_ is +true+, the file selector will show preview images;
# otherwise it won't.
#
def imagesShown=(shown); end
#
# Return +true+ if the file selector is showing preview images.
#
def imagesShown? ; end
# Return +true+ if navigation allowed.
def navigationAllowed?; end
# Set navigation to allowed (+true+) or disallowed (+false+)
def navigationAllowed=(allowed); end
#
# Given filename pattern of the form "GIF Format (*.gif)",
# returns the pattern only, i.e. "*.gif" in this case.
# If the parentheses are not found then returns the entire
# input pattern.
#
def FXFileSelector.patternFromText(pattern) ; end
#
# Given a pattern of the form "*.gif,*.GIF", return
# the first extension of the pattern, i.e. "gif" in this
# example. Returns empty string if it doesn't work out.
#
def FXFileSelector.extensionFromPattern(pattern) ; end
end
end