annotate lisp/w3/widget.el @ 86:364816949b59 r20-0b93

Import from CVS: tag r20-0b93
author cvs
date Mon, 13 Aug 2007 09:09:02 +0200
parents 6a378aca36af
children 821dec489c24
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; widget.el --- a library of user interface components.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1996 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Keywords: help, extensions, faces, hypermedia
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
7 ;; Version: 1.20
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
8 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
12 ;; If you want to use this code, please visit the URL above.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; This file only contain the code needed to define new widget types.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; Everything else is autoloaded from `widget-edit.el'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 (eval-when-compile (require 'cl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
21 (defmacro define-widget-keywords (&rest keys)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
22 (`
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
23 (eval-and-compile
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
24 (let ((keywords (quote (, keys))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
25 (while keywords
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
26 (or (boundp (car keywords))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
27 (set (car keywords) (car keywords)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
28 (setq keywords (cdr keywords)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
30 (define-widget-keywords :sample-face :sample-face-get :case-fold
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
31 :widget-doc
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
32 :create :convert-widget :format :value-create :offset :extra-offset
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
33 :tag :doc :from :to :args :value :value-from :value-to :action
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
34 :value-set :value-delete :match :parent :delete :menu-tag-get
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
35 :value-get :choice :void :menu-tag :on :off :on-type :off-type
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
36 :notify :entry-format :button :children :buttons :insert-before
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
37 :delete-at :format-handler :widget :value-pos :value-to-internal
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
38 :indent :size :value-to-external :validate :error :directory
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
39 :must-match :type-error :value-inline :inline :match-inline :greedy
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
40 :button-face-get :button-face :value-face :keymap :entry-from
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
41 :entry-to :help-echo :documentation-property :hide-front-space
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
42 :hide-rear-space)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
43
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
44 ;; These autoloads should be deleted when the file is added to Emacs.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
45 (autoload 'widget-create "widget-edit")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
46 (autoload 'widget-insert "widget-edit")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
47
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 0
diff changeset
48 ;;;###autoload
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (defun define-widget (name class doc &rest args)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 "Define a new widget type named NAME from CLASS.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 NAME and CLASS should both be symbols, CLASS should be one of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 existing widget types, or nil to create the widget from scratch.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 After the new widget has been defined, the following two calls will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 create identical widgets:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 * (widget-create NAME)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 * (apply 'widget-create CLASS ARGS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 The third argument DOC is a documentation string for the widget."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (put name 'widget-type (cons class args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (put name 'widget-documentation doc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;; The End.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (provide 'widget)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;; widget.el ends here