add the ability to pass a bitmap directly for the splash screen
original commit: d381c7b40b58c6ea4d9fa7bf1d507a661ed91358
This commit is contained in:
parent
c0ffac2972
commit
f25948153a
|
@ -123,7 +123,9 @@
|
||||||
;; the function bound to the variable should only be called on the splash-eventspace main thread
|
;; the function bound to the variable should only be called on the splash-eventspace main thread
|
||||||
(define (splash-paint-callback dc)
|
(define (splash-paint-callback dc)
|
||||||
(if splash-bitmap
|
(if splash-bitmap
|
||||||
(send dc draw-bitmap splash-bitmap 0 0)
|
(begin
|
||||||
|
(send dc clear)
|
||||||
|
(send dc draw-bitmap splash-bitmap 0 0))
|
||||||
(send dc clear)))
|
(send dc clear)))
|
||||||
|
|
||||||
(define (splash-event-callback evt) (void))
|
(define (splash-event-callback evt) (void))
|
||||||
|
@ -165,12 +167,19 @@
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
[(or (path? splash-draw-spec)
|
[(or (path? splash-draw-spec)
|
||||||
(string? splash-draw-spec))
|
(string? splash-draw-spec)
|
||||||
(unless (file-exists? splash-draw-spec)
|
(is-a? splash-draw-spec bitmap%))
|
||||||
(fprintf (current-error-port) "WARNING: bitmap path ~s not found\n" splash-draw-spec)
|
(cond
|
||||||
(no-splash))
|
[(or (path? splash-draw-spec)
|
||||||
|
(string? splash-draw-spec))
|
||||||
|
(unless (file-exists? splash-draw-spec)
|
||||||
|
(fprintf (current-error-port) "WARNING: bitmap path ~s not found\n" splash-draw-spec)
|
||||||
|
(no-splash))
|
||||||
|
|
||||||
|
(set! splash-bitmap (make-object bitmap% splash-draw-spec))]
|
||||||
|
[else
|
||||||
|
(set! splash-bitmap splash-draw-spec)])
|
||||||
|
|
||||||
(set! splash-bitmap (make-object bitmap% splash-draw-spec))
|
|
||||||
(unless (send splash-bitmap ok?)
|
(unless (send splash-bitmap ok?)
|
||||||
(fprintf (current-error-port) "WARNING: bad bitmap ~s\n" splash-draw-spec)
|
(fprintf (current-error-port) "WARNING: bad bitmap ~s\n" splash-draw-spec)
|
||||||
(no-splash))
|
(no-splash))
|
||||||
|
|
|
@ -13,6 +13,7 @@ that counts how many files are loaded (until @racket[shutdown-splash] is called)
|
||||||
that number to control the gauge along the bottom of the splash screen.
|
that number to control the gauge along the bottom of the splash screen.
|
||||||
|
|
||||||
@defproc[(start-splash [draw-spec (or/c path-string?
|
@defproc[(start-splash [draw-spec (or/c path-string?
|
||||||
|
(is-a?/c bitmap%)
|
||||||
(vector/c (or/c (-> (is-a?/c dc<%>) void?)
|
(vector/c (or/c (-> (is-a?/c dc<%>) void?)
|
||||||
(-> (is-a?/c dc<%>)
|
(-> (is-a?/c dc<%>)
|
||||||
exact-nonnegative-integer?
|
exact-nonnegative-integer?
|
||||||
|
@ -49,7 +50,8 @@ that number to control the gauge along the bottom of the splash screen.
|
||||||
is reset based on the number of files that were loaded that time.
|
is reset based on the number of files that were loaded that time.
|
||||||
|
|
||||||
If the @racket[draw-spec] is a @racket[path-string?], then the path is expected to be a file
|
If the @racket[draw-spec] is a @racket[path-string?], then the path is expected to be a file
|
||||||
that contains a bitmap that is drawn as the contents of the splash screen. If @racket[draw-spec]
|
that contains a bitmap that is drawn as the contents of the splash screen. If it is
|
||||||
|
a bitmap, then that bitmap is used directly. If @racket[draw-spec]
|
||||||
is a vector, then the vector's first element is a procedure that is called to draw
|
is a vector, then the vector's first element is a procedure that is called to draw
|
||||||
the splash screen and the other two integers are the size of the splash screen, width followed by height.
|
the splash screen and the other two integers are the size of the splash screen, width followed by height.
|
||||||
If the procedure accepts only one argument, then it is called with a @racket[dc<%>] object where the
|
If the procedure accepts only one argument, then it is called with a @racket[dc<%>] object where the
|
||||||
|
|
Loading…
Reference in New Issue
Block a user