Preparation for the ability to set horizontal spacing. Two types of horizontal positi...
authorDavid Lewis <[email protected]>
Tue, 31 Aug 2010 11:47:13 +0000 (31 12:47 +0100)
committerDavid Lewis <[email protected]>
Wed, 14 Sep 2011 13:07:17 +0000 (14 14:07 +0100)
Also some package exports.

buffer.lisp
drawing.lisp
gui.lisp
packages.lisp

index 409afe6..cb1eeac 100644 (file)
 (defclass element (gsharp-object)
   ((bar :initform nil :initarg :bar :accessor bar)
    (xoffset :initform 0 :initarg :xoffset :accessor xoffset)
+   (right-pad :initform 0 :initarg :right-pad :accessor right-pad)
+   (left-pad :initform 0 :initarg :left-pad :accessor left-pad)
    (annotations :initform nil :initarg :annotations :accessor annotations)))
 
 (defmethod slots-to-be-saved append ((e element))
-  '(xoffset annotations))
+  '(xoffset annotations left-pad right-pad))
 
 (defmethod duration ((element element)) 0)
 (defmethod rbeams ((element element)) 0)
index 394fc8b..37383aa 100644 (file)
@@ -148,6 +148,11 @@ right of the center of its timeline"))
              (score-pane:staff-step 0)))
      (score-pane:staff-step 2)))
 
+(defmethod left-bulge :around ((element element) pane)
+  (+ (gsharp-buffer::left-pad element) (call-next-method)))
+(defmethod right-bulge :around ((element element) pane)
+  (+ (gsharp-buffer::right-pad element) (call-next-method)))
+
 (defmethod right-bulge ((element element) pane)
   (score-pane:staff-step 1))
 
index 6a9c8bc..77a0333 100644 (file)
--- a/gui.lisp
+++ b/gui.lisp
                  "")
              pane))))
 
+(defun x-offset-label (frame pane)
+  (declare (ignore frame))
+  (when (handler-case (cur-cluster)
+          (gsharp-condition () nil))
+    (princ (gsharp-buffer::xoffset (cur-element)) pane)))
+(defun x-pad-label (frame pane)
+  (declare (ignore frame))
+  (when (handler-case (cur-cluster)
+          (gsharp-condition () nil))
+    (princ (gsharp-buffer::left-pad (cur-element)) pane)))
+
 (define-application-frame gsharp (esa-frame-mixin
                                   standard-application-frame)
   ((views :initarg :views :initform '() :accessor views)
index 2cbb089..2219051 100644 (file)
           #:tie-right #:tie-left
           #:needs-saving
            #:tuning #:master-pitch-note #:master-pitch-freq
-           #:note-cents #:12-edo #:regular-temperament))
+           #:note-cents #:12-edo #:regular-temperament
+       #:x-offset #:left-pad #:right-pad
+       #:rastral-size #:zoom-level))
 
 (defpackage :gsharp-numbering
   (:use :gsharp-utilities :gsharp-buffer :clim-lisp)