Sha256: a2a34725ca84b31fe05dd846725350eca91a1d916289abdcbdc8d4580b42de53

Contents?: true

Size: 620 Bytes

Versions: 2

Compression:

Stored size: 620 Bytes

Contents


#
# A simple class to show a filerequester that remembers the
# last directory visited.
#
class FXMapFileDialog < FXFileDialog
  @@last_path = nil

  KNOWN_EXTENSIONS = [
    "Map Files (*.map,*.ifm,*.inf,*.t)",
    "All Files (*)",
  ]


  def initialize(parent, title, patterns = KNOWN_EXTENSIONS)
    opts = 0
    if RUBY_PLATFORM =~ /mswin/
      opts |= FILEMATCH_NOESCAPE
    end
    super(parent, title, opts)
    setPatternList(patterns)
    self.directory = @@last_path if @@last_path
    if execute != 0
      @@last_path = filename.sub(/[\\\/][^\\\/]+$/, '')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ifmapper-0.9.5 lib/IFMapper/FXMapFileDialog.rb
ifmapper-0.9 lib/IFMapper/FXMapFileDialog.rb