renaming interface
original commit: 0b8cd6852f839deb897be729adeab521d275e4c2
This commit is contained in:
parent
db663a8865
commit
e16d80b9f9
|
@ -82,7 +82,7 @@
|
||||||
|
|
||||||
;; a snip that can contain an aligned-pasteboard<%> and also be stretched within an aligned-pasteboard<%>
|
;; a snip that can contain an aligned-pasteboard<%> and also be stretched within an aligned-pasteboard<%>
|
||||||
(define aligned-editor-snip%
|
(define aligned-editor-snip%
|
||||||
(class* editor-snip% (aligned-pasteboard-parent<%> aligned-snip<%>)
|
(class* editor-snip% (aligned-pasteboard-parent<%> stretchable-snip<%>)
|
||||||
(inherit get-editor get-margin set-min-width set-min-height)
|
(inherit get-editor get-margin set-min-width set-min-height)
|
||||||
|
|
||||||
(init
|
(init
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
(dynamic-let ([ignore-resizing? true])
|
(dynamic-let ([ignore-resizing? true])
|
||||||
(for-each-snip
|
(for-each-snip
|
||||||
(lambda (s)
|
(lambda (s)
|
||||||
(if (is-a? s aligned-snip<%>)
|
(if (is-a? s stretchable-snip<%>)
|
||||||
(send s set-aligned-min-sizes)))
|
(send s set-aligned-min-sizes)))
|
||||||
(find-first-snip))
|
(find-first-snip))
|
||||||
(set!-values (aligned-min-width aligned-min-height)
|
(set!-values (aligned-min-width aligned-min-height)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
(provide
|
(provide
|
||||||
aligned-pasteboard<%>
|
aligned-pasteboard<%>
|
||||||
aligned-pasteboard-parent<%>
|
aligned-pasteboard-parent<%>
|
||||||
aligned-snip<%>)
|
stretchable-snip<%>)
|
||||||
|
|
||||||
;; the interface that must be implemented for a pasteboard to be contained in an aligned-pasteboard-parent<%>
|
;; the interface that must be implemented for a pasteboard to be contained in an aligned-pasteboard-parent<%>
|
||||||
(define aligned-pasteboard<%>
|
(define aligned-pasteboard<%>
|
||||||
|
@ -69,8 +69,8 @@
|
||||||
|
|
||||||
;; the interface that must be implemented by a class to be inserted into an aligned-pasteboard<%> and
|
;; the interface that must be implemented by a class to be inserted into an aligned-pasteboard<%> and
|
||||||
;; be stretched and shrunk according to the geometry managment. note: any snip may be insert... those
|
;; be stretched and shrunk according to the geometry managment. note: any snip may be insert... those
|
||||||
;; that do not implement aligned-snip<%> will simply not be stretched.
|
;; that do not implement stretchable-snip<%> will simply not be stretched.
|
||||||
(define aligned-snip<%>
|
(define stretchable-snip<%>
|
||||||
(interface ()
|
(interface ()
|
||||||
;; get-aligned-min-width (-> positive?)
|
;; get-aligned-min-width (-> positive?)
|
||||||
;; get the minimum width of the snip
|
;; get the minimum width of the snip
|
||||||
|
|
|
@ -52,14 +52,14 @@
|
||||||
;; the minimum width of the snip
|
;; the minimum width of the snip
|
||||||
(define (snip-min-width snip)
|
(define (snip-min-width snip)
|
||||||
(cond
|
(cond
|
||||||
[(is-a? snip aligned-snip<%>)
|
[(is-a? snip stretchable-snip<%>)
|
||||||
(send snip get-aligned-min-width)]
|
(send snip get-aligned-min-width)]
|
||||||
[else (snip-width snip)]))
|
[else (snip-width snip)]))
|
||||||
|
|
||||||
;; the minimum height of the snip
|
;; the minimum height of the snip
|
||||||
(define (snip-min-height snip)
|
(define (snip-min-height snip)
|
||||||
(cond
|
(cond
|
||||||
[(is-a? snip aligned-snip<%>)
|
[(is-a? snip stretchable-snip<%>)
|
||||||
(send snip get-aligned-min-height)]
|
(send snip get-aligned-min-height)]
|
||||||
[else (snip-height snip)]))
|
[else (snip-height snip)]))
|
||||||
|
|
||||||
|
@ -104,14 +104,14 @@
|
||||||
;; true if the snip can be resized in the x dimention
|
;; true if the snip can be resized in the x dimention
|
||||||
(define (stretchable-width? snip)
|
(define (stretchable-width? snip)
|
||||||
(cond
|
(cond
|
||||||
[(is-a? snip aligned-snip<%>)
|
[(is-a? snip stretchable-snip<%>)
|
||||||
(send snip stretchable-width)]
|
(send snip stretchable-width)]
|
||||||
[else false]))
|
[else false]))
|
||||||
|
|
||||||
;; true if the snip can be resized in the y dimention
|
;; true if the snip can be resized in the y dimention
|
||||||
(define (stretchable-height? snip)
|
(define (stretchable-height? snip)
|
||||||
(cond
|
(cond
|
||||||
[(is-a? snip aligned-snip<%>)
|
[(is-a? snip stretchable-snip<%>)
|
||||||
(send snip stretchable-height)]
|
(send snip stretchable-height)]
|
||||||
[else false]))
|
[else false]))
|
||||||
)
|
)
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
(new aligned-editor-snip% (editor pb))))
|
(new aligned-editor-snip% (editor pb))))
|
||||||
|
|
||||||
;; a text field fit to be in a test-case (no borders or margins etc.)
|
;; a text field fit to be in a test-case (no borders or margins etc.)
|
||||||
;;STATUS: this should really return an aligned-snip<%> not an editor-snip% of fixed size.
|
;;STATUS: this should really return a stretchable-snip<%> not an editor-snip% of fixed size.
|
||||||
(define (text-field text)
|
(define (text-field text)
|
||||||
(new editor-snip% (editor text)))
|
(new editor-snip% (editor text)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user