From alexander.ekart at gmx.at Sun Aug 2 22:09:58 2009 From: alexander.ekart at gmx.at (Alexander Ekart) Date: Mon, 3 Aug 2009 00:09:58 +0200 Subject: [mcclim-devel] is there a tree-panel available? Message-ID: <20090803000958.27661290@pequod> hi, is there something like a tree-panel available for use with mcclim? i saw that there is a class named tree-with-cross-edges in the experimental subfolder of the mcclim directory tree, but it doesnt seem to be useful (by now). kind regards, alex From _deepfire at feelingofgreen.ru Sun Aug 2 23:06:33 2009 From: _deepfire at feelingofgreen.ru (Samium Gromoff) Date: Mon, 03 Aug 2009 03:06:33 +0400 (MSD) Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090803000958.27661290@pequod> References: <20090803000958.27661290@pequod> Message-ID: <20090803.030633.211597775032378432._deepfire@feelingofgreen.ru> > hi, > is there something like a tree-panel available for use with mcclim? You actually do have in mind a treelist? > i saw that there is a class named tree-with-cross-edges in the > experimental subfolder of the mcclim directory tree, but it doesnt seem > to be useful (by now). This is free-form tree visualisator, not a treelist. regards, Samium Gromoff From rpgoldman at sift.info Sun Aug 2 23:17:35 2009 From: rpgoldman at sift.info (Robert Goldman) Date: Sun, 02 Aug 2009 18:17:35 -0500 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090803000958.27661290@pequod> References: <20090803000958.27661290@pequod> Message-ID: <4A761E8F.6060002@sift.info> Alexander Ekart wrote: > hi, > is there something like a tree-panel available for use with mcclim? > i saw that there is a class named tree-with-cross-edges in the > experimental subfolder of the mcclim directory tree, but it doesnt seem > to be useful (by now). > > kind regards, > alex > > _______________________________________________ > mcclim-devel mailing list > mcclim-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel > I don't think that's what you want. The tree with cross-edges was developed for graph layouts where the graph is "mostly" a tree, but with cross-edges in some places. More precisely, it was developed for HTN plans, if that helps --- these are task decomposition trees (top level task is most abstract, lower levels are increasingly concrete) which have cross edges for temporal constraints. So you get things like A decomposes into (has for children) B and C. There is an additional edge from B to C to indicate that B must be performed before C. If you are looking for something like that standard "tree of folders" widget that is so common in modern UIs, tree-with-cross-edges is not it. You are right, BTW, that the t-w-c-e has not been maintained (at least not by me). best, r From alexander.ekart at gmx.at Mon Aug 3 12:54:24 2009 From: alexander.ekart at gmx.at (Alexander Ekart) Date: Mon, 3 Aug 2009 14:54:24 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <4A761E8F.6060002@sift.info> References: <20090803000958.27661290@pequod> <4A761E8F.6060002@sift.info> Message-ID: <20090803145424.7c27710d@ixtlan> On Sun, 02 Aug 2009 18:17:35 -0500 Robert Goldman wrote: > > If you are looking for something like that standard "tree of folders" > widget that is so common in modern UIs, tree-with-cross-edges is not > it. > a standard "tree of folders" is exactly what i am searching for. i can read between your lines that there is no such thing?! kind regards, alex From rpgoldman at sift.info Mon Aug 3 13:12:10 2009 From: rpgoldman at sift.info (Robert Goldman) Date: Mon, 03 Aug 2009 08:12:10 -0500 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090803145424.7c27710d@ixtlan> References: <20090803000958.27661290@pequod> <4A761E8F.6060002@sift.info> <20090803145424.7c27710d@ixtlan> Message-ID: <4A76E22A.9010002@sift.info> Alexander Ekart wrote: > On Sun, 02 Aug 2009 18:17:35 -0500 > Robert Goldman wrote: > >> If you are looking for something like that standard "tree of folders" >> widget that is so common in modern UIs, tree-with-cross-edges is not >> it. >> > > a standard "tree of folders" is exactly what i am searching for. > i can read between your lines that there is no such thing?! No, simply that I'm not aware of one. I have slipped away from using McCLIM in the past two or three years, so my knowledge is not current. Actually, I never fully grokked the notions of CLIM gadget, anyway... best, r From demmeln at in.tum.de Mon Aug 3 15:41:04 2009 From: demmeln at in.tum.de (Nikolaus Demmel) Date: Mon, 3 Aug 2009 17:41:04 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090803000958.27661290@pequod> References: <20090803000958.27661290@pequod> Message-ID: Hi Alex, you should write one and submit it ;-) If written something similar once. It was kindof like a tree panel, based on stream-pane and presentations, but its not really ready to submit... One probably should write a propper gadget. Regards, Niko Am 03.08.2009 um 00:09 schrieb Alexander Ekart: > hi, > is there something like a tree-panel available for use with mcclim? > i saw that there is a class named tree-with-cross-edges in the > experimental subfolder of the mcclim directory tree, but it doesnt > seem > to be useful (by now). > > kind regards, > alex > > _______________________________________________ > mcclim-devel mailing list > mcclim-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/mcclim-devel From alexander.ekart at gmx.at Mon Aug 3 19:41:13 2009 From: alexander.ekart at gmx.at (Alexander Ekart) Date: Mon, 3 Aug 2009 21:41:13 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <4A770DAB.2000608@ai.sri.com> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> Message-ID: <20090803214113.02fb11bd@pequod> On Mon, 03 Aug 2009 09:17:47 -0700 "Fred M. Gilham" wrote: > Anyway I've attached some code that I think does what you want, from > an old repository of CLIM code. It will probably require some > hacking to make work. > > Good luck. > > -- Fred Gilham > thanks .. but it really does require some hacking. i'm not familier (enough) with the mcclim-internals. when trying to run the example (view-directory "~") as suggested in the comments, i get the following error: # [Condition of type COMMAND-TABLE-NOT-FOUND] i really come to like mcclim, but unfortunately i dont have time to hack around deep down. alex From demmeln at in.tum.de Mon Aug 3 19:47:39 2009 From: demmeln at in.tum.de (Nikolaus Demmel) Date: Mon, 3 Aug 2009 21:47:39 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090803214113.02fb11bd@pequod> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> Message-ID: Am 03.08.2009 um 21:41 schrieb Alexander Ekart: > On Mon, 03 Aug 2009 09:17:47 -0700 > "Fred M. Gilham" wrote: > >> Anyway I've attached some code that I think does what you want, from >> an old repository of CLIM code. It will probably require some >> hacking to make work. >> >> Good luck. >> >> -- Fred Gilham >> > > thanks .. but it really does require some hacking. > i'm not familier (enough) with the mcclim-internals. > when trying to run the example (view-directory "~") as suggested in > the > comments, i get the following error: > > # > [Condition of type COMMAND-TABLE-NOT-FOUND] > > i really come to like mcclim, but unfortunately i dont have time to > hack > around deep down. > Would you mind forwarding the code to the list. I'd be quite intrigued to take a look at it. Regards, Niko P.S.: Why is the reply-to Header for this mailing list not the list, but the sender? From alexander.ekart at gmx.at Mon Aug 3 20:15:04 2009 From: alexander.ekart at gmx.at (Alexander Ekart) Date: Mon, 3 Aug 2009 22:15:04 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> Message-ID: <20090803221504.46a13529@pequod> On Mon, 3 Aug 2009 21:47:39 +0200 Nikolaus Demmel wrote: > > Am 03.08.2009 um 21:41 schrieb Alexander Ekart: > > > On Mon, 03 Aug 2009 09:17:47 -0700 > > "Fred M. Gilham" wrote: > > > >> Anyway I've attached some code that I think does what you want, > >> from an old repository of CLIM code. It will probably require some > >> hacking to make work. > >> > >> Good luck. > >> > >> -- Fred Gilham > >> > > > > thanks .. but it really does require some hacking. > > i'm not familier (enough) with the mcclim-internals. > > when trying to run the example (view-directory "~") as suggested > > in the > > comments, i get the following error: > > > > # > > [Condition of type COMMAND-TABLE-NOT-FOUND] > > > > i really come to like mcclim, but unfortunately i dont have time > > to hack > > around deep down. > > > > > Would you mind forwarding the code to the list. I'd be quite > intrigued to take a look at it. > > Regards, > Niko > > P.S.: Why is the reply-to Header for this mailing list not the list, > but the sender? sure, i just added a naiv draw-triangle* function, because it doesnt seem to be available in the clim-namespace (anymore). here is the code: ;;; -*- Syntax: Common-lisp; Package: clim-user -*- (in-package :clim-user) ;;; Indented lists are a way of displaying hierarchical (tree) structure. ;;; Each non-terminal tree node is prefixed by an icon that shows whether ;;; the item is "open" or "closed". If open, the inferiors of the node ;;; are displayed directly below it, with indentation accumulating ;;; in relation to tree depth. For terminal nodes, there is no icon. ;;; ;;; Try: ;;; (view-directory "~") ; unix ;;; (view-directory "disneyland:>mickey-mouse>*.*.*") ; lispm ;;; ;;; Written by Jeff Morrill (jmorrill at bbn.com), December 92. ;;; It is provided "as is" without express or implied warranty. ;;; Thanks to Scott McKay for solving an incremental redisplay problem. ;;; ;;; ************************************************************ ;;; The basic protocol. Non-terminal nodes are called "groups." ;;; Everything that is not a group is considered to be a terminal node. ;; added: 3.8.3009 ;; reason: not available by default? (defun draw-triangle* (stream x1 y1 x2 y2 x3 y3 &key filled) (declare (ignore filled)) (draw-line stream x1 y1 x2 y2) (draw-line stream x2 y2 x3 y3) (draw-line stream x3 y3 x1 y1)) (defclass essential-group () ((display-contents :initform nil :initarg :display-contents :accessor display-contents))) (defmethod group-p ((self t)) nil) (defmethod group-p ((self essential-group)) t) (defmethod group-contents ((group t)) nil) (defmethod group-name ((group t)) group) (defmethod toggle-open ((group t)) (setf (display-contents group) (not (display-contents group)))) (defmethod indented-list-presentation-type ((group t) default) default) (defmethod indented-list-indentation ((group t)) 3) (defmethod display-indented-list ((group t) presentation-type stream indentation) ;; This presents the "name" part of both groups and nongroups. (updating-output (stream :unique-id group :cache-value group) (multiple-value-bind (x y) (stream-cursor-position stream) (declare (ignore x)) (stream-set-cursor-position stream (+ (* (stream-character-width stream #\m) indentation) (stream-line-height stream)) y) (present (group-name group) presentation-type :stream stream) (terpri stream)))) (defmethod display-indented-list :around ((group essential-group) presentation-type stream indentation) ;; This displays the icon and the group-contents of a group. (updating-output (stream :unique-id group) (draw-indented-list-handle group stream) (call-next-method) (when (display-contents group) (let ((i (indented-list-indentation group)) (type (indented-list-presentation-type group presentation-type))) (dolist (child (group-contents group)) (display-indented-list child type stream (+ indentation i))))))) (defun draw-indented-list-handle (group stream) "Draw the opened/closed icon (a triangle)" (updating-output (stream :unique-id 'list-handle :cache-value (display-contents group)) (with-output-as-presentation (stream group 'indented-list :single-box t) (let* ((open-p (display-contents group)) (h (- (stream-line-height stream) 2)) (h/2 (truncate h 2))) (multiple-value-bind (x y) (stream-cursor-position stream) (incf y 1) (incf x h/2) (let* ((x1 (+ x h/2)) (y1 (+ y h/2)) (x2 x) (y2 y) (x3 (if open-p (+ x h) x)) (y3 (if open-p y (+ y h)))) (draw-triangle* stream x1 y1 x2 y2 x3 y3 :filled t) (draw-point* stream (+ x h) (+ y h) :ink +background-ink+) (draw-point* stream (if open-p x (+ x h)) (if open-p (+ y h) y) :ink +background-ink+ )) (stream-set-cursor-position stream (+ x h h) y)))))) ;;; ************************************************************ ;;; A presentation type and an action for open/close operations. (define-presentation-type indented-list (&optional presentation-type)) (define-presentation-method accept ((type indented-list) stream (view textual-view) &key) (accept presentation-type :stream stream :prompt nil)) (define-presentation-method describe-presentation-type ((type indented-list) stream plural-count) (declare (ignore plural-count)) (describe-presentation-type presentation-type stream)) (define-presentation-method present (object (type indented-list) stream (view textual-view) &key) (display-indented-list object presentation-type stream (indented-list-indentation object))) (define-command-table :indented-lists) (define-presentation-action com-toggle-open (indented-list command :indented-lists :gesture :select :documentation "Reveal/Hide Contents" :menu t) (object window) (progn (toggle-open object) (redisplay-frame-pane *application-frame* window))) ;;;************************************************************ ;;; A generic application for viewing groups. (define-application-frame group-viewer () ((group-viewer-group :initform nil :accessor group-viewer-group) (group-viewer-ptype :initform nil :accessor group-viewer-ptype) (displayer :initform nil :accessor group-viewer-displayer)) (:command-table (:group-viewer :inherit-from (:indented-lists))) (:panes (display (scrolling () (make-pane 'application-pane :display-function 'display-viewer-group :display-time :no-clear)))) (:layouts (default (vertically () display)))) (defun display-or-redisplay-group (group presentation-type stream displayer) (cond ((not displayer) (window-clear stream) (with-end-of-line-action (stream :allow) (with-end-of-page-action (stream :allow) (setq displayer (updating-output (stream :unique-id :top-level) (display-indented-list group presentation-type stream (indented-list-indentation group))))))) (t (redisplay displayer stream))) displayer) (defun display-viewer-group (program stream) (setf (group-viewer-displayer program) (display-or-redisplay-group (group-viewer-group program) (group-viewer-ptype program) stream (group-viewer-displayer program)))) (defvar *viewer* nil) (defun view-group (group presentation-type) (let ((frame (or *viewer* (setq *viewer* (make-application-frame 'group-viewer :left 0 :top 0 :right 400 :bottom 400))))) (setf (group-viewer-group frame) group (group-viewer-ptype frame) presentation-type (group-viewer-displayer frame) nil) (run-frame-top-level frame))) ;;;************************************************************ ;;; An application for viewing file directories. (defun directory-p (pathname) (not (pathname-name pathname))) (defun directory-name (pathname) (let ((list (pathname-directory pathname))) (when (consp list) (string (car (last list)))))) (defun file-name (pathname) (file-namestring pathname)) (defun make-directory-pathname (directory) (make-pathname :defaults directory :name nil :type nil :version #-GENERA :UNSPECIFIC #+GENERA :NEWEST)) (defun read-directory (pathname) #-genera ;(directory pathname :directories-are-files nil) (directory pathname) #+genera (mapcar #'(lambda (list) (let ((path (car list))) (if (second (member :directory (cdr list))) (scl:send path :pathname-as-directory) path))) (cdr (fs:directory-list pathname)))) (defclass directory-display (essential-group) ((pathname :initarg :pathname :accessor encapsulated-pathname) (contents :accessor group-contents))) (defmethod print-object ((self directory-display) stream) (format stream "#<~A>" (group-name self))) (defmethod group-name ((self directory-display)) (directory-name (encapsulated-pathname self))) (defmethod group-contents :around ((self directory-display)) (if (not (slot-boundp self 'contents)) (let* ((stuff (read-directory (encapsulated-pathname self)))) (setf (group-contents self) (append (mapcar #'(lambda (p) (make-instance 'directory-display :pathname (make-directory-pathname p))) (sort (remove-if-not #'directory-p stuff) #'string-lessp :key #'directory-name)) (sort (mapcar #'file-name (remove-if #'directory-p stuff)) #'string-lessp)))) (call-next-method self))) (defun view-directory (directory) (view-group (make-instance 'directory-display :pathname (make-directory-pathname directory) :display-contents t) 'string)) From gilham at AI.SRI.COM Mon Aug 3 21:58:51 2009 From: gilham at AI.SRI.COM (Fred Gilham) Date: Mon, 03 Aug 2009 14:58:51 -0700 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090803221504.46a13529@pequod> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> <20090803221504.46a13529@pequod> Message-ID: <4A775D9B.6060808@ai.sri.com> Alexander Ekart wrote: > ;; added: 3.8.3009 > ;; reason: not available by default? > (defun draw-triangle* (stream x1 y1 x2 y2 x3 y3 &key filled) > (declare (ignore filled)) > (draw-line stream x1 y1 x2 y2) > (draw-line stream x2 y2 x3 y3) > (draw-line stream x3 y3 x1 y1)) > > Hi, Apart from mailer/wrapping issues, the above should probably be (defun draw-triangle* (stream x1 y1 x2 y2 x3 y3 &key filled) (clim:draw-polygon* stream (list x1 y1 x2 y2 x3 y3) :filled filled)) Your code gives me an error when I run it in Franz CLIM (which is what I have handy right now). -- Fred Gilham gilham at ai.sri.com Ornamental Plums How soon their petals depart How soon they return From gilham at AI.SRI.COM Tue Aug 4 04:25:33 2009 From: gilham at AI.SRI.COM (Fred M. Gilham) Date: Mon, 03 Aug 2009 21:25:33 -0700 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090803221504.46a13529@pequod> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> <20090803221504.46a13529@pequod> Message-ID: <4A77B83D.2020706@ai.sri.com> I hacked the thing a bit so it sort of works under McClim / SBCL. Code is attached. To try it out do something along the lines of (view-directory "/usr/local/") (SBCL won't understand "~" as a directory path). -- Fred Gilham -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: indented-lists.lisp URL: From gilham at AI.SRI.COM Tue Aug 4 04:43:44 2009 From: gilham at AI.SRI.COM (Fred M. Gilham) Date: Mon, 03 Aug 2009 21:43:44 -0700 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <4A77B83D.2020706@ai.sri.com> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> <20090803221504.46a13529@pequod> <4A77B83D.2020706@ai.sri.com> Message-ID: <4A77BC80.9030001@ai.sri.com> Fred M. Gilham wrote: > > I hacked the thing a bit so it sort of works under McClim / SBCL. > > Code is attached. To try it out do something along the lines of > > (view-directory "/usr/local/") > > (SBCL won't understand "~" as a directory path). > > -- Fred Gilham > Sorry for the noise, but to make the directory listing work right, the code I sent should be changed as follows. The "read-directory" defun should be (defun read-directory (pathname) (directory (merge-pathnames pathname (make-pathname :name :wild :type :wild :version :wild)))) With that change, the files will show up as well as directories. One thing that doesn't work is that the scroll bar won't change when you open and close directories. Perhaps someone else can hack it some more. -- Fred From alexander.ekart at gmx.at Tue Aug 4 09:49:34 2009 From: alexander.ekart at gmx.at (Alexander Ekart) Date: Tue, 4 Aug 2009 11:49:34 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <4A77BC80.9030001@ai.sri.com> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> <20090803221504.46a13529@pequod> <4A77B83D.2020706@ai.sri.com> <4A77BC80.9030001@ai.sri.com> Message-ID: <20090804114934.1b59200b@pequod> On Mon, 03 Aug 2009 21:43:44 -0700 "Fred M. Gilham" wrote: > Fred M. Gilham wrote: > > > > I hacked the thing a bit so it sort of works under McClim / SBCL. > > > > Code is attached. To try it out do something along the lines of > > > > (view-directory "/usr/local/") > > > > (SBCL won't understand "~" as a directory path). > > > > -- Fred Gilham > > > Sorry for the noise, but to make the directory listing work right, > the code I sent should be changed as follows. The "read-directory" > defun should be > > > (defun read-directory (pathname) > (directory (merge-pathnames > pathname > (make-pathname :name :wild > :type :wild > :version :wild)))) > > With that change, the files will show up as well as directories. > > One thing that doesn't work is that the scroll bar won't change when > you open and close directories. > > Perhaps someone else can hack it some more. > > -- Fred nice. but when i run the code, i just see a window with the text "local" and a black triangle in front of it. if i click on the triangle, the triangle rotated by 90 degrees counter-clockwise, but nothing else happens. any suggestions? i'm using sbcl 1.0.11 on linux. From demmeln at in.tum.de Tue Aug 4 10:17:58 2009 From: demmeln at in.tum.de (Nikolaus Demmel) Date: Tue, 4 Aug 2009 12:17:58 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <20090804114934.1b59200b@pequod> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> <20090803221504.46a13529@pequod> <4A77B83D.2020706@ai.sri.com> <4A77BC80.9030001@ai.sri.com> <20090804114934.1b59200b@pequod> Message-ID: <69AA7324-F9DF-468C-B861-6E4328B70AFA@in.tum.de> Am 04.08.2009 um 11:49 schrieb Alexander Ekart: > On Mon, 03 Aug 2009 21:43:44 -0700 > "Fred M. Gilham" wrote: > >> Fred M. Gilham wrote: >>> >>> I hacked the thing a bit so it sort of works under McClim / SBCL. >>> >>> Code is attached. To try it out do something along the lines of >>> >>> (view-directory "/usr/local/") >>> >>> (SBCL won't understand "~" as a directory path). >>> >>> -- Fred Gilham >>> >> Sorry for the noise, but to make the directory listing work right, >> the code I sent should be changed as follows. The "read-directory" >> defun should be >> >> >> (defun read-directory (pathname) >> (directory (merge-pathnames >> pathname >> (make-pathname :name :wild >> :type :wild >> :version :wild)))) >> >> With that change, the files will show up as well as directories. >> >> One thing that doesn't work is that the scroll bar won't change when >> you open and close directories. >> >> Perhaps someone else can hack it some more. >> >> -- Fred > > nice. but when i run the code, i just see a window with the text > "local" > and a black triangle in front of it. if i click on the triangle, the > triangle rotated by 90 degrees counter-clockwise, but nothing else > happens. > any suggestions? > i'm using sbcl 1.0.11 on linux. > It works fine over here (sbcl 1.0.29 + macos + latest mcclim). Tried a different directory? Maybe update SBCL (1.0.30 is latest). Regards, Niko From alexander.ekart at gmx.at Tue Aug 4 15:51:26 2009 From: alexander.ekart at gmx.at (Alexander Ekart) Date: Tue, 4 Aug 2009 17:51:26 +0200 Subject: [mcclim-devel] is there a tree-panel available? In-Reply-To: <69AA7324-F9DF-468C-B861-6E4328B70AFA@in.tum.de> References: <20090803000958.27661290@pequod> <4A770DAB.2000608@ai.sri.com> <20090803214113.02fb11bd@pequod> <20090803221504.46a13529@pequod> <4A77B83D.2020706@ai.sri.com> <4A77BC80.9030001@ai.sri.com> <20090804114934.1b59200b@pequod> <69AA7324-F9DF-468C-B861-6E4328B70AFA@in.tum.de> Message-ID: <20090804175126.6ea5d448@ixtlan> On Tue, 4 Aug 2009 12:17:58 +0200 Nikolaus Demmel wrote: > > It works fine over here (sbcl 1.0.29 + macos + latest mcclim). > > Tried a different directory? Maybe update SBCL (1.0.30 is latest). > > Regards, > Niko i'm proud to say that it works now :) it would be nice to have additional features like having actions that are associated with every tree-entry. but it already is a nice starting-point (well, it already was in 1992). k.r., alex From evgeny.zubok at tochka.ru Fri Aug 7 13:55:00 2009 From: evgeny.zubok at tochka.ru (Evgeny M. Zubok) Date: Fri, 07 Aug 2009 17:55:00 +0400 Subject: [mcclim-devel] A few questions about dragging functions Message-ID: <87r5vniv9n.fsf@tochka.ru> I'm reimplementing the drag-output-record, dragging-output to be more closer to CLIM specification. This work is almost done. However, a behaviour of drag-output-record is underspecified in some places. My questions are about `feedback' argument of drag-output-record. The following is what the CLIM specification says about feedback function and that's all what we have: ------------------------------------------------------------------------ `feedback' allows the programmer to identify a "feedback" function of seven arguments: the output record, the stream, the initial x and y position of the pointer, the current x and y position of the pointer, and a drawing argument (either :erase or :draw). It has dynamic extent. The default is nil, meaning that the feedback behavior will be for the output record to track the pointer. (The feedback argument is used when the programmer desires more complex feedback behavior, such as drawing a "rubber band" line as the user moves the mouse.) Note that if feedback is supplied, erase is ignored. ------------------------------------------------------------------------ My current solution. Notes: (i) the numbers with star means that the action is performed by user in the `feedback' function; (ii) (INITIAL-X INITIAL-Y) is the pointer coordinate when the user initially clicks the button on the desired record; (iii) (X-OLD Y-OLD) is remembered previous pointer coordinate. The user calls drag-output-record. In drag-output-record: 1* Call (feedback RECORD STREAM INITIAL-X INITIAL-Y INITIAL-X INITIAL-Y :DRAW) 2. Set X-OLD := INITIAL-X; Y-OLD := INITIAL-Y 3. User moves the pointer. Now X Y is a new pointer position. 4* Call (feedback RECORD STREAM INITIAL-X INITIAL-Y X-OLD Y-OLD :ERASE). Erase previous feedback effect and output record. 5. Change output-record-position of the RECORD to a new location. 6* Call (feedback RECORD STREAM INITIAL-X INITIAL-Y X Y :DRAW) where the user draws the record at it's new position and draws feedback effect. Note, that RECORD already has the new coordinates in output-record-position. 7. X-OLD := X; Y-OLD := Y 8. Repeat from 4 ... 9. User clicks a pointer button 10* Call (feedback RECORD STREAM INITIAL-X INITIAL-Y X Y :ERASE). Erase last feedback effect and the output record. 11. Replay the output record without feedback effect at it's final position. 12. Exit --- Qusetion about my solution. =========================== Q: Where the dragged output record should be erased and redrawn (i. e. replayed) when the `feedback' is supplied: in the `feedback' function by user or inside the drag-output-record function? My solution: I've delegated the erasing and redrawing the dragged record to the user. The situation with erasing is more clear. CLIM specification states that if `feedback' argument is supplied, the `erase' argument is ignored. As far as user already had the possibility to provide the `erase' argument with custom function (`erase-output-record' by default), then this possibility only migrates to the :ERASE part of `feedback' function. A situation with `feedback :DRAW' is unclear. The redrawing of dragged output record can be accomplished either (i) in the drag-output-record before `feedback :DRAW' or (ii) by user in `feedback :DRAW', manually replaying the record and the desired feedback effect. In other words, there are two algorithms, which are almost equivalent in the sense of visible effect, but not equivalent with respect to the user. (I) My current solution. Erasing/redrawing of output record and feedback effect is accompishing by user. 1. Call `feedback :ERASE' where user erases the dragged output record and additional feedback effect from their previous position (with possible replaying). 2. Change output-record-position to a new position inside drag-output-record. 3. Call 'feedback :DRAW' where user draws the dragged output record and then the additional feedback effect at the new position. (II) Alternative solution. The output record is redrawing in the drag-output-record. 1. Call `feedback :ERASE' where user erases the dragged output record and additional feedback effect from previous position (with possible replaying). 2. Change output-record-position to a new position inside drag-output-record 3. Draw the dragged output record at it's new position inside the drag-output-record by replaying required region that contains the output record. 4. Call 'feedback :DRAW' where user draws only the additional feedback effect. What to prefer? The former provides more flexibility to control output record appearence as it's dragged. For example, I could implement dragging that is snapped to a grid by erasing/redrawing output record and additional feedback effect only when the pointer occures in the next grid cell area. This is not possible with (II), bacause we cannot control the redrawing of output record. How it was implemented in original CLIM? Does anyone have any legacy code or examples that use the drag-output-record with `feedback'? --- Q: When the `feedback' is called with :DRAW, does the RECORD already have a new position on STREAM, i. e. the coordinates where it will be drawn? My solution: See item 5. I'm changing output-record-position in the drag-output-record just before calling `feedback :DRAW'. Only the original CLIM implementation could clear how this was implemented. --- Q: Am I right when passing the X-OLD Y-OLD to the `feedback :ERASE'? My solution: If we are using the current pointer coordinates to draw feedback effect in `feedback :DRAW' (for example, to draw line with flipping ink from 0,0 to current pointer location), then to erase this feedback effect in subsequent :ERASE the previous pointer coordinates are required, not the current. However, CLIM spec says, that only current pointer coordinates are passed to feedback :ERASE/:DRAW. Alternative solution: user somewhere remembers coordinates that are passed to `feedback :DRAW' and use them when it's required to erase previous feedback.