comparison lisp/dialog.el @ 863:42375619fa45

[xemacs-hg @ 2002-06-04 06:03:59 by andyp] merge 21.4 windows changes, minimally tested
author andyp
date Tue, 04 Jun 2002 06:05:53 +0000
parents 047d37eb70d7
children 5de13d96e131
comparison
equal deleted inserted replaced
862:278c743f1578 863:42375619fa45
306 The title of the frame. 306 The title of the frame.
307 :parent 307 :parent
308 The frame is made a child of this frame (defaults to the selected frame). 308 The frame is made a child of this frame (defaults to the selected frame).
309 :properties 309 :properties
310 Additional properties of the frame, as well as `dialog-frame-plist'. 310 Additional properties of the frame, as well as `dialog-frame-plist'.
311 :autosize
312 If t the frame is sized to exactly fit the widgets given by :spec.
311 313
312 --------------------------------------------------------------------------- 314 ---------------------------------------------------------------------------
313 315
314 For type `question': 316 For type `question':
315 317
679 (cl-parsing-keywords 681 (cl-parsing-keywords
680 ((:title "XEmacs") 682 ((:title "XEmacs")
681 (:parent (selected-frame)) 683 (:parent (selected-frame))
682 :modal 684 :modal
683 :properties 685 :properties
686 :autosize
684 :spec) 687 :spec)
685 () 688 ()
686 (flet ((create-dialog-box-frame () 689 (flet ((create-dialog-box-frame ()
687 (let* ((ftop (frame-property cl-parent 'top)) 690 (let* ((ftop (frame-property cl-parent 'top))
688 (fleft (frame-property cl-parent 'left)) 691 (fleft (frame-property cl-parent 'left))
726 name ,name 729 name ,name
727 modeline-shadow-thickness 0 730 modeline-shadow-thickness 0
728 vertical-scrollbar-visible-p nil 731 vertical-scrollbar-visible-p nil
729 horizontal-scrollbar-visible-p nil 732 horizontal-scrollbar-visible-p nil
730 unsplittable t 733 unsplittable t
734 internal-border-width 8
731 left ,(+ fleft (- (/ fwidth 2) 735 left ,(+ fleft (- (/ fwidth 2)
732 (/ (* dfwidth 736 (/ (* dfwidth
733 fontw) 737 fontw)
734 2))) 738 2)))
735 top ,(+ ftop (- (/ fheight 2) 739 top ,(+ ftop (- (/ fheight 2)
736 (/ (* dfheight 740 (/ (* dfheight
737 fonth) 741 fonth)
738 2))))))) 742 2)))))))
739 (set-face-foreground 'modeline [default foreground] frame) 743 (set-face-foreground 'modeline [default foreground] frame)
740 (set-face-background 'modeline [default background] frame) 744 (set-face-background 'modeline [default background] frame)
745 ;; resize before mapping
746 (when cl-autosize
747 (set-frame-pixel-size
748 frame
749 (image-instance-width
750 (glyph-image-instance cl-spec
751 (frame-selected-window frame)))
752 (image-instance-height
753 (glyph-image-instance cl-spec
754 (frame-selected-window frame)))))
755 ;; somehow, even though the resizing is supposed
756 ;; to be while the frame is not visible, a
757 ;; visible resize is perceptible
741 (unless unmapped (make-frame-visible frame)) 758 (unless unmapped (make-frame-visible frame))
742 (let ((newbuf (generate-new-buffer " *dialog box*"))) 759 (let ((newbuf (generate-new-buffer " *dialog box*")))
743 (set-buffer-dedicated-frame newbuf frame) 760 (set-buffer-dedicated-frame newbuf frame)
744 (set-frame-property frame 'dialog-box-buffer newbuf) 761 (set-frame-property frame 'dialog-box-buffer newbuf)
745 (set-window-buffer (frame-root-window frame) newbuf) 762 (set-window-buffer (frame-root-window frame) newbuf)