Mercurial > hg > xemacs-beta
comparison lisp/custom/wid-edit.el @ 120:cca96a509cfe r20-1b12
Import from CVS: tag r20-1b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:25:29 +0200 |
parents | 7d55a9ba150c |
children | 9b50b4588a93 |
comparison
equal
deleted
inserted
replaced
119:d101af7320b8 | 120:cca96a509cfe |
---|---|
2 ;; | 2 ;; |
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. |
4 ;; | 4 ;; |
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> | 5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk> |
6 ;; Keywords: extensions | 6 ;; Keywords: extensions |
7 ;; Version: 1.69 | 7 ;; Version: 1.74 |
8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ | 8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ |
9 | 9 |
10 ;;; Commentary: | 10 ;;; Commentary: |
11 ;; | 11 ;; |
12 ;; See `widget.el'. | 12 ;; See `widget.el'. |
1236 (defvar widget-push-button-cache nil) | 1236 (defvar widget-push-button-cache nil) |
1237 | 1237 |
1238 (define-widget 'push-button 'item | 1238 (define-widget 'push-button 'item |
1239 "A pushable button." | 1239 "A pushable button." |
1240 :value-create 'widget-push-button-value-create | 1240 :value-create 'widget-push-button-value-create |
1241 :text-format "[%s]" | |
1241 :format "%[%v%]") | 1242 :format "%[%v%]") |
1242 | 1243 |
1243 (defun widget-push-button-value-create (widget) | 1244 (defun widget-push-button-value-create (widget) |
1244 ;; Insert text representing the `on' and `off' states. | 1245 ;; Insert text representing the `on' and `off' states. |
1245 (let* ((tag (or (widget-get widget :tag) | 1246 (let* ((tag (or (widget-get widget :tag) |
1246 (widget-get widget :value))) | 1247 (widget-get widget :value))) |
1247 (text (concat "[" tag "]")) | 1248 (text (format (widget-get widget :text-format) tag)) |
1248 (gui (cdr (assoc tag widget-push-button-cache)))) | 1249 (gui (cdr (assoc tag widget-push-button-cache)))) |
1249 (if (and (fboundp 'make-gui-button) | 1250 (if (and (fboundp 'make-gui-button) |
1250 (fboundp 'make-glyph) | 1251 (fboundp 'make-glyph) |
1251 widget-push-button-gui | 1252 widget-push-button-gui |
1252 (fboundp 'device-on-window-system-p) | 1253 (fboundp 'device-on-window-system-p) |
2372 :value-to-external (lambda (widget value) (apply 'vector value))) | 2373 :value-to-external (lambda (widget value) (apply 'vector value))) |
2373 | 2374 |
2374 (defun widget-vector-match (widget value) | 2375 (defun widget-vector-match (widget value) |
2375 (and (vectorp value) | 2376 (and (vectorp value) |
2376 (widget-group-match widget | 2377 (widget-group-match widget |
2377 (widget-apply :value-to-internal widget value)))) | 2378 (widget-apply widget :value-to-internal value)))) |
2378 | 2379 |
2379 (define-widget 'cons 'group | 2380 (define-widget 'cons 'group |
2380 "A cons-cell." | 2381 "A cons-cell." |
2381 :tag "Cons-cell" | 2382 :tag "Cons-cell" |
2382 :format "%{%t%}:\n%v" | 2383 :format "%{%t%}:\n%v" |