comparison lisp/wid-edit.el @ 367:a4f53d9b3154 r21-1-13

Import from CVS: tag r21-1-13
author cvs
date Mon, 13 Aug 2007 11:01:07 +0200
parents 8429d81ab209
children cc15677e0335
comparison
equal deleted inserted replaced
366:83d76f480a59 367:a4f53d9b3154
437 "Face used for inactive widgets." 437 "Face used for inactive widgets."
438 :group 'widget-faces) 438 :group 'widget-faces)
439 439
440 ;; For inactiveness to work on complex structures, it is not 440 ;; For inactiveness to work on complex structures, it is not
441 ;; sufficient to keep track of whether a button/field/glyph is 441 ;; sufficient to keep track of whether a button/field/glyph is
442 ;; inactive or not -- we must know how many time it was deactivated 442 ;; inactive or not -- we must know how many times it was deactivated
443 ;; (inactiveness level). Successive deactivations of the same button 443 ;; (inactiveness level). Successive deactivations of the same button
444 ;; increment its inactive-count, and activations decrement it. When 444 ;; increment its inactive-count, and activations decrement it. When
445 ;; inactive-count reaches 0, the button/field/glyph is reactivated. 445 ;; inactive-count reaches 0, the button/field/glyph is reactivated.
446 446
447 (defun widget-activation-widget-mapper (extent action) 447 (defun widget-activation-widget-mapper (extent action)
510 (map-extents 'widget-activation-glyph-mapper 510 (map-extents 'widget-activation-glyph-mapper
511 nil from to :deactivate nil 'glyph-widget))) 511 nil from to :deactivate nil 'glyph-widget)))
512 512
513 (defun widget-specify-active (widget) 513 (defun widget-specify-active (widget)
514 "Make WIDGET active for user modifications." 514 "Make WIDGET active for user modifications."
515 (let ((inactive (widget-get widget :inactive))) 515 (let ((inactive (widget-get widget :inactive))
516 (from (widget-get widget :from))
517 (to (widget-get widget :to)))
516 (when (and inactive (not (extent-detached-p inactive))) 518 (when (and inactive (not (extent-detached-p inactive)))
517 ;; Reactivate the buttons and fields covered by the extent. 519 ;; Reactivate the buttons and fields covered by the extent.
518 (map-extents 'widget-activation-widget-mapper 520 (map-extents 'widget-activation-widget-mapper
519 inactive nil nil :activate nil 'button-or-field) 521 nil from to :activate nil 'button-or-field)
520 ;; Reactivate the glyphs. 522 ;; Reactivate the glyphs.
521 (map-extents 'widget-activation-glyph-mapper 523 (map-extents 'widget-activation-glyph-mapper
522 inactive nil nil :activate nil 'end-glyph) 524 nil from to :activate nil 'end-glyph)
523 (delete-extent inactive) 525 (delete-extent inactive)
524 (widget-put widget :inactive nil)))) 526 (widget-put widget :inactive nil))))
525 527
526 528
527 ;;; Widget Properties. 529 ;;; Widget Properties.