Class: QDA::GUI::ImportFileDialog
- Inherits:
-
Wx::FileDialog
- Object
- Wx::FileDialog
- QDA::GUI::ImportFileDialog
- Defined in:
- lib/weft/wxgui/dialogs.rb
Instance Method Summary collapse
-
#each_with_path ⇒ Object
return each selected file in turn into a block, passing in
path
andfilename
. - #filter ⇒ Object
-
#initialize(parent, import_class) ⇒ ImportFileDialog
constructor
A new instance of ImportFileDialog.
Constructor Details
#initialize(parent, import_class) ⇒ ImportFileDialog
Returns a new instance of ImportFileDialog.
167 168 169 170 171 172 173 174 175 176 |
# File 'lib/weft/wxgui/dialogs.rb', line 167 def initialize(parent, import_class) @import_class = import_class imports = QDA::Filters::import_filters[import_class] wildcard = imports.map { | filt | '%s (*.%s)|*.%s' % [ filt::DESCRIPTION, filt::EXTENSIONS, filt::EXTENSIONS ] }.join('|') super(parent, Lang::IMPORT_DOC_DIALOGUE_TITLE, "", "", wildcard, Wx::MULTIPLE|Wx::FILE_MUST_EXIST) end |
Instance Method Details
#each_with_path ⇒ Object
return each selected file in turn into a block, passing in path
and filename
180 181 182 183 184 |
# File 'lib/weft/wxgui/dialogs.rb', line 180 def each_with_path get_paths.each_with_index do | fpath, i | yield fpath, get_filenames[i] end end |
#filter ⇒ Object
186 187 188 |
# File 'lib/weft/wxgui/dialogs.rb', line 186 def filter() QDA::Filters::import_filters[@import_class][filter_index] end |