[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Two problems



         FIRST PROBLEM


I was planning to ply with mini-application the tutorial found in Develop
and I get this result :

;Loading "Gaia:Terre:Applications:MCL
2.0B1:Mini-Application:example.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Mini-Application:mini-application-loader.lisp"...
;Loading "Gaia:Terre:Applications:MCL 2.0B1:Library:QUICKDRAW.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Library:Interfaces:QUICKDRAW.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Library:Interfaces:TYPES.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Mini-Application:utilities.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Mini-Application:globals.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Mini-Application:draw-dialog-class.lisp"...
;Loading "Gaia:Terre:Applications:MCL 2.0B1:Mini-Application:menus.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Mini-Application:palette-class.lisp"...
;Loading "Gaia:Terre:Applications:MCL
2.0B1:Mini-Application:draw-item-class.lisp"...
> Error: :WINDOW is not a valid record type
> While executing: FIND-RECORD-DESCRIPTOR
> Type Command-. to abort.
See the Restarts. menu item for further choices.
1 > 

When I Eval individualy the file "draw-item-class.lisp" I get that :
#<STANDARD-CLASS DRAW-ITEM>
#<STANDARD-CLASS RESOURCE>
*SLOP-IN-PIXELS*
#<STANDARD-METHOD AUTHOR-MODE-CLICK-HANDLER (DRAW-ITEM T)>
#<STANDARD-METHOD AUTHOR-MODE-DOUBLE-CLICK-HANDLER (DRAW-ITEM T)>
#<STANDARD-METHOD AUTHOR-MODE-SINGLE-CLICK-HANDLER (DRAW-ITEM T)>
#<STANDARD-METHOD SELECT-ITEM (DRAW-ITEM)>
#<STANDARD-METHOD SHOW-HANDLES (DRAW-ITEM)>
#<STANDARD-METHOD VIEW-DRAW-CONTENTS (DRAW-ITEM)>
> Error: :WINDOW is not a valid record type
> While executing: FIND-RECORD-DESCRIPTOR
> Type Command-. to abort.
See the Restarts. menu item for further choices.
2 > 

I Hope I am not the first with this problem. Does any body can help me ????


                SECOND PROBLEM

I am working with MCL2.0b1p3 but I get an other problem with my patch after
I modify the file scroll-bar-dialogs-item.lisp witch look like this (only
the modifications are included) :

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;view-draw-contents
;;
;;this function is called whenever the item needs to be drawn
;;
;;to draw the dialog-item, we just call _Draw1Control
;;

;;(defmethod view-draw-contents ((item scroll-bar-dialog-item))
;;  (_Draw1Control :ptr (dialog-item-handle item)))

(defmethod view-draw-contents ((item scroll-bar-dialog-item))
  (let ((handle (dialog-item-handle item)))
    (when handle
      (if (window-active-p (view-window item))
        (if (rref handle :control.vis)
          (_Draw1Control :ptr handle)
          (_ShowControl :ptr handle))
        (multiple-value-bind (tl br) (scroll-bar-and-splitter-corners item)
          (rlet ((rect :rect :topLeft tl :botRight br))
            (_FrameRect :ptr rect)))))))

(defun scroll-bar-and-splitter-corners (scroll-bar)
  (multiple-value-bind (tl br) (view-corners scroll-bar)
    (let ((splitter (pane-splitter scroll-bar)))
      (if splitter
        (multiple-value-bind (stl sbr) (view-corners splitter)
          (values (make-point (min (point-h tl) (point-h stl))
                              (min (point-v tl) (point-v stl)))
                  (make-point (max (point-h br) (point-h sbr))
                              (max (point-v br) (point-v sbr)))))
        (values tl br)))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;view-deactivate-event-handler
;;
;;this function is called whenever the srollbar needs to be deactivated
;;

;;(defmethod view-deactivate-event-handler ((item scroll-bar-dialog-item))
;; (with-focused-view (view-container item)
;;   (_hilitecontrol :ptr (dialog-item-handle item)
;;                   :word 255)))

(defmethod view-deactivate-event-handler ((item scroll-bar-dialog-item))
  (with-focused-view (view-container item)
    (let ((handle (dialog-item-handle item)))
      (unless (window-active-p (view-window item))
        (multiple-value-bind (tl br) (scroll-bar-and-splitter-corners item)
          (rlet ((rect :rect
                       :topLeft (add-points tl #@(1 1))
                       :botRight (subtract-points br #@(1 1))))
            (with-clip-rect rect
              (_HideControl :ptr handle)
              (_EraseRect :ptr rect)))))
      (_hilitecontrol :ptr handle :word 255))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;view-activate-event-handler
;;
;;this function is called whenever the scrollbar needs to be activated
;;

;;(defmethod view-activate-event-handler ((item scroll-bar-dialog-item))
;;  (when (and (dialog-item-enabled-p item)
;;             (let ((w (view-window item)))
;;               (and w (window-active-p w))))
;;    (with-focused-view (view-container item)
;;      (_hilitecontrol :ptr (dialog-item-handle item)
;;                      :word 0))))

(defmethod view-activate-event-handler ((item scroll-bar-dialog-item))
  (when (let ((w (view-window item)))
          (and w (window-active-p w)))
    (let ((handle (dialog-item-handle item)))
      (with-focused-view (view-container item)
        (when (dialog-item-enabled-p item)
          (_hilitecontrol :ptr handle :word 0))
        (unless (rref handle :control.vis)
          (_ShowControl :ptr handle)
          (let ((splitter (pane-splitter item)))
            (when splitter (view-draw-contents splitter))))))))

;;???? methode redefinie : redondance ou genericite ????

(defmethod view-draw-contents ((item pane-splitter))
  (when (window-active-p (view-window item))
    (let* ((tl (view-position item))
           (br (add-points tl (view-size item))))
      (rlet ((r :rect :topleft tl :botright br))
        (_FillRect :ptr r :ptr *black-pattern*)))))

I get a problem while compiling the file /
#<Package "CCL">
T
"TRAPS"
#<STANDARD-CLASS SCROLL-BAR-DIALOG-ITEM>
#<STANDARD-CLASS PANE-SPLITTER>
#<STANDARD-METHOD SET-SCROLL-BAR-TRACK-THUMB-P (SCROLL-BAR-DIALOG-ITEM T)>
#<STANDARD-METHOD SET-SCROLL-BAR-SCROLLEE (PANE-SPLITTER T)>
#<STANDARD-METHOD INITIALIZE-INSTANCE (SCROLL-BAR-DIALOG-ITEM)>
;Warning:  FUNCTION VIEW-SCROLL-BARS previously defined in: {Not Recorded}
;                  is now being redefined in: Gaia:Terre:Applications:MCL
2.0B1:Library:scroll-bar-dialog-items.Lisp
;         
; While executing: RECORD-SOURCE-FILE
> Error: The function VIEW-SCROLL-BARS is already defined in the CCL kernel.
> While executing: REDEFINE-KERNEL-FUNCTION
> Type Command-/ to continue, Command-. to abort.
> If continued: Replace the definition of VIEW-SCROLL-BARS.
See the Restarts. menu item for further choices.
1 > 
CCL::VIEW-SCROLL-BARS
;Warning:  FUNCTION ADD-VIEW-SCROLL-BAR previously defined in: {Not
Recorded}
;                  is now being redefined in: Gaia:Terre:Applications:MCL
2.0B1:Library:scroll-bar-dialog-items.Lisp
;         
; While executing: RECORD-SOURCE-FILE
> Error: The function ADD-VIEW-SCROLL-BAR is already defined in the CCL kernel.
> While executing: REDEFINE-KERNEL-FUNCTION
> Type Command-/ to continue, Command-. to abort.
> If continued: Replace the definition of ADD-VIEW-SCROLL-BAR.
See the Restarts. menu item for further choices.
1 > 
CCL::ADD-VIEW-SCROLL-BAR
;Warning:  FUNCTION DELETE-VIEW-SCROLL-BAR previously defined in: {Not
Recorded}
;                  is now being redefined in: Gaia:Terre:Applications:MCL
2.0B1:Library:scroll-bar-dialog-items.Lisp
;         
; While executing: RECORD-SOURCE-FILE
> Error: The function DELETE-VIEW-SCROLL-BAR is already defined in the CCL kernel.
> While executing: REDEFINE-KERNEL-FUNCTION
> Type Command-/ to continue, Command-. to abort.
> If continued: Replace the definition of DELETE-VIEW-SCROLL-BAR.
See the Restarts. menu item for further choices.
1 > 
CCL::DELETE-VIEW-SCROLL-BAR
#<STANDARD-METHOD INSTALL-VIEW-IN-WINDOW :AFTER (SCROLL-BAR-DIALOG-ITEM T)>
#<STANDARD-METHOD REMOVE-VIEW-FROM-WINDOW :BEFORE (SCROLL-BAR-DIALOG-ITEM)>
> Error: :CONTROL is not a valid record type
> While executing: FIND-RECORD-DESCRIPTOR
> Type Command-. to abort.
See the Restarts. menu item for further choices.
1 > Return to toplevel.
Aborted

And I don't know what went wrong and finaly i redefine functions but the
process terminate badly. 
What can I do to repaire my MCL properly ??????

Help me, please help me.

---
Herve Blanchon
GETA (Groupe d'Etude pour la Traduction Automatique)
BP 53X, 38041 GRENOBLE CEDEX, FRANCE
tel 76 51 43 69
blanchon@imag.fr