diff --git a/collects/mred/private/wx/win32/const.rkt b/collects/mred/private/wx/win32/const.rkt index 6f8b4cb8..a72df087 100644 --- a/collects/mred/private/wx/win32/const.rkt +++ b/collects/mred/private/wx/win32/const.rkt @@ -400,7 +400,7 @@ (define BS_FLAT #x00008000) (define BS_RIGHTBUTTON BS_LEFTTEXT) -(define CW_USEDEFAULT #x80000000) +(define CW_USEDEFAULT (- #x80000000)) ; minus sign => int instead of uint (define WS_EX_LAYERED #x00080000) (define WS_EX_TRANSPARENT #x00000020) diff --git a/collects/mred/private/wx/win32/dialog.rkt b/collects/mred/private/wx/win32/dialog.rkt index c249f2f9..18ed2593 100644 --- a/collects/mred/private/wx/win32/dialog.rkt +++ b/collects/mred/private/wx/win32/dialog.rkt @@ -34,7 +34,7 @@ (class (dialog-mixin frame%) (super-new) - (define/override (create-frame parent label w h style) + (define/override (create-frame parent label x y w h style) (let ([hwnd (CreateDialogIndirectParamW hInstance (make-DLGTEMPLATE @@ -46,7 +46,9 @@ dialog-proc 0)]) (SetWindowTextW hwnd label) - (MoveWindow hwnd 0 0 w h #t) + (let ([x (if (= x -11111) 0 x)] + [y (if (= y -11111) 0 y)]) + (MoveWindow hwnd x y w h #t)) hwnd)) (define/override (is-dialog?) #t))) diff --git a/collects/mred/private/wx/win32/frame.rkt b/collects/mred/private/wx/win32/frame.rkt index 058d5caa..4bbfcddf 100644 --- a/collects/mred/private/wx/win32/frame.rkt +++ b/collects/mred/private/wx/win32/frame.rkt @@ -108,7 +108,7 @@ pre-on-char pre-on-event reset-cursor-in-child) - (define/public (create-frame parent label w h style) + (define/public (create-frame parent label x y w h style) (CreateWindowExW (if (memq 'float style) (bitwise-ior WS_EX_TOOLWINDOW (if (memq 'no-caption style) @@ -131,7 +131,9 @@ 0 (bitwise-ior WS_CAPTION WS_MINIMIZEBOX))) - 0 0 w h + (if (= x -11111) CW_USEDEFAULT x) + (if (= y -11111) CW_USEDEFAULT y) + w h #f #f hInstance @@ -146,7 +148,7 @@ (define max-height #f) (super-new [parent #f] - [hwnd (create-frame parent label w h style)] + [hwnd (create-frame parent label x y w h style)] [style (cons 'deleted style)]) (define hwnd (get-hwnd)) @@ -185,7 +187,9 @@ (set! hidden-zoomed? (is-maximized?))) (super direct-show on? (if hidden-zoomed? SW_SHOWMAXIMIZED - SW_SHOW))) + SW_SHOW)) + (when (and on? (iconized?)) + (ShowWindow hwnd SW_RESTORE))) (define/public (destroy) (direct-show #f)) @@ -393,7 +397,7 @@ (define/public (iconize on?) (when (is-shown?) - (when (or on? (not (iconized?))) + (unless (eq? (and on? #t) (iconized?)) (ShowWindow hwnd (if on? SW_MINIMIZE SW_RESTORE))))) (define/private (get-placement) diff --git a/collects/tests/gracket/windowing.rktl b/collects/tests/gracket/windowing.rktl index 34e479a4..b90260e0 100644 --- a/collects/tests/gracket/windowing.rktl +++ b/collects/tests/gracket/windowing.rktl @@ -259,6 +259,14 @@ (pause) (pause) (st #t f is-iconized?) + (stv f iconize #f) + (pause) + (pause) + (st #f f is-iconized?) + (stv f iconize #t) + (pause) + (pause) + (st #t f is-iconized?) (stv f show #t) (pause) (st #f f is-iconized?) @@ -277,16 +285,16 @@ (st 151 f get-height) (printf "Resize\n") - (stv f resize 56 57) + (stv f resize 156 57) (pause) (FAILS (st 34 f get-x)) (FAILS (st 37 f get-y)) - (st 56 f get-width) + (st 156 f get-width) (st 57 f get-height) (stv f center) (pause) - (st 56 f get-width) + (st 156 f get-width) (st 57 f get-height) (client->screen-tests)