# File tk/lib/tk/validation.rb, line 111 def self.__def_validcmd(scope, klass, keys=nil) keys = klass._config_keys unless keys keys.each{|key| eval("def item_#{key}(id, *args, &b) __item_validcmd_call(#{klass.name}, '#{key}', id, *args, &b) end", scope) } end
# File tk/lib/tk/validation.rb, line 148 def __conv_item_vcmd_on_hash_kv(keys) key2class = __get_item_validate_key2class(tagid(tagOrId)) keys = _symbolkey2str(keys) key2class.each{|key, klass| if keys[key].kind_of?(Array) cmd, *args = keys[key] #keys[key] = klass.new(cmd, args.join(' ')) keys[key] = klass.new(cmd, *args) # elsif keys[key].kind_of?(Proc) || keys[key].kind_of?(Method) elsif TkComm._callback_entry?(keys[key]) keys[key] = klass.new(keys[key]) end } keys end
# File tk/lib/tk/validation.rb, line 139 def __get_item_validate_key2class(id) k2c = {} __item_validation_class_list(id).each{|klass| klass._config_keys.each{|key| k2c[key.to_s] = klass } } end
# File tk/lib/tk/validation.rb, line 134 def __item_validation_class_list(id) # maybe need to override [] end
# File tk/lib/tk/validation.rb, line 120 def __item_validcmd_call(tagOrId, klass, key, *args, &b) return itemcget(tagid(tagOrId), key) if args.empty? && !b cmd = (b)? proc(&b) : args.shift if cmd.kind_of?(klass) itemconfigure(tagid(tagOrId), key, cmd) elsif !args.empty? itemconfigure(tagid(tagOrId), key, [cmd, args]) else itemconfigure(tagid(tagOrId), key, cmd) end end