racket/gui win32: fix measurement of message% content

Strip away "&" before measuring.

original commit: 58e24e18a27fee2b6b487f5163c2eda48e347546
This commit is contained in:
Matthew Flatt 2014-09-23 13:03:07 -06:00
parent 20bc95fb98
commit 22ac1a94f2
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