racket/gui win32: fix measurement of message% content

Strip away "&" before measuring.
This commit is contained in:
Matthew Flatt 2014-09-23 13:03:07 -06:00
parent a64a1cb177
commit 58e24e18a2
2 changed files with 9 additions and 1 deletions

View File

@ -88,7 +88,7 @@
(if (symbol? label)
(set-size #f #f 32 32)
(auto-size font label 0 0 0 0))
(auto-size font (strip-& label) 0 0 0 0))
(define/public (set-preferred-size) #f)

View File

@ -47,6 +47,7 @@
SelectObject
WideCharToMultiByte
GetDeviceCaps
strip-&
->screen
->normal))
@ -163,6 +164,13 @@
-> _int))
;; ----------------------------------------
(define (strip-& s)
(if (string? s)
(regexp-replace* #rx"&(.)" s "\\1")
s))
;; ----------------------------------------
(define-gdi32 GetDeviceCaps (_wfun _HDC _int -> _int))
(define screen-dpi