checkbox for templates commented out

svn: r6107
This commit is contained in:
Matthias Felleisen 2007-05-01 01:57:22 +00:00
parent 373860bb16
commit 0ef215c58c
4 changed files with 21 additions and 16 deletions

View File

@ -1,4 +1,3 @@
#cs
(module class mzscheme
(require "data-defs.scm"
(lib "contract.ss")
@ -38,7 +37,7 @@
[super (cadr the-class)]
[fields (caddr the-class)]
[prps (class-purpose the-class)])
(define templates
(define templates
(if (or (not template?) (eq? language BEGINNER))
""
(enumerate-with-separator

View File

@ -49,6 +49,9 @@ view
FEATURES:
** re-enable the method template creation in view
== the creation of method stubs depends on language level
** allow the introduction of an abstract class for common features in
Unions (common fields, common methods)

View File

@ -1,4 +1,3 @@
#cs
(module tool mzscheme
(require "class.scm"
"union.ss"
@ -41,9 +40,8 @@
(super-new)
(define (tee x) x)
#;(define-syntax tee
#;
(define-syntax tee
(syntax-rules ()
((_ x)
(let* ([a (format "--> ~a\n" 'x)]
@ -51,7 +49,9 @@
[b (format "==> ~a\n" y)])
(message-box "error" (format "~a~a" a b))
y))))
(define (tee x) x)
;; String (LANGUAGE-LEVEL -> X) (X ... -> String) (X ... -> String) -> Void
;; create a menu item for inserting classes and interfaces
(define (make-menu-item% descr get-info make draw)
@ -67,12 +67,15 @@
;; ---------------------------------------------------------------
(define language-level
(let ([simple* (member "ProfessorJ" current-language*)])
(let* ([simple* (tee (member "ProfessorJ" current-language*))]
[begin-> (tee (and simple* (cadr simple*)))])
(tee
(cond
[begin-> begin->]
[(boolean? simple*) PROFESSIONAL]
[(eq? (cadr simple*) BEGINNER) BEGINNER]
[(eq? (cadr simple*) INTERMEDIATE) INTERMEDIATE]
[else PROFESSIONAL])))
[else PROFESSIONAL]))))
;; get the editor and insert the desired items ...
(define editor (get-edit-target-object))

View File

@ -1,4 +1,3 @@
#cs
(module view mzscheme
(require "assoc-list.scm"
@ -131,23 +130,24 @@
;; switches for toString methods and template in comments
(define switch-pane (add-horizontal-panel p))
(define-values (string template diagram)
(define-values (string #;template diagram)
(cond
[switches?
(values (make-checkbox switch-pane ADD-TOSTRING)
(values (make-checkbox switch-pane ADD-TOSTRING)
#;
(let ([c (make-checkbox switch-pane ADD-TEMPLATE)])
(send c set-value #t)
c)
(make-checkbox switch-pane ADD-DIAGRAM))]
[no-diagram (values #f #f #f)]
[else (values #f #f (make-checkbox switch-pane ADD-DIAGRAM))]))
[no-diagram (values #f #;#f #f)]
[else (values #f #;#f (make-checkbox switch-pane ADD-DIAGRAM))]))
(define (get-switch x)
(cond
[(eq? x diagram) (and (not no-diagram) (send x get-value))]
[switches? (send x get-value)]
[else #f]))
(define/public (tostring?) (get-switch string))
(define/public (template?) (get-switch template))
(define/public (template?) #;(get-switch template) #f)
(define/public (diagram?) (get-switch diagram))
;; --------------------------------------------------------------------
@ -246,7 +246,7 @@
super-name (if (null? a-super) #f SUPER))
(send field-panel produce)
(send purpose get-value))
(tostring?)
(tostring?)
(template?))))
;; if the class specification is proper, hide dialog