win32: avoid line-wrap in `meesage%' display
Also, adjust text measuring to ensure that it is as close as possible to measurements for a control. original commit: 2d70017091831a1cb041f16323ec489eadc078ac
This commit is contained in:
parent
9641cb5e70
commit
fcd3a38c65
|
@ -19,6 +19,7 @@
|
||||||
(define STM_SETIMAGE #x0172)
|
(define STM_SETIMAGE #x0172)
|
||||||
|
|
||||||
(define SS_LEFT #x00000000)
|
(define SS_LEFT #x00000000)
|
||||||
|
(define SS_LEFTNOWORDWRAP #x0000000C)
|
||||||
(define SS_BITMAP #x0000000E)
|
(define SS_BITMAP #x0000000E)
|
||||||
(define SS_ICON #x00000003)
|
(define SS_ICON #x00000003)
|
||||||
|
|
||||||
|
@ -83,7 +84,10 @@
|
||||||
(if (string? label)
|
(if (string? label)
|
||||||
label
|
label
|
||||||
"<image>")
|
"<image>")
|
||||||
(bitwise-ior SS_LEFT WS_CHILD WS_CLIPSIBLINGS
|
(bitwise-ior (if (string? label)
|
||||||
|
SS_LEFTNOWORDWRAP
|
||||||
|
SS_LEFT)
|
||||||
|
WS_CHILD WS_CLIPSIBLINGS
|
||||||
(if bitmap?
|
(if bitmap?
|
||||||
SS_BITMAP
|
SS_BITMAP
|
||||||
(if (symbol? label)
|
(if (symbol? label)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"theme.rkt"
|
"theme.rkt"
|
||||||
"cursor.rkt"
|
"cursor.rkt"
|
||||||
"key.rkt"
|
"key.rkt"
|
||||||
|
"dc.rkt"
|
||||||
"font.rkt")
|
"font.rkt")
|
||||||
|
|
||||||
(provide
|
(provide
|
||||||
|
@ -361,7 +362,7 @@
|
||||||
#:scale-h [scale-h 1])
|
#:scale-h [scale-h 1])
|
||||||
(atomically
|
(atomically
|
||||||
(unless measure-dc
|
(unless measure-dc
|
||||||
(let* ([bm (make-object bitmap% 1 1)]
|
(let* ([bm (make-object win32-bitmap% 1 1 #f)]
|
||||||
[dc (make-object bitmap-dc% bm)])
|
[dc (make-object bitmap-dc% bm)])
|
||||||
(set! measure-dc dc)))
|
(set! measure-dc dc)))
|
||||||
(send measure-dc set-font (or font
|
(send measure-dc set-font (or font
|
||||||
|
@ -383,7 +384,7 @@
|
||||||
(combine-h d1 d1) (combine-h a1 a2)))]
|
(combine-h d1 d1) (combine-h a1 a2)))]
|
||||||
[else
|
[else
|
||||||
(send measure-dc get-text-extent label #f #t)]))]
|
(send measure-dc get-text-extent label #f #t)]))]
|
||||||
[(->int) (lambda (v) (inexact->exact (floor v)))])
|
[(->int) (lambda (v) (inexact->exact (ceiling v)))])
|
||||||
(resize (->int (* scale-h (max (+ w dw) min-w)))
|
(resize (->int (* scale-h (max (+ w dw) min-w)))
|
||||||
(->int (* scale-w (max (+ h dh) min-h)))))))
|
(->int (* scale-w (max (+ h dh) min-h)))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user