From e3718c627e973d70fe2b88a0a25031b25d9008b7 Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Sun, 12 Aug 2012 15:03:19 +0200 Subject: [PATCH] contrib/toolbar.lisp (list-toolbar-modules): Add a list toolbar modules function. --- ChangeLog | 1 + TODO | 6 ++++-- contrib/toolbar.lisp | 18 ++++++++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a04f61..3fe3e03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2012-08-12 Philippe Brochard * contrib/toolbar.lisp: End of toolbar framework. + (list-toolbar-modules): Add a list toolbar modules function. 2012-08-03 Philippe Brochard diff --git a/TODO b/TODO index 13ed09d..4e197a0 100644 --- a/TODO +++ b/TODO @@ -12,13 +12,15 @@ Should handle these soon. FOR THE NEXT RELEASE ==================== -- Implement a save/restore root-frame system. And use it on error reset or for undo/redo. +- Add toolbar modules in contrib/toolbar.lisp. Any help or request on adding the modules + you want in your toolbar is very welcome. -- Add a toolbar in contrib/ MAYBE ===== +- Implement a save/restore root-frame system. And use it on error reset or for undo/redo. + - Add a tabbar layout : save some space on top/left... of the frame and display clickable children name. diff --git a/contrib/toolbar.lisp b/contrib/toolbar.lisp index 494b995..1c836a7 100644 --- a/contrib/toolbar.lisp +++ b/contrib/toolbar.lisp @@ -388,11 +388,21 @@ ,@body)))) +(defun list-toolbar-modules (&optional (stream t)) + "List all toolbar modules" + (format stream "Toolbar modules availables:~%") + (dolist (module (reverse *toolbar-module-list*)) + (format stream " Module: ~A~%" module) + (when (fboundp (toolbar-symbol-fun module)) + (format stream " ~A~%" (documentation (toolbar-symbol-fun module) 'function))) + (when (fboundp (toolbar-symbol-fun module 'click)) + (format stream " On click: ~A~%" (documentation (toolbar-symbol-fun module 'click) 'function))))) + ;;; ;;; Modules definitions ;;; (define-toolbar-module (clock) - "The clock module" + "A clock module" (multiple-value-bind (s m h) (get-decoded-time) (declare (ignore s)) @@ -400,7 +410,7 @@ (format nil "~2,'0D:~2,'0D" h m)))) (define-toolbar-module (clock-second) - "The clock module" + "A clock module with seconds" (multiple-value-bind (s m h) (get-decoded-time) (toolbar-draw-text toolbar (toolbar-module-pos module) (/ *toolbar-default-thickness* 2) @@ -408,13 +418,13 @@ (define-toolbar-module (label) - "The label module" + "A label module (for test)" (toolbar-draw-text toolbar (toolbar-module-pos module) (/ *toolbar-default-thickness* 2) "Label")) (define-toolbar-module (clickable-clock) - "The clock module (clickable)" + "A clickable clock module" (multiple-value-bind (s m h) (get-decoded-time) (declare (ignore s)) -- 2.11.4.GIT