Class: TKXXS_CLASSES::OpenFilesD

Inherits:
FileAndDirChooser show all
Defined in:
lib/tkxxs/tkxxs_classes.rb

Constant Summary

Constants inherited from FileAndDirChooser

FileAndDirChooser::CONF

Instance Attribute Summary

Attributes inherited from FileAndDirChooser

#dialog

Instance Method Summary collapse

Methods inherited from FileAndDirChooser

#add2favorites_dirs_chk, #add2favorites_files_chk, #answer, #browse_btn, #cancel_btn, #entry, #fav_dirs, #fav_dirs_chk_changed, #fav_files, #fav_files_chk_changed, #favorite_chk_label, #favorite_dirs_btn, #favorite_files_btn, #favorite_lbl, #favorites_and_recent, #ok_btn, #paste_btn, #paste_lbl, #question_lbl, #recent_dirs, #recent_dirs_btn, #recent_files, #recent_files_btn, #recent_lbl, #set_paths, #text2, #tks_result_to_ary, #use_entry, #validate_and_leave, #validate_and_set_path

Constructor Details

#initialize(initialdir = nil, help = nil, hash = nil) ⇒ OpenFilesD

See: TKXXS.open_files



1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
# File 'lib/tkxxs/tkxxs_classes.rb', line 1444

def initialize( initialdir=nil,help=nil,hash=nil )
  initialdir, help, hash = 
    TKXXS_CLASSES.args_1( initialdir,help,hash )
  hash = {
    :mode => :openfiles,
    :question=>"Please choose the desired files",
    :title=>"Open Files",
    :filetypes => [['All files','*']],
    :multiple=>true 
  }.merge(hash)
  super(initialdir, help, hash)
end

Instance Method Details

#choose(hash) ⇒ Object



1457
1458
1459
1460
1461
1462
1463
1464
1465
# File 'lib/tkxxs/tkxxs_classes.rb', line 1457

def choose( hash )
  filesStr = Tk.getOpenFile(hash)
  if filesStr
    set_paths( tks_result_to_ary( filesStr ) )
  else
    validate_and_leave
  end
  nil
end