module Fox
  #
  # A data target allows a valuator widget such as an FXSlider or FXTextField
  # to be directly connected with a variable in the program.
  # Whenever the valuator control changes, the variable connected through
  # the data target is automatically updated; conversely, whenever the program
  # changes a variable, all the connected valuator widgets will be updated 
  # to reflect this new value on the display.
  # Data targets also allow connecting FXRadioButtons, FXMenuCommands, and so on
  # to a variable.  In this case, the new value of the connected variable is computed 
  # by subtracting +FXDataTarget::ID_OPTION+ from the message identifier.
  #
  # === Events
  #
  # The following messages are sent by FXDataTarget to its target:
  #
  # +SEL_COMMAND+::   Sent after the data target processes a +SEL_COMMAND+ message itself
  # +SEL_CHANGED+::   Sent after the data target processes a +SEL_CHANGED+ message itself
  #
  # === Message identifiers
  #
  # +ID_VALUE+::    Causes the FXDataTarget to ask sender for value
  # +ID_OPTION+::   +ID_OPTION++_i_ will set the value to _i_, where -10000 <= _i_ <= 10000
  #
  class FXDataTarget < FXObject
  
    # The message target object for this data target [FXObject]
    attr_accessor :target

    # The message identifier for this data target [Integer]
    attr_accessor :selector

    # The data target's current value [Object]
    attr_accessor :value

    # Initialize with this value
    def initialize(value=nil, tgt=nil, sel=0) # :yields: theDataTarget
    end
  end
end

