module Fox
  #
  # File selection dialog
  #
  # Each pattern in the _patternList_ comprises an optional name, followed by
  # a pattern in parentheses. The patterns are separated by newlines.
  # For example,
  #
  #  fileDialog.patternList = ["*",
  #                            "*.cpp,*.cc",
  #                            "*.hpp,*.hh,*.h"
  #                           ]
  #
  # and
  #
  #  fileDialog.patternList = ["All Files (*)",
  #                            "C++ Sources (*.cpp,*.cc)",
  #                            "C++ Headers (*.hpp,*.hh,*.h)"
  #                           ]
  #
  # will set the same three patterns, but the former shows no pattern names.
  #
  class FXFileDialog < FXDialogBox

    # File name [String]
    attr_accessor :filename
    
    # List of selected filenames [Array]
    attr_reader :filenames
    
    # File pattern [String]
    attr_accessor :pattern
    
    # List of file patterns shown in the file dialog [Array]
    attr_accessor :patternList
    
    # Current pattern number [Integer]
    attr_accessor :currentPattern
    
    # Directory [String]
    attr_accessor :directory
    
    # Inter-item spacing (in pixels) [Integer]
    attr_accessor :itemSpace
    
    # File list style [Integer]
    attr_accessor :fileBoxStyle
    
    # File selection mode [Integer]
    attr_accessor :selectMode

    # Returns an initialized FXFileDialog instance
    def initialize(owner, name, opts=0, x=0, y=0, w=500, h=300) # :yields: theFileDialog
    end

    # Get pattern text for given pattern number
    def getPatternText(patno); end

    # Change pattern text for pattern number
    def setPatternText(patno, text); end
  
    # Set visibility of the read-only button, where _shown_ is either +true+ or +false+
    def showReadOnly=(shown); end
    
    # Return +true+ if read-only button is shown
    def readOnlyShown?; end
    
    # Set initial state of read-only button, where _state_ is either +true+ or +false+
    def readOnly=(state); end
  
    # Return +true+ if read-only
    def readOnly?; end
  
    # Open existing filename
    def FXFileDialog.getOpenFilename(owner, caption, path, patterns="*", initial=0); end
  
    # Open multiple existing files
    def FXFileDialog.getOpenFilenames(owner, caption, path, patterns = "*", initial=0); end
  
    # Save to filename
    def FXFileDialog.getSaveFilename(owner, caption, path, patterns="*", initial=0); end
  
    # Open directory name
    def FXFileDialog.getOpenDirectory(owner, caption, path); end
  end
end

