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
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 13 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
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 27 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
41 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 41 def path; item { |si| return si.path } end |
#paths ⇒ Object
43 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 43 def paths; items { |sia| return sia.map(&:path) } end |
#Show(*args) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/fzeet/windows/comdlg/ShellFileDialog.rb', line 5 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 |