modified the draw-button-label contract so that it would work with a let*-style scoping for ->d

original commit: 476dd36eec345b439a97cc85047aba7f0dcf2957
This commit is contained in:
Robby Findler 2010-07-10 09:45:49 -05:00
parent 06f19bc758
commit ca8b8c5e76

View File

@ -1,10 +1,5 @@
#lang racket/gui #lang racket/gui
;; min-w, min-h : number -> contract
;; determines if the widths and heights are suitable
(define (min-w h) (flat-named-contract "draw-button-label-width" (lambda (w) (w . > . (- h (* 2 border-inset))))))
(define (min-h w) (flat-named-contract "draw-button-label-height" (lambda (h) (h . > . (* 2 border-inset)))))
(provide/contract (provide/contract
[get-left-side-padding (-> number?)] [get-left-side-padding (-> number?)]
[pad-xywh (-> number? number? (>=/c 0) (>=/c 0) [pad-xywh (-> number? number? (>=/c 0) (>=/c 0)
@ -14,13 +9,14 @@
[label (or/c false/c string?)] [label (or/c false/c string?)]
[x number?] [x number?]
[y number?] [y number?]
[w (and/c number? (min-w h))] [w number?]
[h (and/c number? (min-h w))] [h (and/c number? (>=/c (* 2 border-inset)))]
[mouse-over? boolean?] [mouse-over? boolean?]
[grabbed? boolean?] [grabbed? boolean?]
[button-label-font (is-a?/c font%)] [button-label-font (is-a?/c font%)]
[bkg-color (or/c false/c (is-a?/c color%) string?)]) [bkg-color (or/c false/c (is-a?/c color%) string?)])
() #:pre-cond
(w . > . (- h (* 2 border-inset)))
[result void?])] [result void?])]
[calc-button-min-sizes [calc-button-min-sizes