comparison lisp/wid-edit.el @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 080151679be2
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
1 ;;; wid-edit.el --- Functions for creating and using widgets. 1 ;;; wid-edit.el --- Functions for creating and using widgets.
2 ;; 2 ;;
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
4 ;; 4 ;;
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6 ;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org> 6 ;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org>
7 ;; Keywords: extensions 7 ;; Keywords: extensions
8 ;; Version: 1.9960-x 8 ;; Version: 1.9960-x
599 599
600 (defun widget-match-inline (widget vals) 600 (defun widget-match-inline (widget vals)
601 ;; In WIDGET, match the start of VALS. 601 ;; In WIDGET, match the start of VALS.
602 (cond ((widget-get widget :inline) 602 (cond ((widget-get widget :inline)
603 (widget-apply widget :match-inline vals)) 603 (widget-apply widget :match-inline vals))
604 ((and vals 604 ((and (listp vals)
605 (widget-apply widget :match (car vals))) 605 (widget-apply widget :match (car vals)))
606 (cons (list (car vals)) (cdr vals))) 606 (cons (list (car vals)) (cdr vals)))
607 (t nil))) 607 (t nil)))
608 608
609 (defun widget-apply-action (widget &optional event) 609 (defun widget-apply-action (widget &optional event)
2519 (t 2519 (t
2520 (setq vals nil))))) 2520 (setq vals nil)))))
2521 found)) 2521 found))
2522 2522
2523 (defun widget-checklist-match-up (args vals) 2523 (defun widget-checklist-match-up (args vals)
2524 ;; Rerturn the first type from ARGS that matches VALS. 2524 ;; Return the first type from ARGS that matches VALS.
2525 (let (current found) 2525 (let (current found)
2526 (while (and args (null found)) 2526 (while (and args (null found))
2527 (setq current (car args) 2527 (setq current (car args)
2528 args (cdr args) 2528 args (cdr args)
2529 found (widget-match-inline current vals))) 2529 found (widget-match-inline current vals)))
2541 (if (widget-value (widget-get child :button)) 2541 (if (widget-value (widget-get child :button))
2542 (setq result (append result (widget-apply child :value-inline))))) 2542 (setq result (append result (widget-apply child :value-inline)))))
2543 result)) 2543 result))
2544 2544
2545 (defun widget-checklist-validate (widget) 2545 (defun widget-checklist-validate (widget)
2546 ;; Ticked chilren must be valid. 2546 ;; Ticked children must be valid.
2547 (let ((children (widget-get widget :children)) 2547 (let ((children (widget-get widget :children))
2548 child button found) 2548 child button found)
2549 (while (and children (not found)) 2549 (while (and children (not found))
2550 (setq child (car children) 2550 (setq child (car children)
2551 children (cdr children) 2551 children (cdr children)