home *** CD-ROM | disk | FTP | other *** search
- (in-package :oou)
- (oou-provide :cicn-di)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; cicn-di.Lisp
- ;;
- ;; Copyright ⌐ 1992 Northwestern University Institute for the Learning Sciences
- ;; All Rights Reserved
- ;;
- ;; author: Michael S. Engber
- ;;
- ;; cicn and cicn-button dialog items
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (oou-dependencies
- :graphic-rsrc-svm
- :disable-dim
- :button-dim)
-
- (export '(cicn-di cicn-button-di set-view-cicn))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (defclass cicn-di (graphic-rsrc-svm dialog-item)
- ((rsrc-id :initarg :cicn-id)
- (rsrc-name :initarg :cicn-name)
- (rsrc-handle :initarg :cicn-handle)
- (graphic-scaling :initarg :cicn-scaling))
- (:default-initargs
- :rsrc-type "cicn"
- ))
-
- (defclass cicn-button-di (disable-dim button-dim cicn-di) ())
-
- (defmethod rsrc-get-fn ((di cicn-di) rsrc-type rsrc-id-or-name)
- (declare (ignore rsrc-type))
- (etypecase rsrc-id-or-name
- (fixnum (#_GetCIcon rsrc-id-or-name))
- (string (#_GetCIcon (get-resource-id "cicn" rsrc-id-or-name)))))
-
- (defmethod rsrc-dispose-fn ((di cicn-di) rsrc-handle rsrc-handlep)
- (if rsrc-handlep
- (error "Don't know how to dispose of resource 'cicn's")
- (#_DisposCIcon rsrc-handle)))
-
- (defmethod graphic-size ((di cicn-di) cicn-handle)
- (declare (ignore di))
- (subtract-points
- (href cicn-handle :CIcon.iconPMap.bounds.botRight)
- (href cicn-handle :CIcon.iconPMap.bounds.topLeft)))
-
- (defmethod draw-graphic ((di cicn-di) cicn-handle rect)
- (#_PlotCIcon rect cicn-handle))
-
- (defmethod set-view-cicn ((di cicn-di) &key cicn-id cicn-name cicn-handle)
- (set-view-resource di :rsrc-id cicn-id :rsrc-name cicn-name :rsrc-handle cicn-handle))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- #|
-
- (open-res-file "oou:examples;examples.rsrc")
-
- (setf *test-w*
- (make-instance 'dialog
- :window-type :document
- :color-p t
- :view-position :centered
- :view-size #@(150 50)
- :window-title "cicn demo"
- :view-subviews (list (make-instance 'cicn-button-di
- :view-position #@(59 10)
- :cicn-name "executioner"
- :dialog-item-action #'(lambda (item) (declare (ignore item)) (ed-beep))
- :view-nick-name :cicn
- ))))
-
-
- |#