/[mcclim]/mcclim/Doc/Guided-Tour/file-browser.lisp
ViewVC logotype

Contents of /mcclim/Doc/Guided-Tour/file-browser.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Mon Jan 30 16:14:01 2006 UTC (8 years, 2 months ago) by cfruhwirth
Branch: MAIN
CVS Tags: McCLIM-0-9-3, McCLIM-0-9-2
Move docs/guided-tour to Doc/Guided-Tour.
Add line-breaks to guided-tour.tex.
1 cfruhwirth 1.1 (eval-when (:compile-toplevel)
2     (asdf:oos 'asdf:load-op :clim)
3     (asdf:oos 'asdf:load-op :clim-clx))
4    
5     (in-package :clim-user)
6    
7     ; LTAG-start:file-browser-all
8     (define-application-frame file-browser ()
9     ((active-files :initform nil :accessor active-files))
10     (:panes
11     (file-browser :application
12     :display-function '(dirlist-display-files)
13     ;; Call the display-function whenever the command
14     ;; loop makes a ``full-cycle''
15     :display-time :command-loop)
16     (interactor :interactor))
17     (:layouts (default (vertically ()
18     file-browser
19     interactor))))
20    
21     (defmethod dirlist-display-files ((frame file-browser) pane)
22     ;; Clear old displayed entries
23     (clear-output-record (stream-output-history pane))
24    
25     (dolist (file (active-files frame))
26     ;; Instead of write-string, we use present so that the link to
27     ;; object file and the semantic information that file is
28     ;; pathname is retained.
29     (present file 'pathname :stream pane)
30     (terpri pane)))
31    
32     (define-file-browser-command (com-edit-directory :name "Edit Directory")
33     ((dir 'pathname))
34     (let ((dir (make-pathname :directory (pathname-directory dir)
35     :name :wild :type :wild :version :wild
36     :defaults dir)))
37     (setf (active-files *application-frame*)
38     (directory dir))))
39    
40     (define-presentation-to-command-translator pathname-to-edit-command
41     (pathname ; source presentation-type
42     com-edit-directory ; target-command
43     file-browser ; command-table
44     :gesture :select ; use this translator for pointer clicks
45     :documentation "Edit this path") ; used in context menu
46     (object) ; argument List
47     (list object)) ; arguments for target-command
48    
49     (defmethod adopt-frame :after (frame-manager (frame file-browser))
50     (execute-frame-command frame
51     `(com-edit-directory ,(make-pathname :directory '(:absolute)))))
52     ; LTAG-end

  ViewVC Help
Powered by ViewVC 1.1.5