Class: TkValidateCommand::ValidateArgs

Inherits:
TkUtil::CallbackSubst show all
Defined in:
lib/tk/validation.rb

Constant Summary collapse

KEY_TBL =
[
  [ ?d, ?n, :action ],
  [ ?i, ?x, :index ],
  [ ?s, ?e, :current ],
  [ ?v, ?s, :type ],
  [ ?P, ?e, :value ],
  [ ?S, ?e, :string ],
  [ ?V, ?s, :triggered ],
  [ ?W, ?w, :widget ],
  nil
]
PROC_TBL =
[
  [ ?n, TkComm.method(:number) ],
  [ ?s, TkComm.method(:string) ],
  [ ?w, TkComm.method(:window) ],

  [ ?e, proc{|val|
      #enc = Tk.encoding
      enc = ((Tk.encoding)? Tk.encoding : Tk.encoding_system)
      if enc
        Tk.fromUTF8(TkComm::string(val), enc)
      else
        TkComm::string(val)
      end
    }
  ],

  [ ?x, proc{|val|
      idx = TkComm::number(val)
      if idx < 0
        nil
      else
        idx
      end
    }
  ],

  nil
]

Class Method Summary collapse

Methods inherited from TkUtil::CallbackSubst

_define_attribute_aliases, _get_all_subst_keys, _get_extra_args_tbl, _get_subst_key, _setup_subst_table, _sym2subst, #initialize, inspect, scan_args, subst_arg

Constructor Details

This class inherits a constructor from TkUtil::CallbackSubst

Class Method Details

.ret_val(val) ⇒ Object

def self._get_extra_args_tbl

# return an array of convert procs
[]

end



284
285
286
# File 'lib/tk/validation.rb', line 284

def self.ret_val(val)
  (val)? '1': '0'
end