X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fdialog.el;h=235d13594583fce9811954d7ae4a6cff964fa5a2;hb=98941481ec0d6f89c375bdd83e8380cd01f758f4;hp=575538927e3179e9b87d9b4d8c1bceded820f1a6;hpb=02f4d2761a98c5cb9d5b423d2361160a5d8c9ee4;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/dialog.el b/lisp/dialog.el index 5755389..235d135 100644 --- a/lisp/dialog.el +++ b/lisp/dialog.el @@ -40,8 +40,8 @@ ;;; Code: (defun yes-or-no-p-dialog-box (prompt) "Ask user a yes-or-no question with a popup dialog box. -Return t if the answer is \"yes\". -Takes one argument, which is the string to display to ask the question." +Return t if the answer is \"yes\", nil if \"no\". Takes one argument, +the question string to display." (save-selected-frame (make-dialog-box 'question :question prompt @@ -195,6 +195,8 @@ The keywords allowed for `general' are The frame is made a child of this frame (defaults to the selected frame). :properties Additional properties of the frame, as well as `dialog-frame-plist'. +:autosize + If t the frame is sized to exactly fit the widgets given by :spec. --------------------------------------------------------------------------- @@ -262,6 +264,18 @@ The keywords allowed are --------------------------------------------------------------------------- +For type `directory': + +The keywords allowed are + +:initial-directory + The initial directory to be selected in the dialog box (defaults to the + current buffer's `default-directory). +:title + The title of the dialog box (defaults to \"Open\"). + +--------------------------------------------------------------------------- + For type `print': This invokes the Windows standard Print dialog. @@ -535,7 +549,9 @@ The keywords allowed are 'internal-make-dialog-box-exit did) (remove-hook 'delete-dialog-box-hook ',sym)))) - (add-hook 'delete-dialog-box-hook sym) + (if (framep id) + (add-hook 'delete-frame-hook sym) + (add-hook 'delete-dialog-box-hook sym)) (mapc 'disable-frame frames) (block nil (while t @@ -556,6 +572,7 @@ The keywords allowed are (:parent (selected-frame)) :modal :properties + :autosize :spec) () (flet ((create-dialog-box-frame () @@ -603,6 +620,7 @@ The keywords allowed are vertical-scrollbar-visible-p nil horizontal-scrollbar-visible-p nil unsplittable t + internal-border-width 8 left ,(+ fleft (- (/ fwidth 2) (/ (* dfwidth fontw) @@ -613,6 +631,19 @@ The keywords allowed are 2))))))) (set-face-foreground 'modeline [default foreground] frame) (set-face-background 'modeline [default background] frame) + ;; resize before mapping + (when cl-autosize + (set-frame-pixel-size + frame + (image-instance-width + (glyph-image-instance cl-spec + (frame-selected-window frame))) + (image-instance-height + (glyph-image-instance cl-spec + (frame-selected-window frame))))) + ;; somehow, even though the resizing is supposed + ;; to be while the frame is not visible, a + ;; visible resize is perceptible (unless unmapped (make-frame-visible frame)) (let ((newbuf (generate-new-buffer " *dialog box*"))) (set-buffer-dedicated-frame newbuf frame)