comparison lisp/toolbar.el @ 763:47ae55dda777

[xemacs-hg @ 2002-03-05 12:53:10 by stephent] preserve window size on toolbar reposition <87664idofd.fsf@tleeps18.sk.tsukuba.ac.jp>
author stephent
date Tue, 05 Mar 2002 12:53:11 +0000
parents 7039e6323819
children af0baad5ba14
comparison
equal deleted inserted replaced
762:177fa09febec 763:47ae55dda777
30 30
31 ;;; Code: 31 ;;; Code:
32 32
33 (defcustom toolbar-visible-p ;; added for the options menu - dverna apr. 98 33 (defcustom toolbar-visible-p ;; added for the options menu - dverna apr. 98
34 (specifier-instance default-toolbar-visible-p) 34 (specifier-instance default-toolbar-visible-p)
35 "Whether the default toolbar is globally visible. This option can be 35 "*Whether the default toolbar is globally visible.
36 customized through the options menu." 36 This option can be customized through the options menu."
37 :group 'display 37 :group 'display
38 :type 'boolean 38 :type 'boolean
39 :set #'(lambda (var val) 39 :set #'(lambda (var val)
40 (set-specifier default-toolbar-visible-p val) 40 (set-specifier default-toolbar-visible-p val)
41 (setq toolbar-visible-p val)) 41 (setq toolbar-visible-p val))
42 ) 42 )
43 43
44 (defcustom toolbar-captioned-p ;; added for the options menu - dverna apr. 98 44 (defcustom toolbar-captioned-p ;; added for the options menu - dverna apr. 98
45 (specifier-instance toolbar-buttons-captioned-p) 45 (specifier-instance toolbar-buttons-captioned-p)
46 "Whether the toolbars buttons are globally captioned. This option can be 46 "*Whether the toolbars buttons are globally captioned.
47 customized through the options menu." 47 This option can be customized through the options menu."
48 :group 'display 48 :group 'display
49 :type 'boolean 49 :type 'boolean
50 :set #'(lambda (var val) 50 :set #'(lambda (var val)
51 (set-specifier toolbar-buttons-captioned-p val) 51 (set-specifier toolbar-buttons-captioned-p val)
52 (setq toolbar-captioned-p val)) 52 (setq toolbar-captioned-p val))
53 ) 53 )
54 54
55 (defcustom default-toolbar-position ;; added for the options menu - dverna 55 (defcustom default-toolbar-position ;; added for the options menu - dverna
56 (default-toolbar-position) 56 (default-toolbar-position)
57 "The location of the default toolbar. It can be 'top, 'bottom, 'left or 57 "*The location of the default toolbar: 'top, 'bottom, 'left, or 'right.
58 'right. This option can be customized through the options menu." 58 This option can be customized through the options menu."
59 :group 'display 59 :group 'display
60 :type '(choice (const :tag "top" top) 60 :type '(choice (const :tag "top" top)
61 (const :tag "bottom" bottom) 61 (const :tag "bottom" bottom)
62 (const :tag "left" left) 62 (const :tag "left" left)
63 (const :tag "right" right)) 63 (const :tag "right" right))
64 :set #'(lambda (var val) 64 :set #'(lambda (var val)
65 (set-default-toolbar-position val) 65 (let* ((height (window-height))
66 (setq default-toolbar-position val)) 66 (hdiff (- (frame-height) height))
67 (width (window-width)))
68 (set-default-toolbar-position val)
69 (setq default-toolbar-position val)
70 ;; needed or dimensions don't update?
71 (redisplay-frame)
72 ;; This probably only works correctly if there is only one
73 ;; Emacs window. If windows are split, it probably results in
74 ;; small adjustments in their sizes.
75 (set-frame-size (selected-frame) width (+ height hdiff))
76 )
67 ) 77 )
68 78
69 (defvar toolbar-help-enabled t 79 (defvar toolbar-help-enabled t
70 "If non-nil help is echoed for toolbar buttons.") 80 "If non-nil help is echoed for toolbar buttons.")
71 81