Module: Fzeet::ShellFileDialogMethods
- Included in:
- ShellFileOpenDialog, ShellFileSaveDialog, ShellFolderDialog
- Defined in:
- lib/fzeet/windows/comdlg/ShellFileDialog.rb
Instance Method Summary collapse
- #item ⇒ Object
- #items ⇒ Object
- #path ⇒ Object
- #paths ⇒ Object
- #Show(*args) ⇒ Object
- #show(window = Application.window) ⇒ Object
Instance Method Details
#item ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 32 def item FFI::MemoryPointer.new(:pointer) { |psi| next unless GetResult(psi) == Windows::S_OK si = Windows::ShellItem.new(psi.read_pointer) begin yield si ensure si.Release end } end |
#items ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 46 def items FFI::MemoryPointer.new(:pointer) { |psia| next unless GetResults(psia) == Windows::S_OK sia = Windows::ShellItemArray.new(psia.read_pointer) begin yield sia ensure sia.Release end } end |
#path ⇒ Object
60 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 60 def path; item { |si| return si.path } end |
#paths ⇒ Object
62 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 62 def paths; items { |sia| return sia.map(&:path) } end |
#Show(*args) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 24 def Show(*args) raise "#{self}.#{__method__} failed." if Windows.FAILED(result = vtbl[:Show].call(self, *args)) && result != Windows.HRESULT_FROM_WIN32(Windows::ERROR_CANCELLED) - 0x1_0000_0000 result end |